rebill-web-components-sdk 1.10.6 → 1.10.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/card-fields-wrapper.card-identification.card-iframe.card-skeleton.rebill-address-form.rebill-address-search.rebill-input-combo.rebill-input-phone.rebill-installments.selectable-card.single-payment-method.entry.cjs.js.map +1 -1
- package/dist/cjs/card-fields-wrapper_11.cjs.entry.js +9 -12
- package/dist/cjs/index-C-VTnc0I.js.map +1 -1
- package/dist/cjs/rebill-change-card.cjs.entry.js +1 -2
- package/dist/cjs/rebill-change-card.entry.cjs.js.map +1 -1
- package/dist/cjs/rebill-checkout.cjs.entry.js +10 -3
- package/dist/cjs/rebill-checkout.entry.cjs.js.map +1 -1
- package/dist/cjs/rebill-form.cjs.entry.js +5 -2
- package/dist/cjs/rebill-form.entry.cjs.js.map +1 -1
- package/dist/collection/components/change-card/rebill-change-card.js +1 -2
- package/dist/collection/components/change-card/rebill-change-card.js.map +1 -1
- package/dist/collection/components/checkout/rebill-checkout.js +10 -3
- package/dist/collection/components/checkout/rebill-checkout.js.map +1 -1
- package/dist/collection/components/shared/form/form.js +5 -2
- package/dist/collection/components/shared/form/form.js.map +1 -1
- package/dist/collection/components/shared/inputs/input-phone/input-phone.js +9 -12
- package/dist/collection/components/shared/inputs/input-phone/input-phone.js.map +1 -1
- package/dist/components/p-8BpuJ_V5.js.map +1 -1
- package/dist/components/{p-0y1EkPsV.js → p-CRMAYXj0.js} +3 -3
- package/dist/components/{p-0y1EkPsV.js.map → p-CRMAYXj0.js.map} +1 -1
- package/dist/components/{p-BFqhozQ0.js → p-DKPrueOT.js} +3 -3
- package/dist/components/{p-BFqhozQ0.js.map → p-DKPrueOT.js.map} +1 -1
- package/dist/components/{p-Cs-pA3OO.js → p-DVaxhIJe.js} +7 -4
- package/dist/components/p-DVaxhIJe.js.map +1 -0
- package/dist/components/{p-RbKsk0NK.js → p-Dsv10JVE.js} +11 -14
- package/dist/components/p-Dsv10JVE.js.map +1 -0
- package/dist/components/rebill-change-card.js +5 -6
- package/dist/components/rebill-change-card.js.map +1 -1
- package/dist/components/rebill-checkout-form.js +1 -1
- package/dist/components/rebill-checkout.js +14 -7
- package/dist/components/rebill-checkout.js.map +1 -1
- package/dist/components/rebill-form.js +1 -1
- package/dist/components/rebill-input-phone.js +1 -1
- package/dist/components/rebill-renewal.js +4 -4
- package/dist/components/root-component.js +1 -1
- package/dist/components/user-information-phone.js +1 -1
- package/dist/esm/card-fields-wrapper.card-identification.card-iframe.card-skeleton.rebill-address-form.rebill-address-search.rebill-input-combo.rebill-input-phone.rebill-installments.selectable-card.single-payment-method.entry.js.map +1 -1
- package/dist/esm/card-fields-wrapper_11.entry.js +9 -12
- package/dist/esm/index-BTZ7D7jU.js.map +1 -1
- package/dist/esm/rebill-change-card.entry.js +1 -2
- package/dist/esm/rebill-change-card.entry.js.map +1 -1
- package/dist/esm/rebill-checkout.entry.js +10 -3
- package/dist/esm/rebill-checkout.entry.js.map +1 -1
- package/dist/esm/rebill-form.entry.js +5 -2
- package/dist/esm/rebill-form.entry.js.map +1 -1
- package/dist/rebill-web-components-sdk/card-fields-wrapper.card-identification.card-iframe.card-skeleton.rebill-address-form.rebill-address-search.rebill-input-combo.rebill-input-phone.rebill-installments.selectable-card.single-payment-method.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/{p-a8726b6d.entry.js → p-85e7cd6f.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-a8726b6d.entry.js.map → p-85e7cd6f.entry.js.map} +1 -1
- package/dist/rebill-web-components-sdk/{p-d827e221.entry.js → p-90c50e5b.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/p-90c50e5b.entry.js.map +1 -0
- package/dist/rebill-web-components-sdk/p-BTZ7D7jU.js.map +1 -1
- package/dist/rebill-web-components-sdk/{p-14fb1c5c.entry.js → p-ae158592.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/p-ae158592.entry.js.map +1 -0
- package/dist/rebill-web-components-sdk/{p-1a99d53d.entry.js → p-e6df1fe2.entry.js} +2 -2
- package/dist/rebill-web-components-sdk/{p-1a99d53d.entry.js.map → p-e6df1fe2.entry.js.map} +1 -1
- package/dist/rebill-web-components-sdk/rebill-change-card.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-checkout.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-form.entry.esm.js.map +1 -1
- package/dist/rebill-web-components-sdk/rebill-web-components-sdk.esm.js +1 -1
- package/package.json +1 -1
- package/dist/components/p-Cs-pA3OO.js.map +0 -1
- package/dist/components/p-RbKsk0NK.js.map +0 -1
- package/dist/rebill-web-components-sdk/p-14fb1c5c.entry.js.map +0 -1
- package/dist/rebill-web-components-sdk/p-d827e221.entry.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rebill-form.entry.esm.js","sources":["src/utils/form-validation.ts","src/components/shared/form/form.tsx"],"sourcesContent":["import * as yup from 'yup';\n\nexport interface ValidationSchema {\n [key: string]: yup.Schema<any>;\n}\n\nexport interface FormErrors {\n [key: string]: string;\n}\n\nexport interface FormData {\n [key: string]: any;\n}\n\nexport class FormValidator {\n private schema: yup.ObjectSchema<any>;\n\n constructor(validationSchema: ValidationSchema) {\n this.schema = yup.object().shape(validationSchema);\n }\n\n async validateField(fieldName: string, formData: FormData): Promise<string> {\n try {\n await this.schema.validateAt(fieldName, formData);\n return '';\n } catch (error) {\n if (error instanceof yup.ValidationError) {\n return error.message;\n }\n return '';\n }\n }\n\n async validateForm(formData: FormData): Promise<FormErrors> {\n try {\n await this.schema.validate(formData, { abortEarly: false });\n return {};\n } catch (error) {\n if (error instanceof yup.ValidationError) {\n const errors: FormErrors = {};\n error.inner.forEach(err => {\n if (err.path) {\n errors[err.path] = err.message;\n }\n });\n return errors;\n }\n return {};\n }\n }\n}\n","import {\n Component,\n Event,\n EventEmitter,\n h,\n Listen,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { FormData, FormErrors, FormValidator } from '../../../utils/form-validation';\n\n@Component({\n tag: 'rebill-form',\n shadow: false,\n})\nexport class Form {\n /** Esquema de validación del formulario */\n @Prop() validationSchema: any;\n /** Datos iniciales del formulario */\n @Prop() initialData: FormData = {};\n /** Evento cuando el formulario es válido y se envía */\n @Event() submit: EventEmitter<FormData>;\n /** Evento cuando hay cambios en el formulario */\n @Event() change: EventEmitter<FormData>;\n /** Función render prop para controlar el formulario */\n @Prop() renderForm?: (props: {\n submit: () => void;\n formData: FormData;\n errors: FormErrors;\n }) => any;\n\n @State() formData: FormData = {};\n @State() errors: FormErrors = {};\n private validator: FormValidator;\n private hasSubmitted: boolean = false;\n\n @Watch('initialData')\n handleInitialDataChange(newValue: FormData) {\n const updatedFormData = { ...this.formData };\n Object.keys(newValue).forEach(key => {\n if (updatedFormData[key] === undefined || updatedFormData[key] === '') {\n updatedFormData[key] = newValue[key];\n }\n });\n this.formData = updatedFormData;\n this.change.emit(this.formData);\n }\n\n @Watch('validationSchema')\n handleValidationSchemaChange(newSchema: any) {\n this.validator = new FormValidator(newSchema);\n }\n\n componentWillLoad() {\n this.formData = { ...this.initialData };\n this.validator = new FormValidator(this.validationSchema);\n setTimeout(() => {\n this.change.emit(this.formData);\n }, 100);\n }\n\n private setFieldValue(id: string, value: any) {\n if (this.formData[id] !== value) {\n this.formData = {\n ...this.formData,\n [id]: value,\n };\n }\n }\n\n private setFieldError(id: string, error: string) {\n if (this.errors[id] !== error) {\n this.errors = {\n ...this.errors,\n [id]: error,\n };\n }\n }\n\n private clearFieldError(id: string) {\n if (this.hasFieldError(id)) {\n this.setFieldError(id, '');\n }\n }\n\n private hasFieldError(id: string) {\n return this.errors[id] !== '';\n }\n\n @Listen('input')\n async handleInputChange(event: CustomEvent) {\n if (!event.detail || !event.detail.id) return;\n const { id, value, disabled } = event.detail;\n\n this.setFieldValue(id, value);\n\n if (this.hasSubmitted && !disabled) {\n const error = await this.validator.validateField(id, this.formData);\n this.setFieldError(id, error);\n } else {\n if (this.hasFieldError(id)) {\n this.clearFieldError(id);\n }\n }\n this.change.emit(this.formData);\n }\n @Listen('blur')\n async handleBlur(event: CustomEvent) {\n if (!event.detail || !event.detail.id) return;\n const { id, disabled } = event.detail;\n\n if (!disabled) {\n const error = await this.validator.validateField(id, this.formData);\n this.setFieldError(id, error);\n }\n }\n\n @Method()\n async submitForm() {\n this.hasSubmitted = true;\n this.errors = {};\n\n const errors = await this.validator.validateForm(this.formData);\n this.errors = errors;\n\n if (Object.values(this.errors).filter(value => !!value).length === 0) {\n this.submit.emit(this.formData);\n }\n }\n\n @Method()\n async resetValidation() {\n this.hasSubmitted = false;\n this.errors = {};\n }\n\n @Method()\n async clearError(fieldId: string) {\n this.clearFieldError(fieldId);\n }\n private handleSubmit = async (event: Event) => {\n event.preventDefault();\n await this.submitForm();\n };\n\n render() {\n return (\n <form onSubmit={e => this.handleSubmit(e)} noValidate>\n {this.renderForm ? (\n this.renderForm({\n submit: () => this.submitForm(),\n formData: this.formData,\n errors: this.errors,\n })\n ) : (\n <slot></slot>\n )}\n </form>\n );\n }\n}\n"],"names":["yup.object","yup.ValidationError"],"mappings":";;;;MAca,aAAa,CAAA;AAChB,IAAA,MAAM;AAEd,IAAA,WAAA,CAAY,gBAAkC,EAAA;AAC5C,QAAA,IAAI,CAAC,MAAM,GAAGA,QAAU,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC;;AAGpD,IAAA,MAAM,aAAa,CAAC,SAAiB,EAAE,QAAkB,EAAA;AACvD,QAAA,IAAI;YACF,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,QAAQ,CAAC;AACjD,YAAA,OAAO,EAAE;;QACT,OAAO,KAAK,EAAE;AACd,YAAA,IAAI,KAAK,YAAYC,eAAmB,EAAE;gBACxC,OAAO,KAAK,CAAC,OAAO;;AAEtB,YAAA,OAAO,EAAE;;;IAIb,MAAM,YAAY,CAAC,QAAkB,EAA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,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE;YACpE,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC;;;AAKnC,IAAA,MAAM,eAAe,GAAA;AACnB,QAAA,IAAI,CAAC,YAAY,GAAG,KAAK;AACzB,QAAA,IAAI,CAAC,MAAM,GAAG,EAAE;;IAIlB,MAAM,UAAU,CAAC,OAAe,EAAA;AAC9B,QAAA,IAAI,CAAC,eAAe,CAAC,OAAO,CAAC;;AAEvB,IAAA,YAAY,GAAG,OAAO,KAAY,KAAI;QAC5C,KAAK,CAAC,cAAc,EAAE;AACtB,QAAA,MAAM,IAAI,CAAC,UAAU,EAAE;AACzB,KAAC;IAED,MAAM,GAAA;AACJ,QAAA,QACE,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,UAAU,EAAA,IAAA,EAAA,EAClD,IAAI,CAAC,UAAU,IACd,IAAI,CAAC,UAAU,CAAC;AACd,YAAA,MAAM,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE;YAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;AACpB,SAAA,CAAC,KAEF,CAAa,CAAA,MAAA,EAAA,IAAA,CAAA,CACd,CACI;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"rebill-form.entry.esm.js","sources":["src/utils/form-validation.ts","src/components/shared/form/form.tsx"],"sourcesContent":["import * as yup from 'yup';\n\nexport interface ValidationSchema {\n [key: string]: yup.Schema<any>;\n}\n\nexport interface FormErrors {\n [key: string]: string;\n}\n\nexport interface FormData {\n [key: string]: any;\n}\n\nexport class FormValidator {\n private schema: yup.ObjectSchema<any>;\n\n constructor(validationSchema: ValidationSchema) {\n this.schema = yup.object().shape(validationSchema);\n }\n\n async validateField(fieldName: string, formData: FormData): Promise<string> {\n try {\n await this.schema.validateAt(fieldName, formData);\n return '';\n } catch (error) {\n if (error instanceof yup.ValidationError) {\n return error.message;\n }\n return '';\n }\n }\n\n async validateForm(formData: FormData): Promise<FormErrors> {\n try {\n await this.schema.validate(formData, { abortEarly: false });\n return {};\n } catch (error) {\n if (error instanceof yup.ValidationError) {\n const errors: FormErrors = {};\n error.inner.forEach(err => {\n if (err.path) {\n errors[err.path] = err.message;\n }\n });\n return errors;\n }\n return {};\n }\n }\n}\n","import {\n Component,\n Event,\n EventEmitter,\n h,\n Listen,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { FormData, FormErrors, FormValidator } from '../../../utils/form-validation';\n\n@Component({\n tag: 'rebill-form',\n shadow: false,\n})\nexport class Form {\n /** Esquema de validación del formulario */\n @Prop() validationSchema: any;\n /** Datos iniciales del formulario */\n @Prop() initialData: FormData = {};\n /** Evento cuando el formulario es válido y se envía */\n @Event() submit: EventEmitter<FormData>;\n /** Evento cuando hay cambios en el formulario */\n @Event() change: EventEmitter<FormData>;\n /** Función render prop para controlar el formulario */\n @Prop() renderForm?: (props: {\n submit: () => void;\n formData: FormData;\n errors: FormErrors;\n }) => any;\n\n @State() formData: FormData = {};\n @State() errors: FormErrors = {};\n private validator: FormValidator;\n private hasSubmitted: boolean = false;\n\n @Watch('initialData')\n handleInitialDataChange(newValue: FormData) {\n const updatedFormData = { ...this.formData };\n Object.keys(newValue).forEach(key => {\n if (updatedFormData[key] === undefined || updatedFormData[key] === '') {\n updatedFormData[key] = newValue[key];\n }\n });\n this.formData = updatedFormData;\n this.change.emit(this.formData);\n }\n\n @Watch('validationSchema')\n handleValidationSchemaChange(newSchema: any) {\n this.validator = new FormValidator(newSchema);\n }\n\n componentWillLoad() {\n this.formData = { ...this.initialData };\n this.validator = new FormValidator(this.validationSchema);\n setTimeout(() => {\n this.change.emit(this.formData);\n }, 100);\n }\n\n private setFieldValue(id: string, value: any) {\n if (this.formData[id] !== value) {\n this.formData = {\n ...this.formData,\n [id]: value,\n };\n }\n }\n\n private setFieldError(id: string, error: string) {\n if (this.errors[id] !== error) {\n this.errors = {\n ...this.errors,\n [id]: error,\n };\n }\n }\n\n private clearFieldError(id: string) {\n if (this.hasFieldError(id)) {\n this.setFieldError(id, '');\n }\n }\n\n private hasFieldError(id: string) {\n return this.errors[id] !== '';\n }\n\n @Listen('input')\n async handleInputChange(event: CustomEvent) {\n if (!event.detail || !event.detail.id) return;\n const { id, value, disabled } = event.detail;\n\n this.setFieldValue(id, value);\n\n if (this.hasSubmitted && !disabled) {\n const error = await this.validator.validateField(id, this.formData);\n this.setFieldError(id, error);\n } else {\n if (this.hasFieldError(id)) {\n this.clearFieldError(id);\n }\n }\n this.change.emit(this.formData);\n }\n @Listen('blur')\n async handleBlur(event: CustomEvent) {\n if (!event.detail || !event.detail.id) return;\n const { id, value, disabled } = event.detail as { id: string; value?: any; disabled?: boolean };\n\n if (value !== undefined) {\n this.setFieldValue(id, value);\n }\n\n if (!disabled) {\n const error = await this.validator.validateField(id, this.formData);\n this.setFieldError(id, error);\n }\n }\n\n @Method()\n async submitForm() {\n this.hasSubmitted = true;\n this.errors = {};\n\n const errors = await this.validator.validateForm(this.formData);\n this.errors = errors;\n\n if (Object.values(this.errors).filter(value => !!value).length === 0) {\n this.submit.emit(this.formData);\n }\n }\n\n @Method()\n async resetValidation() {\n this.hasSubmitted = false;\n this.errors = {};\n }\n\n @Method()\n async clearError(fieldId: string) {\n this.clearFieldError(fieldId);\n }\n private handleSubmit = async (event: Event) => {\n event.preventDefault();\n await this.submitForm();\n };\n\n render() {\n return (\n <form onSubmit={e => this.handleSubmit(e)} noValidate>\n {this.renderForm ? (\n this.renderForm({\n submit: () => this.submitForm(),\n formData: this.formData,\n errors: this.errors,\n })\n ) : (\n <slot></slot>\n )}\n </form>\n );\n }\n}\n"],"names":["yup.object","yup.ValidationError"],"mappings":";;;;MAca,aAAa,CAAA;AAChB,IAAA,MAAM;AAEd,IAAA,WAAA,CAAY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,CAAC;AACd,YAAA,MAAM,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE;YAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;AACpB,SAAA,CAAC,KAEF,CAAa,CAAA,MAAA,EAAA,IAAA,CAAA,CACd,CACI;;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{p as e,b as t}from"./p-BTZ7D7jU.js";export{s as setNonce}from"./p-BTZ7D7jU.js";import{g as r}from"./p-DQuL1Twl.js";var a=()=>{const t=import.meta.url;const r={};if(t!==""){r.resourcesUrl=new URL(".",t).href}return e(r)};a().then((async e=>{await r();return t(JSON.parse('[["p-a8726b6d",[[256,"rebill-checkout",{"productId":[1,"product-id"],"planId":[1,"plan-id"],"publicKey":[1,"public-key"],"instantProduct":[1,"instant-product"],"instantPlan":[1,"instant-plan"],"display":[1],"customerInformation":[1,"customer-information"],"oneClickCheckout":[4,"one-click-checkout"],"css":[1],"language":[1],"checkoutLandingSession":[1,"checkout-landing-session"],"externalPayment":[1,"external-payment"],"rejectedPaymentCard":[32],"rejectedPaymentAPM":[32],"countries":[32],"currentPaymentMethod":[32],"checkoutResponse":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"isAPMSubmitting":[32],"isAPMSuccess":[32],"storedCheckoutResults":[32],"alertErrorKeys":[32],"currentApmPaymentMethod":[32],"breakpoint":[32],"showRefreshModal":[32],"cardError":[32],"initialData":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"customerExists":[32],"showOtp":[32],"otpVerified":[32],"responseCheckoutCard":[32],"cardMode":[32],"submit":[64]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"input","handleInputChange"],[0,"onRebillAccountClick","handleRebillAccountClick"],[0,"returnForm","handleReturnForm"],[0,"signOut","handleSignOut"],[0,"codeVerified","handleCodeVerified"]],{"language":["handleLanguageChange"]}]]],["p-d2d7500e",[[256,"rebill-renewal",{"renewalData":[1,"renewal-data"],"renewalToken":[1,"renewal-token"],"currentPaymentMethod":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"errorMessage":[32],"breakpoint":[32],"errorPaymentCard":[32],"errorPaymentAPM":[32],"initialData":[32],"checkoutResponse":[32],"currentApmPaymentMethod":[32],"countries":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"errorCardInvalid":[32],"cardMode":[32]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"bankSelected","handleBankSelected"],[0,"cardSelected","handleCardSelected"]]]]],["p-14fb1c5c",[[256,"rebill-change-card",{"changeCardData":[1,"change-card-data"],"changeCardToken":[1,"change-card-token"],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"errorMessage":[32],"breakpoint":[32],"errorPaymentCard":[32],"initialData":[32],"countries":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"errorCardInvalid":[32],"cardMode":[32],"completedAt":[32]}]]],["p-1b4222b8",[[256,"root-component",{"isLoading":[32],"currentLang":[32],"formData":[32]}]]],["p-1f253272",[[256,"rebill-card-carousel",{"interval":[2],"size":[1],"color":[1],"showAllCards":[4,"show-all-cards"],"currentIndex":[32]}]]],["p-2c464942",[[260,"rebill-flex-container",{"direction":[1],"wrap":[1],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-07ef4ea3",[[260,"rebill-grid-container",{"columns":[2],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-64d035a5",[[256,"renewal-success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}]]],["p-eb5a43f1",[[256,"change-card-success",{"customerName":[1,"customer-name"],"cardLastFour":[1,"card-last-four"],"cardBrand":[1,"card-brand"],"paymentDate":[1,"payment-date"],"customerEmail":[1,"customer-email"],"currentLocale":[32]}]]],["p-860f0784",[[256,"discount-coupon",{"hideLabel":[4,"hide-label"],"displayMode":[1,"display-mode"],"readonlyCouponCode":[1,"readonly-coupon-code"],"readonlyDiscountAmount":[2,"readonly-discount-amount"],"readonlyCurrency":[1,"readonly-currency"],"couponCode":[32],"actionStatus":[32],"isLoading":[32],"isError":[32],"currentLocale":[32]}],[256,"rebill-divider"],[260,"collapsible-card",{"header":[1],"open":[4],"variant":[1],"isOpen":[32]}]]],["p-af433267",[[256,"renewal-summary",{"displayedComponents":[16],"totalAmount":[2,"total-amount"],"subTotalAmount":[2,"sub-total-amount"],"subscriptionTitle":[1,"subscription-title"],"subscriptionAmount":[2,"subscription-amount"],"nextChargeDate":[1,"next-charge-date"],"frequency":[16],"currency":[1],"couponCode":[1,"coupon-code"],"discountAmount":[2,"discount-amount"],"discountPercentage":[2,"discount-percentage"],"titleKey":[1,"title-key"],"forceUpdate":[32]}]]],["p-37ce3457",[[256,"input-otp",{"error":[1],"otp":[1],"clearable":[4],"placeholder":[1],"otpValue":[32]}]]],["p-9a506148",[[256,"rebill-card",{"cardTitle":[1,"card-title"],"cardLabels":[16]}]]],["p-728a5b5d",[[260,"rebill-container",{"maxWidth":[1,"max-width"],"padding":[1],"fluid":[4]}],[256,"rebill-input-checkbox",{"label":[1],"checked":[1540],"error":[1],"id":[1],"disabled":[4]},[[4,"change","handleFormChange"]]]]],["p-82c4171e",[[256,"rebill-alert",{"type":[1],"message":[1],"alertTitle":[1,"alert-title"],"icon":[1],"variant":[1],"size":[1],"colorIcon":[1,"color-icon"]}]]],["p-d8089da8",[[256,"rebill-timeline-debit-day",{"debitDay":[2,"debit-day"],"totalAmount":[2,"total-amount"],"planAmount":[2,"plan-amount"],"currency":[1],"debitStrategy":[1,"debit-strategy"],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}],[256,"rebill-timeline-free-trial",{"trialPeriodEndsAt":[1,"trial-period-ends-at"],"trialPeriodEndsReminderAt":[1,"trial-period-ends-reminder-at"],"trialPeriodDays":[2,"trial-period-days"],"subtotal":[2],"currency":[1],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}]]],["p-d4c04783",[[256,"rebill-mode-sandbox",{"isPanelVisible":[32],"isPanelClosing":[32],"isCardsPanelVisible":[32],"isCardsPanelClosing":[32],"currentLanguage":[32]}],[256,"rebill-mode-sandbox-mobile",{"isPanelVisible":[32],"currentLanguage":[32]}]]],["p-4355b35a",[[256,"rebill-vertical-divider",{"height":[1],"color":[1],"thickness":[1],"dashed":[4],"connectorActive":[4,"connector-active"],"withDot":[4,"with-dot"]}]]],["p-e06b1f90",[[260,"rebill-typography",{"variant":[1],"color":[1],"align":[1],"noWrap":[4,"no-wrap"],"gutterBottom":[4,"gutter-bottom"],"paragraph":[4]}],[256,"rebill-icon",{"name":[1],"size":[1],"color":[1],"svgContent":[32]}]]],["p-9a89f57f",[[256,"rebill-input-text",{"label":[1],"placeholder":[1],"value":[1537],"error":[1],"id":[1],"disabled":[4],"leftIcon":[1,"left-icon"],"rightIcon":[1,"right-icon"],"clearable":[4],"variant":[1],"uppercase":[4],"getInputElement":[64]},[[4,"change","handleFormChange"]]]]],["p-aaa9fb70",[[256,"rebill-input-select",{"label":[1],"options":[16],"value":[1537],"error":[1],"id":[1],"disabled":[4],"placeholder":[1],"variant":[1],"arrowIcon":[1,"arrow-icon"],"dropPosition":[1,"drop-position"],"fontSize":[1,"font-size"],"backgroundColor":[1,"background-color"],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"loading":[4],"isOpen":[32],"componentId":[32],"highlightedIndex":[32],"searchTerm":[32],"filteredOptions":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"],[0,"keydown","handleKeyDown"]]]]],["p-ba1b35fb",[[260,"rebill-button",{"type":[1],"disabled":[4],"id":[1],"loading":[4],"showSpinnerWithText":[4,"show-spinner-with-text"],"nonClickable":[4,"non-clickable"],"variant":[1],"theme":[1],"size":[1],"icon":[1],"iconColor":[1,"icon-color"]}]]],["p-ba5c9f7f",[[256,"rebill-card-icon",{"cardBrand":[1,"card-brand"],"width":[2],"height":[2]}],[260,"rebill-checkout-single-column"],[256,"rebill-footer",{"breakpoint":[32]}],[256,"organization-logo",{"organization":[16]}]]],["p-26d57782",[[256,"rebill-summary",{"totalAmount":[8,"total-amount"],"itemTitle":[1,"item-title"],"itemDescription":[1,"item-description"],"itemAmount":[8,"item-amount"],"planFrequency":[1,"plan-frequency"],"planFrequencyCount":[2,"plan-frequency-count"],"subtotal":[8],"discount":[8],"currency":[1],"displayedComponents":[16],"allowCoupon":[4,"allow-coupon"],"currentBreakpoint":[1,"current-breakpoint"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"discountApplied":[32]},[[0,"discountApplied","handleDiscountApplied"]]],[256,"success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}],[256,"otp-component",{"timeLeft":[32],"isTimerRunning":[32],"codeResent":[32],"isVerifying":[32],"otpValue":[32],"error":[32]}],[256,"user-information",{"userInformation":[16],"errors":[16],"customerExists":[4,"customer-exists"],"disabled":[4]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]]],[256,"rebill-modal-overlay",{"visible":[32],"languageUpdateTrigger":[32]}]]],["p-1c000e38",[[260,"rebill-autofill-detector",{"targetSelector":[1,"target-selector"],"disabled":[4],"browserAutocompleteDetected":[32],"disabledDetector":[32]}]]],["p-1a99d53d",[[260,"rebill-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"formData":[32],"errors":[32],"submitForm":[64],"resetValidation":[64],"clearError":[64]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]],{"initialData":["handleInitialDataChange"],"validationSchema":["handleValidationSchemaChange"]}]]],["p-d827e221",[[256,"card-fields-wrapper",{"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"showDocument":[4,"show-document"],"customCSS":[1,"custom-c-s-s"]}],[256,"rebill-address-form",{"addressType":[1,"address-type"],"countryOptions":[16],"stateOptions":[16],"errors":[16],"disabled":[4],"showAdditionalInformation":[32]}],[256,"rebill-address-search",{"addressType":[1,"address-type"],"placeholder":[1],"error":[1],"disabled":[4],"isInitialized":[32],"currentLocale":[32]}],[256,"single-payment-method",{"paymentMethod":[1,"payment-method"],"currencyCountry":[1,"currency-country"],"paymentMethodDetails":[16],"icons":[16]}],[256,"rebill-input-phone",{"placeholder":[1],"value":[1537],"error":[1],"phoneNumberId":[1,"phone-number-id"],"countryCodeId":[1,"country-code-id"],"validationErrorId":[1,"validation-error-id"],"disabled":[4],"initialCountry":[1,"initial-country"],"required":[4],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"selectedCountry":[32],"isDropdownOpen":[32],"validationError":[32],"searchTerm":[32],"filteredCountries":[32],"componentId":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[260,"selectable-card",{"selected":[4],"label":[1],"cardKey":[1,"card-key"],"disabled":[4]}],[256,"rebill-installments",{"error":[1],"currentValue":[32],"isDisabled":[32],"value":[32],"placeholder":[32]}],[256,"card-identification",{"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"disabled":[4],"documentTypes":[32],"country":[32],"currentLanguage":[32]}],[256,"card-iframe",{"customCSS":[1,"custom-c-s-s"],"iframeLoaded":[32],"currentLang":[32],"initialLang":[32],"iframeHeight":[32]}],[256,"rebill-input-combo",{"label":[1],"options":[16],"selectValue":[1537,"select-value"],"inputValue":[1537,"input-value"],"inputPlaceholder":[1,"input-placeholder"],"selectPlaceholder":[1,"select-placeholder"],"error":[1],"selectId":[1,"select-id"],"inputId":[1,"input-id"],"disabled":[4],"selectWidth":[1,"select-width"],"isOpen":[32],"highlightedIndex":[32],"componentId":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[256,"card-skeleton"]]],["p-f4588c0f",[[256,"apm-checkout",{"paymentMethod":[1,"payment-method"],"referenceId":[1,"reference-id"],"qrCodeData":[1,"qr-code-data"],"code":[1],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"country":[1],"redirectUrl":[1,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"checkoutRequestId":[1,"checkout-request-id"],"bearerToken":[1,"bearer-token"],"bankTransferData":[8,"bank-transfer-data"],"barcode":[1],"showRedirectMessage":[32],"isPolling":[32],"minutesLeft":[32],"qrStartTime":[32],"downloadData":[32]}],[256,"rebill-bank-selector",{"banks":[16],"defaultSelectedBankId":[1,"default-selected-bank-id"],"error":[1],"disabled":[4],"selectedBankId":[32],"languageUpdateTrigger":[32]}],[256,"payment-method-selector",{"enabledPaymentMethods":[16],"defaultSelected":[1,"default-selected"],"showErrorComponent":[4,"show-error-component"],"cardError":[16],"country":[1],"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"showDocument":[4,"show-document"],"documentNumberError":[1,"document-number-error"],"customCSS":[1,"custom-c-s-s"],"errorComponent":[16],"disabled":[4],"icon":[32],"selectedPaymentMethod":[32],"saveCard":[32]},[[0,"selectableCardClick","handleSelectableCardClick"]]],[256,"rebill-address",{"billingView":[1537,"billing-view"],"disabled":[4],"countryOptions":[16],"errors":[16],"currentBillingStateOptions":[32],"isLoadingAddress":[32]}],[256,"rebill-processing-payment",{"titleKey":[1,"title-key"],"subtitleKey":[1,"subtitle-key"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32]}],[256,"bank-transfer",{"bankTransferData":[8,"bank-transfer-data"]}],[256,"qr-code",{"qrCodeData":[1,"qr-code-data"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"paymentMethod":[1,"payment-method"],"code":[1],"qrCodeSvg":[32],"isImage":[32],"timeLeft":[32],"formattedTime":[32],"hasCopied":[32]}],[256,"user-information-static",{"userInfo":[16],"variant":[1]}],[256,"apm-download",{"data":[16]}],[256,"payment-button",{"isDisabled":[4,"is-disabled"],"isLoading":[4,"is-loading"],"paymentMethod":[1,"payment-method"],"isRenewal":[4,"is-renewal"],"isChangeCard":[4,"is-change-card"],"trialPeriodDays":[2,"trial-period-days"],"redirectUrl":[4,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"country":[1],"currentLanguage":[32],"countdownSeconds":[32],"paymentMethodDisplayName":[32]},null,{"redirectUrl":["onRedirectPropsChange"],"timeToRedirect":["onRedirectPropsChange"]}],[256,"user-information-phone",{"error":[1],"countryCode":[1,"country-code"],"disabled":[4],"languageUpdateTrigger":[32]}],[256,"boleto-payment",{"barcode":[1],"referenceId":[1,"reference-id"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"instructions":[16],"showInstructions":[32],"hasCopied":[32]}],[256,"rebill-checkout-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"resetValidation":[64]},[[0,"change","handleFormChange"]]],[256,"reference-code",{"referenceId":[1,"reference-id"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"instructions":[16],"showInstructions":[32]}]]]]'),e)}));
|
|
1
|
+
import{p as e,b as t}from"./p-BTZ7D7jU.js";export{s as setNonce}from"./p-BTZ7D7jU.js";import{g as r}from"./p-DQuL1Twl.js";var a=()=>{const t=import.meta.url;const r={};if(t!==""){r.resourcesUrl=new URL(".",t).href}return e(r)};a().then((async e=>{await r();return t(JSON.parse('[["p-85e7cd6f",[[256,"rebill-checkout",{"productId":[1,"product-id"],"planId":[1,"plan-id"],"publicKey":[1,"public-key"],"instantProduct":[1,"instant-product"],"instantPlan":[1,"instant-plan"],"display":[1],"customerInformation":[1,"customer-information"],"oneClickCheckout":[4,"one-click-checkout"],"css":[1],"language":[1],"checkoutLandingSession":[1,"checkout-landing-session"],"externalPayment":[1,"external-payment"],"rejectedPaymentCard":[32],"rejectedPaymentAPM":[32],"countries":[32],"currentPaymentMethod":[32],"checkoutResponse":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"isAPMSubmitting":[32],"isAPMSuccess":[32],"storedCheckoutResults":[32],"alertErrorKeys":[32],"currentApmPaymentMethod":[32],"breakpoint":[32],"showRefreshModal":[32],"cardError":[32],"initialData":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"customerExists":[32],"showOtp":[32],"otpVerified":[32],"responseCheckoutCard":[32],"cardMode":[32],"submit":[64]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"input","handleInputChange"],[0,"onRebillAccountClick","handleRebillAccountClick"],[0,"returnForm","handleReturnForm"],[0,"signOut","handleSignOut"],[0,"codeVerified","handleCodeVerified"]],{"language":["handleLanguageChange"]}]]],["p-d2d7500e",[[256,"rebill-renewal",{"renewalData":[1,"renewal-data"],"renewalToken":[1,"renewal-token"],"currentPaymentMethod":[32],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"errorMessage":[32],"breakpoint":[32],"errorPaymentCard":[32],"errorPaymentAPM":[32],"initialData":[32],"checkoutResponse":[32],"currentApmPaymentMethod":[32],"countries":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"errorCardInvalid":[32],"cardMode":[32]},[[0,"paymentMethodSelected","handlePaymentMethodSelected"],[0,"bankSelected","handleBankSelected"],[0,"cardSelected","handleCardSelected"]]]]],["p-ae158592",[[256,"rebill-change-card",{"changeCardData":[1,"change-card-data"],"changeCardToken":[1,"change-card-token"],"isSubmitting":[32],"isCardSubmitting":[32],"isCardSuccess":[32],"errorMessage":[32],"breakpoint":[32],"errorPaymentCard":[32],"initialData":[32],"countries":[32],"allRequiredFields":[32],"currentRequiredFields":[32],"errorCardInvalid":[32],"cardMode":[32],"completedAt":[32]}]]],["p-1b4222b8",[[256,"root-component",{"isLoading":[32],"currentLang":[32],"formData":[32]}]]],["p-1f253272",[[256,"rebill-card-carousel",{"interval":[2],"size":[1],"color":[1],"showAllCards":[4,"show-all-cards"],"currentIndex":[32]}]]],["p-2c464942",[[260,"rebill-flex-container",{"direction":[1],"wrap":[1],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-07ef4ea3",[[260,"rebill-grid-container",{"columns":[2],"gap":[1],"alignItems":[1,"align-items"],"justifyContent":[1,"justify-content"]}]]],["p-64d035a5",[[256,"renewal-success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}]]],["p-eb5a43f1",[[256,"change-card-success",{"customerName":[1,"customer-name"],"cardLastFour":[1,"card-last-four"],"cardBrand":[1,"card-brand"],"paymentDate":[1,"payment-date"],"customerEmail":[1,"customer-email"],"currentLocale":[32]}]]],["p-860f0784",[[256,"discount-coupon",{"hideLabel":[4,"hide-label"],"displayMode":[1,"display-mode"],"readonlyCouponCode":[1,"readonly-coupon-code"],"readonlyDiscountAmount":[2,"readonly-discount-amount"],"readonlyCurrency":[1,"readonly-currency"],"couponCode":[32],"actionStatus":[32],"isLoading":[32],"isError":[32],"currentLocale":[32]}],[256,"rebill-divider"],[260,"collapsible-card",{"header":[1],"open":[4],"variant":[1],"isOpen":[32]}]]],["p-af433267",[[256,"renewal-summary",{"displayedComponents":[16],"totalAmount":[2,"total-amount"],"subTotalAmount":[2,"sub-total-amount"],"subscriptionTitle":[1,"subscription-title"],"subscriptionAmount":[2,"subscription-amount"],"nextChargeDate":[1,"next-charge-date"],"frequency":[16],"currency":[1],"couponCode":[1,"coupon-code"],"discountAmount":[2,"discount-amount"],"discountPercentage":[2,"discount-percentage"],"titleKey":[1,"title-key"],"forceUpdate":[32]}]]],["p-37ce3457",[[256,"input-otp",{"error":[1],"otp":[1],"clearable":[4],"placeholder":[1],"otpValue":[32]}]]],["p-9a506148",[[256,"rebill-card",{"cardTitle":[1,"card-title"],"cardLabels":[16]}]]],["p-728a5b5d",[[260,"rebill-container",{"maxWidth":[1,"max-width"],"padding":[1],"fluid":[4]}],[256,"rebill-input-checkbox",{"label":[1],"checked":[1540],"error":[1],"id":[1],"disabled":[4]},[[4,"change","handleFormChange"]]]]],["p-82c4171e",[[256,"rebill-alert",{"type":[1],"message":[1],"alertTitle":[1,"alert-title"],"icon":[1],"variant":[1],"size":[1],"colorIcon":[1,"color-icon"]}]]],["p-d8089da8",[[256,"rebill-timeline-debit-day",{"debitDay":[2,"debit-day"],"totalAmount":[2,"total-amount"],"planAmount":[2,"plan-amount"],"currency":[1],"debitStrategy":[1,"debit-strategy"],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}],[256,"rebill-timeline-free-trial",{"trialPeriodEndsAt":[1,"trial-period-ends-at"],"trialPeriodEndsReminderAt":[1,"trial-period-ends-reminder-at"],"trialPeriodDays":[2,"trial-period-days"],"subtotal":[2],"currency":[1],"language":[1],"discountApplied":[4,"discount-applied"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"currentLanguage":[32]}]]],["p-d4c04783",[[256,"rebill-mode-sandbox",{"isPanelVisible":[32],"isPanelClosing":[32],"isCardsPanelVisible":[32],"isCardsPanelClosing":[32],"currentLanguage":[32]}],[256,"rebill-mode-sandbox-mobile",{"isPanelVisible":[32],"currentLanguage":[32]}]]],["p-4355b35a",[[256,"rebill-vertical-divider",{"height":[1],"color":[1],"thickness":[1],"dashed":[4],"connectorActive":[4,"connector-active"],"withDot":[4,"with-dot"]}]]],["p-e06b1f90",[[260,"rebill-typography",{"variant":[1],"color":[1],"align":[1],"noWrap":[4,"no-wrap"],"gutterBottom":[4,"gutter-bottom"],"paragraph":[4]}],[256,"rebill-icon",{"name":[1],"size":[1],"color":[1],"svgContent":[32]}]]],["p-9a89f57f",[[256,"rebill-input-text",{"label":[1],"placeholder":[1],"value":[1537],"error":[1],"id":[1],"disabled":[4],"leftIcon":[1,"left-icon"],"rightIcon":[1,"right-icon"],"clearable":[4],"variant":[1],"uppercase":[4],"getInputElement":[64]},[[4,"change","handleFormChange"]]]]],["p-aaa9fb70",[[256,"rebill-input-select",{"label":[1],"options":[16],"value":[1537],"error":[1],"id":[1],"disabled":[4],"placeholder":[1],"variant":[1],"arrowIcon":[1,"arrow-icon"],"dropPosition":[1,"drop-position"],"fontSize":[1,"font-size"],"backgroundColor":[1,"background-color"],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"loading":[4],"isOpen":[32],"componentId":[32],"highlightedIndex":[32],"searchTerm":[32],"filteredOptions":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"],[0,"keydown","handleKeyDown"]]]]],["p-ba1b35fb",[[260,"rebill-button",{"type":[1],"disabled":[4],"id":[1],"loading":[4],"showSpinnerWithText":[4,"show-spinner-with-text"],"nonClickable":[4,"non-clickable"],"variant":[1],"theme":[1],"size":[1],"icon":[1],"iconColor":[1,"icon-color"]}]]],["p-ba5c9f7f",[[256,"rebill-card-icon",{"cardBrand":[1,"card-brand"],"width":[2],"height":[2]}],[260,"rebill-checkout-single-column"],[256,"rebill-footer",{"breakpoint":[32]}],[256,"organization-logo",{"organization":[16]}]]],["p-26d57782",[[256,"rebill-summary",{"totalAmount":[8,"total-amount"],"itemTitle":[1,"item-title"],"itemDescription":[1,"item-description"],"itemAmount":[8,"item-amount"],"planFrequency":[1,"plan-frequency"],"planFrequencyCount":[2,"plan-frequency-count"],"subtotal":[8],"discount":[8],"currency":[1],"displayedComponents":[16],"allowCoupon":[4,"allow-coupon"],"currentBreakpoint":[1,"current-breakpoint"],"discountType":[1,"discount-type"],"discountedPercentage":[2,"discounted-percentage"],"discountDuration":[2,"discount-duration"],"discountAmount":[2,"discount-amount"],"discountApplied":[32]},[[0,"discountApplied","handleDiscountApplied"]]],[256,"success-page",{"typePaymentMethod":[1,"type-payment-method"],"country":[1],"bank":[1],"paymentMethodName":[1,"payment-method-name"],"cardLastFour":[1,"card-last-four"],"paymentDate":[1,"payment-date"],"referenceNumber":[1,"reference-number"],"trialPeriodDays":[2,"trial-period-days"],"debitDay":[2,"debit-day"],"planAmount":[2,"plan-amount"],"timeToRedirect":[2,"time-to-redirect"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32],"showRedirectMessage":[32]}],[256,"otp-component",{"timeLeft":[32],"isTimerRunning":[32],"codeResent":[32],"isVerifying":[32],"otpValue":[32],"error":[32]}],[256,"user-information",{"userInformation":[16],"errors":[16],"customerExists":[4,"customer-exists"],"disabled":[4]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]]],[256,"rebill-modal-overlay",{"visible":[32],"languageUpdateTrigger":[32]}]]],["p-1c000e38",[[260,"rebill-autofill-detector",{"targetSelector":[1,"target-selector"],"disabled":[4],"browserAutocompleteDetected":[32],"disabledDetector":[32]}]]],["p-e6df1fe2",[[260,"rebill-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"formData":[32],"errors":[32],"submitForm":[64],"resetValidation":[64],"clearError":[64]},[[0,"input","handleInputChange"],[0,"blur","handleBlur"]],{"initialData":["handleInitialDataChange"],"validationSchema":["handleValidationSchemaChange"]}]]],["p-90c50e5b",[[256,"card-fields-wrapper",{"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"showDocument":[4,"show-document"],"customCSS":[1,"custom-c-s-s"]}],[256,"rebill-address-form",{"addressType":[1,"address-type"],"countryOptions":[16],"stateOptions":[16],"errors":[16],"disabled":[4],"showAdditionalInformation":[32]}],[256,"rebill-address-search",{"addressType":[1,"address-type"],"placeholder":[1],"error":[1],"disabled":[4],"isInitialized":[32],"currentLocale":[32]}],[256,"single-payment-method",{"paymentMethod":[1,"payment-method"],"currencyCountry":[1,"currency-country"],"paymentMethodDetails":[16],"icons":[16]}],[256,"rebill-input-phone",{"placeholder":[1],"value":[1537],"error":[1],"phoneNumberId":[1,"phone-number-id"],"countryCodeId":[1,"country-code-id"],"validationErrorId":[1,"validation-error-id"],"disabled":[4],"initialCountry":[1,"initial-country"],"required":[4],"searchable":[4],"searchPlaceholder":[1,"search-placeholder"],"selectedCountry":[32],"isDropdownOpen":[32],"validationError":[32],"searchTerm":[32],"filteredCountries":[32],"componentId":[32],"languageUpdateTrigger":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[260,"selectable-card",{"selected":[4],"label":[1],"cardKey":[1,"card-key"],"disabled":[4]}],[256,"rebill-installments",{"error":[1],"currentValue":[32],"isDisabled":[32],"value":[32],"placeholder":[32]}],[256,"card-identification",{"documentTypeError":[1,"document-type-error"],"documentNumberError":[1,"document-number-error"],"disabled":[4],"documentTypes":[32],"country":[32],"currentLanguage":[32]}],[256,"card-iframe",{"customCSS":[1,"custom-c-s-s"],"iframeLoaded":[32],"currentLang":[32],"initialLang":[32],"iframeHeight":[32]}],[256,"rebill-input-combo",{"label":[1],"options":[16],"selectValue":[1537,"select-value"],"inputValue":[1537,"input-value"],"inputPlaceholder":[1,"input-placeholder"],"selectPlaceholder":[1,"select-placeholder"],"error":[1],"selectId":[1,"select-id"],"inputId":[1,"input-id"],"disabled":[4],"selectWidth":[1,"select-width"],"isOpen":[32],"highlightedIndex":[32],"componentId":[32]},[[4,"change","handleFormChange"],[4,"closeAllSelects","handleCloseAllSelects"],[4,"click","handleDocumentClick"]]],[256,"card-skeleton"]]],["p-f4588c0f",[[256,"apm-checkout",{"paymentMethod":[1,"payment-method"],"referenceId":[1,"reference-id"],"qrCodeData":[1,"qr-code-data"],"code":[1],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"country":[1],"redirectUrl":[1,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"checkoutRequestId":[1,"checkout-request-id"],"bearerToken":[1,"bearer-token"],"bankTransferData":[8,"bank-transfer-data"],"barcode":[1],"showRedirectMessage":[32],"isPolling":[32],"minutesLeft":[32],"qrStartTime":[32],"downloadData":[32]}],[256,"rebill-bank-selector",{"banks":[16],"defaultSelectedBankId":[1,"default-selected-bank-id"],"error":[1],"disabled":[4],"selectedBankId":[32],"languageUpdateTrigger":[32]}],[256,"payment-method-selector",{"enabledPaymentMethods":[16],"defaultSelected":[1,"default-selected"],"showErrorComponent":[4,"show-error-component"],"cardError":[16],"country":[1],"installmentsError":[1,"installments-error"],"documentTypeError":[1,"document-type-error"],"showDocument":[4,"show-document"],"documentNumberError":[1,"document-number-error"],"customCSS":[1,"custom-c-s-s"],"errorComponent":[16],"disabled":[4],"icon":[32],"selectedPaymentMethod":[32],"saveCard":[32]},[[0,"selectableCardClick","handleSelectableCardClick"]]],[256,"rebill-address",{"billingView":[1537,"billing-view"],"disabled":[4],"countryOptions":[16],"errors":[16],"currentBillingStateOptions":[32],"isLoadingAddress":[32]}],[256,"rebill-processing-payment",{"titleKey":[1,"title-key"],"subtitleKey":[1,"subtitle-key"],"currentLocale":[32],"breakpoint":[32],"loaderProgress":[32],"isLoadingLottie":[32]}],[256,"bank-transfer",{"bankTransferData":[8,"bank-transfer-data"]}],[256,"qr-code",{"qrCodeData":[1,"qr-code-data"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"paymentMethod":[1,"payment-method"],"code":[1],"qrCodeSvg":[32],"isImage":[32],"timeLeft":[32],"formattedTime":[32],"hasCopied":[32]}],[256,"user-information-static",{"userInfo":[16],"variant":[1]}],[256,"apm-download",{"data":[16]}],[256,"payment-button",{"isDisabled":[4,"is-disabled"],"isLoading":[4,"is-loading"],"paymentMethod":[1,"payment-method"],"isRenewal":[4,"is-renewal"],"isChangeCard":[4,"is-change-card"],"trialPeriodDays":[2,"trial-period-days"],"redirectUrl":[4,"redirect-url"],"timeToRedirect":[2,"time-to-redirect"],"country":[1],"currentLanguage":[32],"countdownSeconds":[32],"paymentMethodDisplayName":[32]},null,{"redirectUrl":["onRedirectPropsChange"],"timeToRedirect":["onRedirectPropsChange"]}],[256,"user-information-phone",{"error":[1],"countryCode":[1,"country-code"],"disabled":[4],"languageUpdateTrigger":[32]}],[256,"boleto-payment",{"barcode":[1],"referenceId":[1,"reference-id"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"instructions":[16],"showInstructions":[32],"hasCopied":[32]}],[256,"rebill-checkout-form",{"validationSchema":[8,"validation-schema"],"initialData":[16],"renderForm":[16],"resetValidation":[64]},[[0,"change","handleFormChange"]]],[256,"reference-code",{"referenceId":[1,"reference-id"],"providerName":[1,"provider-name"],"expirationDate":[1,"expiration-date"],"instructions":[16],"showInstructions":[32]}]]]]'),e)}));
|
|
2
2
|
//# sourceMappingURL=rebill-web-components-sdk.esm.js.map
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"file":"p-Cs-pA3OO.js","mappings":";;;MAca,aAAa,CAAA;AAChB,IAAA,MAAM;AAEd,IAAA,WAAA,CAAY,gBAAkC,EAAA;AAC5C,QAAA,IAAI,CAAC,MAAM,GAAGA,QAAU,EAAE,CAAC,KAAK,CAAC,gBAAgB,CAAC;;AAGpD,IAAA,MAAM,aAAa,CAAC,SAAiB,EAAE,QAAkB,EAAA;AACvD,QAAA,IAAI;YACF,MAAM,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,SAAS,EAAE,QAAQ,CAAC;AACjD,YAAA,OAAO,EAAE;;QACT,OAAO,KAAK,EAAE;AACd,YAAA,IAAI,KAAK,YAAYC,eAAmB,EAAE;gBACxC,OAAO,KAAK,CAAC,OAAO;;AAEtB,YAAA,OAAO,EAAE;;;IAIb,MAAM,YAAY,CAAC,QAAkB,EAAA;AACnC,QAAA,IAAI;AACF,YAAA,MAAM,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC;AAC3D,YAAA,OAAO,EAAE;;QACT,OAAO,KAAK,EAAE;AACd,YAAA,IAAI,KAAK,YAAYA,eAAmB,EAAE;gBACxC,MAAM,MAAM,GAAe,EAAE;AAC7B,gBAAA,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,IAAG;AACxB,oBAAA,IAAI,GAAG,CAAC,IAAI,EAAE;wBACZ,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAC,OAAO;;AAElC,iBAAC,CAAC;AACF,gBAAA,OAAO,MAAM;;AAEf,YAAA,OAAO,EAAE;;;AAGd;;MCjCY,IAAI,iBAAAC,k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A,QACE,CAAM,CAAA,MAAA,EAAA,EAAA,GAAA,EAAA,0CAAA,EAAA,QAAQ,EAAE,CAAC,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,UAAU,EAAA,IAAA,EAAA,EAClD,IAAI,CAAC,UAAU,IACd,IAAI,CAAC,UAAU,CAAC;AACd,YAAA,MAAM,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE;YAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,MAAM,EAAE,IAAI,CAAC,MAAM;AACpB,SAAA,CAAC,KAEF,CAAa,CAAA,MAAA,EAAA,IAAA,CAAA,CACd,CACI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["yup.object","yup.ValidationError","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/utils/form-validation.ts","src/components/shared/form/form.tsx"],"sourcesContent":["import * as yup from 'yup';\n\nexport interface ValidationSchema {\n [key: string]: yup.Schema<any>;\n}\n\nexport interface FormErrors {\n [key: string]: string;\n}\n\nexport interface FormData {\n [key: string]: any;\n}\n\nexport class FormValidator {\n private schema: yup.ObjectSchema<any>;\n\n constructor(validationSchema: ValidationSchema) {\n this.schema = yup.object().shape(validationSchema);\n }\n\n async validateField(fieldName: string, formData: FormData): Promise<string> {\n try {\n await this.schema.validateAt(fieldName, formData);\n return '';\n } catch (error) {\n if (error instanceof yup.ValidationError) {\n return error.message;\n }\n return '';\n }\n }\n\n async validateForm(formData: FormData): Promise<FormErrors> {\n try {\n await this.schema.validate(formData, { abortEarly: false });\n return {};\n } catch (error) {\n if (error instanceof yup.ValidationError) {\n const errors: FormErrors = {};\n error.inner.forEach(err => {\n if (err.path) {\n errors[err.path] = err.message;\n }\n });\n return errors;\n }\n return {};\n }\n }\n}\n","import {\n Component,\n Event,\n EventEmitter,\n h,\n Listen,\n Method,\n Prop,\n State,\n Watch,\n} from '@stencil/core';\nimport { FormData, FormErrors, FormValidator } from '../../../utils/form-validation';\n\n@Component({\n tag: 'rebill-form',\n shadow: false,\n})\nexport class Form {\n /** Esquema de validación del formulario */\n @Prop() validationSchema: any;\n /** Datos iniciales del formulario */\n @Prop() initialData: FormData = {};\n /** Evento cuando el formulario es válido y se envía */\n @Event() submit: EventEmitter<FormData>;\n /** Evento cuando hay cambios en el formulario */\n @Event() change: EventEmitter<FormData>;\n /** Función render prop para controlar el formulario */\n @Prop() renderForm?: (props: {\n submit: () => void;\n formData: FormData;\n errors: FormErrors;\n }) => any;\n\n @State() formData: FormData = {};\n @State() errors: FormErrors = {};\n private validator: FormValidator;\n private hasSubmitted: boolean = false;\n\n @Watch('initialData')\n handleInitialDataChange(newValue: FormData) {\n const updatedFormData = { ...this.formData };\n Object.keys(newValue).forEach(key => {\n if (updatedFormData[key] === undefined || updatedFormData[key] === '') {\n updatedFormData[key] = newValue[key];\n }\n });\n this.formData = updatedFormData;\n this.change.emit(this.formData);\n }\n\n @Watch('validationSchema')\n handleValidationSchemaChange(newSchema: any) {\n this.validator = new FormValidator(newSchema);\n }\n\n componentWillLoad() {\n this.formData = { ...this.initialData };\n this.validator = new FormValidator(this.validationSchema);\n setTimeout(() => {\n this.change.emit(this.formData);\n }, 100);\n }\n\n private setFieldValue(id: string, value: any) {\n if (this.formData[id] !== value) {\n this.formData = {\n ...this.formData,\n [id]: value,\n };\n }\n }\n\n private setFieldError(id: string, error: string) {\n if (this.errors[id] !== error) {\n this.errors = {\n ...this.errors,\n [id]: error,\n };\n }\n }\n\n private clearFieldError(id: string) {\n if (this.hasFieldError(id)) {\n this.setFieldError(id, '');\n }\n }\n\n private hasFieldError(id: string) {\n return this.errors[id] !== '';\n }\n\n @Listen('input')\n async handleInputChange(event: CustomEvent) {\n if (!event.detail || !event.detail.id) return;\n const { id, value, disabled } = event.detail;\n\n this.setFieldValue(id, value);\n\n if (this.hasSubmitted && !disabled) {\n const error = await this.validator.validateField(id, this.formData);\n this.setFieldError(id, error);\n } else {\n if (this.hasFieldError(id)) {\n this.clearFieldError(id);\n }\n }\n this.change.emit(this.formData);\n }\n @Listen('blur')\n async handleBlur(event: CustomEvent) {\n if (!event.detail || !event.detail.id) return;\n const { id, disabled } = event.detail;\n\n if (!disabled) {\n const error = await this.validator.validateField(id, this.formData);\n this.setFieldError(id, error);\n }\n }\n\n @Method()\n async submitForm() {\n this.hasSubmitted = true;\n this.errors = {};\n\n const errors = await this.validator.validateForm(this.formData);\n this.errors = errors;\n\n if (Object.values(this.errors).filter(value => !!value).length === 0) {\n this.submit.emit(this.formData);\n }\n }\n\n @Method()\n async resetValidation() {\n this.hasSubmitted = false;\n this.errors = {};\n }\n\n @Method()\n async clearError(fieldId: string) {\n this.clearFieldError(fieldId);\n }\n private handleSubmit = async (event: Event) => {\n event.preventDefault();\n await this.submitForm();\n };\n\n render() {\n return (\n <form onSubmit={e => this.handleSubmit(e)} noValidate>\n {this.renderForm ? (\n this.renderForm({\n submit: () => this.submitForm(),\n formData: this.formData,\n errors: this.errors,\n })\n ) : (\n <slot></slot>\n )}\n </form>\n );\n }\n}\n"],"version":3}
|