@verbb/formie-browser 1.0.1 → 1.0.3
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/CHANGELOG.md +16 -0
- package/dist/chunks/address-finder-BjMuEiwF.js +37 -0
- package/dist/chunks/bpoint-KudsBCo2.js +26 -0
- package/dist/chunks/calculations-DlGSkQ3W.js +147 -0
- package/dist/chunks/captcha-eu-CterYFok.js +34 -0
- package/dist/chunks/checkbox-radio-CBvgk3hR.js +136 -0
- package/dist/chunks/conditions-DYy1-Hwt.js +459 -0
- package/dist/chunks/date-picker-BlD--zfe.js +4994 -0
- package/dist/chunks/eway-qwc-B5Us.js +74 -0
- package/dist/chunks/file-upload-CIgHrXfp.js +316 -0
- package/dist/chunks/friendly-captcha-v1-EDFac33c.js +33 -0
- package/dist/chunks/friendly-captcha-v2-BDpSvFGR.js +38 -0
- package/dist/chunks/go-cardless-DuDMVsnz.js +24 -0
- package/dist/chunks/google-address-Bmjp01pH.js +181 -0
- package/dist/chunks/hcaptcha-BTQ6An6g.js +56 -0
- package/dist/chunks/hidden-DbPdOxKb.js +31 -0
- package/dist/chunks/index-BEsfee-D.js +1839 -0
- package/dist/chunks/index-BP7Unm5Y.js +863 -0
- package/dist/chunks/index-BcqwpPNE.js +4314 -0
- package/dist/chunks/loqate-BdNGv93o.js +55 -0
- package/dist/chunks/mollie-DFOjTuGX.js +24 -0
- package/dist/chunks/moneris-BbFfl-EL.js +101 -0
- package/dist/chunks/opayo-CmgYa9ya.js +122 -0
- package/dist/chunks/paddle-BUi7w1_o.js +60 -0
- package/dist/chunks/paypal-A-ePfh6k.js +100 -0
- package/dist/chunks/payway-BqFCbhyo.js +56 -0
- package/dist/chunks/phone-country-DPMiqk4L.js +3765 -0
- package/dist/chunks/place-kit-CX7tamAg.js +42 -0
- package/dist/chunks/placekit-autocomplete.esm-LAwfbPZl.js +1299 -0
- package/dist/chunks/recaptcha-enterprise-DxF6cW95.js +71 -0
- package/dist/chunks/recaptcha-shared-DhGcbiaq.js +15 -0
- package/dist/chunks/recaptcha-v2-checkbox-R9EfbZ4k.js +41 -0
- package/dist/chunks/recaptcha-v2-invisible-DV9hswAp.js +59 -0
- package/dist/chunks/recaptcha-v3-V0xc-Edh.js +28 -0
- package/dist/chunks/repeater-DKUT6TGI.js +124 -0
- package/dist/chunks/rich-text-SH7KiaKH.js +304 -0
- package/dist/chunks/scripts-D9N2d5rN.js +36 -0
- package/dist/chunks/sdk-3SicTWby.js +1559 -0
- package/dist/chunks/shared-BmntPmnW.js +80 -0
- package/dist/chunks/signature-BA3tQsGT.js +550 -0
- package/dist/chunks/snaptcha-DV7p6J9k.js +8 -0
- package/dist/chunks/square-Bs-ndqYK.js +46 -0
- package/dist/chunks/stripe-DkZAHxtn.js +202 -0
- package/dist/chunks/styles-C3aqgtek.js +21 -0
- package/dist/chunks/summary-Dq2i9TQk.js +126 -0
- package/dist/chunks/table-Cu4WfVcw.js +95 -0
- package/dist/chunks/text-limit-2ycmB-Ae.js +135 -0
- package/dist/chunks/turnstile-CId90tRr.js +59 -0
- package/dist/chunks/utils-BntI3W4S.js +6149 -0
- package/dist/css/theme/forms/_form.css +28 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +39 -3205
- package/dist/js/compatibility/dom-adapter.d.ts +12 -0
- package/dist/js/compatibility/dom-adapter.d.ts.map +1 -0
- package/dist/js/compatibility/event-map.d.ts +25 -0
- package/dist/js/compatibility/event-map.d.ts.map +1 -0
- package/dist/js/compatibility/validator-adapter.d.ts +17 -0
- package/dist/js/compatibility/validator-adapter.d.ts.map +1 -0
- package/dist/js/contracts/client.d.ts +40 -0
- package/dist/js/contracts/client.d.ts.map +1 -0
- package/dist/js/contracts/common.d.ts +5 -0
- package/dist/js/contracts/common.d.ts.map +1 -0
- package/dist/js/contracts/modules.d.ts +47 -0
- package/dist/js/contracts/modules.d.ts.map +1 -0
- package/dist/js/contracts/schema.d.ts +79 -0
- package/dist/js/contracts/schema.d.ts.map +1 -0
- package/dist/js/contracts/theme.d.ts +2 -0
- package/dist/js/contracts/theme.d.ts.map +1 -0
- package/dist/js/core/create-formie-client.d.ts +3 -0
- package/dist/js/core/create-formie-client.d.ts.map +1 -0
- package/dist/js/core/dom-events.d.ts +2 -0
- package/dist/js/core/dom-events.d.ts.map +1 -0
- package/dist/js/core/formie.d.ts +27 -0
- package/dist/js/core/formie.d.ts.map +1 -0
- package/dist/js/core/hydrate-modules.d.ts +22 -0
- package/dist/js/core/hydrate-modules.d.ts.map +1 -0
- package/dist/js/core/page-client-event.d.ts +9 -0
- package/dist/js/core/page-client-event.d.ts.map +1 -0
- package/dist/js/core/page-tab-errors.d.ts +2 -0
- package/dist/js/core/page-tab-errors.d.ts.map +1 -0
- package/dist/js/core/submit-flow.d.ts +21 -0
- package/dist/js/core/submit-flow.d.ts.map +1 -0
- package/dist/js/core/submit-result-state.d.ts +8 -0
- package/dist/js/core/submit-result-state.d.ts.map +1 -0
- package/dist/js/core/submit-result-ui.d.ts +10 -0
- package/dist/js/core/submit-result-ui.d.ts.map +1 -0
- package/dist/js/events/event-bus.d.ts +21 -0
- package/dist/js/events/event-bus.d.ts.map +1 -0
- package/dist/js/modules/address/address-finder.d.ts +2 -0
- package/dist/js/modules/address/address-finder.d.ts.map +1 -0
- package/dist/js/modules/address/api.d.ts +8 -0
- package/dist/js/modules/address/api.d.ts.map +1 -0
- package/dist/js/modules/address/constants.d.ts +15 -0
- package/dist/js/modules/address/constants.d.ts.map +1 -0
- package/dist/js/modules/address/factories.d.ts +35 -0
- package/dist/js/modules/address/factories.d.ts.map +1 -0
- package/dist/js/modules/address/google-address.d.ts +9 -0
- package/dist/js/modules/address/google-address.d.ts.map +1 -0
- package/dist/js/modules/address/host.d.ts +30 -0
- package/dist/js/modules/address/host.d.ts.map +1 -0
- package/dist/js/modules/address/index.d.ts +3 -0
- package/dist/js/modules/address/index.d.ts.map +1 -0
- package/dist/js/modules/address/loqate.d.ts +2 -0
- package/dist/js/modules/address/loqate.d.ts.map +1 -0
- package/dist/js/modules/address/place-kit.d.ts +2 -0
- package/dist/js/modules/address/place-kit.d.ts.map +1 -0
- package/dist/js/modules/captchas/api.d.ts +9 -0
- package/dist/js/modules/captchas/api.d.ts.map +1 -0
- package/dist/js/modules/captchas/captcha-eu.d.ts +2 -0
- package/dist/js/modules/captchas/captcha-eu.d.ts.map +1 -0
- package/dist/js/modules/captchas/constants.d.ts +5 -0
- package/dist/js/modules/captchas/constants.d.ts.map +1 -0
- package/dist/js/modules/captchas/factories.d.ts +63 -0
- package/dist/js/modules/captchas/factories.d.ts.map +1 -0
- package/dist/js/modules/captchas/friendly-captcha-v1.d.ts +2 -0
- package/dist/js/modules/captchas/friendly-captcha-v1.d.ts.map +1 -0
- package/dist/js/modules/captchas/friendly-captcha-v2.d.ts +2 -0
- package/dist/js/modules/captchas/friendly-captcha-v2.d.ts.map +1 -0
- package/dist/js/modules/captchas/hcaptcha.d.ts +2 -0
- package/dist/js/modules/captchas/hcaptcha.d.ts.map +1 -0
- package/dist/js/modules/captchas/host.d.ts +78 -0
- package/dist/js/modules/captchas/host.d.ts.map +1 -0
- package/dist/js/modules/captchas/index.d.ts +3 -0
- package/dist/js/modules/captchas/index.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts +2 -0
- package/dist/js/modules/captchas/recaptcha-enterprise.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-shared.d.ts +26 -0
- package/dist/js/modules/captchas/recaptcha-shared.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts +2 -0
- package/dist/js/modules/captchas/recaptcha-v2-checkbox.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts +2 -0
- package/dist/js/modules/captchas/recaptcha-v2-invisible.d.ts.map +1 -0
- package/dist/js/modules/captchas/recaptcha-v3.d.ts +2 -0
- package/dist/js/modules/captchas/recaptcha-v3.d.ts.map +1 -0
- package/dist/js/modules/captchas/snaptcha.d.ts +2 -0
- package/dist/js/modules/captchas/snaptcha.d.ts.map +1 -0
- package/dist/js/modules/captchas/turnstile.d.ts +2 -0
- package/dist/js/modules/captchas/turnstile.d.ts.map +1 -0
- package/dist/js/modules/captchas/utils.d.ts +13 -0
- package/dist/js/modules/captchas/utils.d.ts.map +1 -0
- package/dist/js/modules/fields/calculations.d.ts +3 -0
- package/dist/js/modules/fields/calculations.d.ts.map +1 -0
- package/dist/js/modules/fields/checkbox-radio.d.ts +3 -0
- package/dist/js/modules/fields/checkbox-radio.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/config.d.ts +5 -0
- package/dist/js/modules/fields/conditions/config.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/effects.d.ts +4 -0
- package/dist/js/modules/fields/conditions/effects.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/evaluator.d.ts +6 -0
- package/dist/js/modules/fields/conditions/evaluator.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/references.d.ts +5 -0
- package/dist/js/modules/fields/conditions/references.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/transforms.d.ts +3 -0
- package/dist/js/modules/fields/conditions/transforms.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/types.d.ts +30 -0
- package/dist/js/modules/fields/conditions/types.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions/values.d.ts +5 -0
- package/dist/js/modules/fields/conditions/values.d.ts.map +1 -0
- package/dist/js/modules/fields/conditions.d.ts +3 -0
- package/dist/js/modules/fields/conditions.d.ts.map +1 -0
- package/dist/js/modules/fields/date-picker.d.ts +3 -0
- package/dist/js/modules/fields/date-picker.d.ts.map +1 -0
- package/dist/js/modules/fields/file-upload.d.ts +3 -0
- package/dist/js/modules/fields/file-upload.d.ts.map +1 -0
- package/dist/js/modules/fields/hidden.d.ts +3 -0
- package/dist/js/modules/fields/hidden.d.ts.map +1 -0
- package/dist/js/modules/fields/index.d.ts +3 -0
- package/dist/js/modules/fields/index.d.ts.map +1 -0
- package/dist/js/modules/fields/phone-country.d.ts +3 -0
- package/dist/js/modules/fields/phone-country.d.ts.map +1 -0
- package/dist/js/modules/fields/repeater.d.ts +3 -0
- package/dist/js/modules/fields/repeater.d.ts.map +1 -0
- package/dist/js/modules/fields/rich-text.d.ts +3 -0
- package/dist/js/modules/fields/rich-text.d.ts.map +1 -0
- package/dist/js/modules/fields/shared.d.ts +20 -0
- package/dist/js/modules/fields/shared.d.ts.map +1 -0
- package/dist/js/modules/fields/signature.d.ts +3 -0
- package/dist/js/modules/fields/signature.d.ts.map +1 -0
- package/dist/js/modules/fields/summary.d.ts +3 -0
- package/dist/js/modules/fields/summary.d.ts.map +1 -0
- package/dist/js/modules/fields/table.d.ts +3 -0
- package/dist/js/modules/fields/table.d.ts.map +1 -0
- package/dist/js/modules/fields/text-limit.d.ts +3 -0
- package/dist/js/modules/fields/text-limit.d.ts.map +1 -0
- package/dist/js/modules/loader.d.ts +11 -0
- package/dist/js/modules/loader.d.ts.map +1 -0
- package/dist/js/modules/payments/api.d.ts +8 -0
- package/dist/js/modules/payments/api.d.ts.map +1 -0
- package/dist/js/modules/payments/bpoint.d.ts +2 -0
- package/dist/js/modules/payments/bpoint.d.ts.map +1 -0
- package/dist/js/modules/payments/constants.d.ts +5 -0
- package/dist/js/modules/payments/constants.d.ts.map +1 -0
- package/dist/js/modules/payments/eway.d.ts +9 -0
- package/dist/js/modules/payments/eway.d.ts.map +1 -0
- package/dist/js/modules/payments/factories.d.ts +54 -0
- package/dist/js/modules/payments/factories.d.ts.map +1 -0
- package/dist/js/modules/payments/go-cardless.d.ts +2 -0
- package/dist/js/modules/payments/go-cardless.d.ts.map +1 -0
- package/dist/js/modules/payments/host.d.ts +70 -0
- package/dist/js/modules/payments/host.d.ts.map +1 -0
- package/dist/js/modules/payments/index.d.ts +3 -0
- package/dist/js/modules/payments/index.d.ts.map +1 -0
- package/dist/js/modules/payments/mollie.d.ts +2 -0
- package/dist/js/modules/payments/mollie.d.ts.map +1 -0
- package/dist/js/modules/payments/moneris.d.ts +2 -0
- package/dist/js/modules/payments/moneris.d.ts.map +1 -0
- package/dist/js/modules/payments/opayo.d.ts +25 -0
- package/dist/js/modules/payments/opayo.d.ts.map +1 -0
- package/dist/js/modules/payments/paddle.d.ts +2 -0
- package/dist/js/modules/payments/paddle.d.ts.map +1 -0
- package/dist/js/modules/payments/paypal.d.ts +2 -0
- package/dist/js/modules/payments/paypal.d.ts.map +1 -0
- package/dist/js/modules/payments/payway.d.ts +2 -0
- package/dist/js/modules/payments/payway.d.ts.map +1 -0
- package/dist/js/modules/payments/square.d.ts +2 -0
- package/dist/js/modules/payments/square.d.ts.map +1 -0
- package/dist/js/modules/payments/stripe.d.ts +2 -0
- package/dist/js/modules/payments/stripe.d.ts.map +1 -0
- package/dist/js/modules/payments/utils.d.ts +17 -0
- package/dist/js/modules/payments/utils.d.ts.map +1 -0
- package/dist/js/modules/registry.d.ts +9 -0
- package/dist/js/modules/registry.d.ts.map +1 -0
- package/dist/js/modules/styles.d.ts +2 -0
- package/dist/js/modules/styles.d.ts.map +1 -0
- package/dist/js/submit/pipeline.d.ts +18 -0
- package/dist/js/submit/pipeline.d.ts.map +1 -0
- package/dist/js/theme/theme-classes.d.ts +10 -0
- package/dist/js/theme/theme-classes.d.ts.map +1 -0
- package/dist/js/transport/forms-api.d.ts +11 -0
- package/dist/js/transport/forms-api.d.ts.map +1 -0
- package/dist/js/utils/async.d.ts +8 -0
- package/dist/js/utils/async.d.ts.map +1 -0
- package/dist/js/utils/debug.d.ts +10 -0
- package/dist/js/utils/debug.d.ts.map +1 -0
- package/dist/js/utils/event-names.d.ts +13 -0
- package/dist/js/utils/event-names.d.ts.map +1 -0
- package/dist/js/utils/field-references.d.ts +6 -0
- package/dist/js/utils/field-references.d.ts.map +1 -0
- package/dist/js/utils/field-references.keys.d.ts +4 -0
- package/dist/js/utils/field-references.keys.d.ts.map +1 -0
- package/dist/js/utils/field-references.parser.d.ts +3 -0
- package/dist/js/utils/field-references.parser.d.ts.map +1 -0
- package/dist/js/utils/field-references.registry.d.ts +3 -0
- package/dist/js/utils/field-references.registry.d.ts.map +1 -0
- package/dist/js/utils/field-references.resolver.d.ts +4 -0
- package/dist/js/utils/field-references.resolver.d.ts.map +1 -0
- package/dist/js/utils/field-references.types.d.ts +27 -0
- package/dist/js/utils/field-references.types.d.ts.map +1 -0
- package/dist/js/utils/fields.d.ts +5 -0
- package/dist/js/utils/fields.d.ts.map +1 -0
- package/dist/js/utils/http.d.ts +9 -0
- package/dist/js/utils/http.d.ts.map +1 -0
- package/dist/js/utils/i18n.d.ts +7 -0
- package/dist/js/utils/i18n.d.ts.map +1 -0
- package/dist/js/utils/scripts.d.ts +13 -0
- package/dist/js/utils/scripts.d.ts.map +1 -0
- package/dist/js/utils/unload-warning.d.ts +10 -0
- package/dist/js/utils/unload-warning.d.ts.map +1 -0
- package/dist/js/validation/rules/email.d.ts +4 -0
- package/dist/js/validation/rules/email.d.ts.map +1 -0
- package/dist/js/validation/rules/match.d.ts +4 -0
- package/dist/js/validation/rules/match.d.ts.map +1 -0
- package/dist/js/validation/rules/number.d.ts +4 -0
- package/dist/js/validation/rules/number.d.ts.map +1 -0
- package/dist/js/validation/rules/required.d.ts +4 -0
- package/dist/js/validation/rules/required.d.ts.map +1 -0
- package/dist/js/validation/rules/shared.d.ts +7 -0
- package/dist/js/validation/rules/shared.d.ts.map +1 -0
- package/dist/js/validation/rules/url.d.ts +4 -0
- package/dist/js/validation/rules/url.d.ts.map +1 -0
- package/dist/js/validation/rules.d.ts +10 -0
- package/dist/js/validation/rules.d.ts.map +1 -0
- package/dist/js/validation/scope.d.ts +6 -0
- package/dist/js/validation/scope.d.ts.map +1 -0
- package/dist/js/validation/submit-readiness.d.ts +4 -0
- package/dist/js/validation/submit-readiness.d.ts.map +1 -0
- package/dist/js/validation/types.d.ts +44 -0
- package/dist/js/validation/types.d.ts.map +1 -0
- package/dist/js/validation/validator.d.ts +54 -0
- package/dist/js/validation/validator.d.ts.map +1 -0
- package/package.json +3 -2
- package/src/css/theme/forms/_form.css +28 -0
- package/src/js/core/create-formie-client.ts +6 -0
- package/src/js/core/submit-result-state.ts +17 -0
- package/src/js/modules/address/google-address.ts +33 -1
- package/src/js/modules/fields/conditions/effects.ts +79 -2
- package/src/js/modules/fields/conditions.ts +53 -11
- package/src/js/modules/fields/file-upload.ts +189 -97
- package/src/js/modules/fields/repeater.ts +1 -1
- package/src/js/modules/fields/rich-text.ts +2 -2
- package/src/js/modules/fields/signature.ts +1 -1
- package/src/js/modules/fields/summary.ts +1 -1
- package/src/js/modules/fields/table.ts +1 -1
- package/src/js/modules/fields/text-limit.ts +1 -1
- package/src/js/modules/payments/paypal.ts +1 -1
- package/src/js/modules/payments/payway.ts +1 -1
- package/src/js/modules/payments/stripe.ts +1 -1
- package/src/js/submit/pipeline.ts +3 -28
- package/src/js/validation/scope.ts +25 -0
- package/src/js/validation/submit-readiness.ts +157 -0
- package/src/js/validation/validator.ts +4 -0
- package/dist/chunks/address-finder-DfMCiW89.js +0 -47
- package/dist/chunks/api-CbqEMQT5.js +0 -181
- package/dist/chunks/api-DE7LfK-R.js +0 -960
- package/dist/chunks/api-DOfDzYC_.js +0 -538
- package/dist/chunks/async-B3DUf1GZ.js +0 -26
- package/dist/chunks/bpoint-Ciy3yY9Q.js +0 -34
- package/dist/chunks/calculations-CkYAqO_-.js +0 -197
- package/dist/chunks/captcha-eu-DnOWhMwr.js +0 -43
- package/dist/chunks/checkbox-radio-0x7Tc0br.js +0 -197
- package/dist/chunks/chunk-K6L4z4UQ.js +0 -24
- package/dist/chunks/conditions-4fXKhEJS.js +0 -609
- package/dist/chunks/date-picker-B6iZkjHS.js +0 -6204
- package/dist/chunks/debug-KnZeKYBI.js +0 -39
- package/dist/chunks/dist-D09GnXMW.js +0 -2663
- package/dist/chunks/event-names-DamGPtXR.js +0 -51
- package/dist/chunks/eway-DEAYcwT0.js +0 -86
- package/dist/chunks/field-references.keys-BpBZ_quS.js +0 -24
- package/dist/chunks/field-references.resolver-Ba6xhiJC.js +0 -183
- package/dist/chunks/file-upload-BIj85NFH.js +0 -428
- package/dist/chunks/friendly-captcha-v1-CqO4WVre.js +0 -40
- package/dist/chunks/friendly-captcha-v2-CyykcJcM.js +0 -47
- package/dist/chunks/friendly-challenge-Dg8XkStd.js +0 -1101
- package/dist/chunks/go-cardless-CuND59rR.js +0 -26
- package/dist/chunks/google-address--uR8WDSm.js +0 -208
- package/dist/chunks/hcaptcha-CmaFUesv.js +0 -72
- package/dist/chunks/hidden-CYnZYple.js +0 -36
- package/dist/chunks/http-18nn97DZ.js +0 -29
- package/dist/chunks/i18n-vUh-KGiH.js +0 -55
- package/dist/chunks/loqate-BICNJlVK.js +0 -97
- package/dist/chunks/mollie-DwlsgHZ1.js +0 -26
- package/dist/chunks/moneris-B_IFZFTx.js +0 -159
- package/dist/chunks/opayo-U2x_TOII.js +0 -192
- package/dist/chunks/paddle-BqXFrc79.js +0 -75
- package/dist/chunks/paypal-VowQ3ilP.js +0 -121
- package/dist/chunks/payway-VOO-ajyg.js +0 -75
- package/dist/chunks/phone-country-B6Me4lK0.js +0 -3317
- package/dist/chunks/place-kit-ldUl-u9w.js +0 -56
- package/dist/chunks/placekit-autocomplete.esm-D-lGeaZl.js +0 -1771
- package/dist/chunks/recaptcha-enterprise-DPJNyv1X.js +0 -72
- package/dist/chunks/recaptcha-shared-DTI4qWVR.js +0 -22
- package/dist/chunks/recaptcha-v2-checkbox-zFjpvJ5c.js +0 -49
- package/dist/chunks/recaptcha-v2-invisible-CnYtkNvz.js +0 -62
- package/dist/chunks/recaptcha-v3-EAlWhnkX.js +0 -33
- package/dist/chunks/repeater-BPm7Mkyn.js +0 -149
- package/dist/chunks/rich-text-CHSly1Hq.js +0 -438
- package/dist/chunks/scripts-BGD_iU_6.js +0 -41
- package/dist/chunks/sdk-B7u9fTlP.js +0 -2103
- package/dist/chunks/shared-DC6_1u8X.js +0 -85
- package/dist/chunks/signature-DNMCgrMd.js +0 -763
- package/dist/chunks/snaptcha-CCDunGeb.js +0 -8
- package/dist/chunks/square-BLqK51rS.js +0 -61
- package/dist/chunks/stripe-B6ZcDQdx.js +0 -273
- package/dist/chunks/styles-BIh6g7V_.js +0 -22
- package/dist/chunks/summary-BTG0uIOt.js +0 -189
- package/dist/chunks/table-BTYc0Qm8.js +0 -122
- package/dist/chunks/text-limit-CgBMu4sJ.js +0 -177
- package/dist/chunks/theme-classes-vSHpdCUO.js +0 -59
- package/dist/chunks/turnstile-DP0bdR7T.js +0 -68
- package/dist/chunks/utils-ByrEVYrJ.js +0 -49584
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
import { t as definePaymentModule } from "./api-DE7LfK-R.js";
|
|
2
|
-
//#region src/js/modules/payments/moneris.ts
|
|
3
|
-
var MONERIS_RESPONSE_MESSAGES = {
|
|
4
|
-
"940": "Invalid profile ID (tokenization request).",
|
|
5
|
-
"941": "Error generating token.",
|
|
6
|
-
"942": "Invalid Profile ID or source URL.",
|
|
7
|
-
"943": "Card data is invalid.",
|
|
8
|
-
"944": "Invalid expiration date.",
|
|
9
|
-
"945": "Invalid CVD."
|
|
10
|
-
};
|
|
11
|
-
var extractMonerisToken = (payload) => {
|
|
12
|
-
const fromObject = (value) => {
|
|
13
|
-
const token = String(value.dataKey ?? value.data_key ?? "").trim();
|
|
14
|
-
const responseCode = String(value.responseCode ?? value.response_code ?? "").trim();
|
|
15
|
-
const responseMessage = String(value.responseMessage ?? value.response_message ?? "").trim();
|
|
16
|
-
const error = String(value.error ?? value.errorMessage ?? value.message ?? "").trim();
|
|
17
|
-
if (token) return {
|
|
18
|
-
token,
|
|
19
|
-
error: ""
|
|
20
|
-
};
|
|
21
|
-
if (responseCode && responseCode !== "001") {
|
|
22
|
-
const codeMessage = MONERIS_RESPONSE_MESSAGES[responseCode] || `Moneris response code ${responseCode}.`;
|
|
23
|
-
return {
|
|
24
|
-
token: "",
|
|
25
|
-
error: responseMessage || codeMessage
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
return {
|
|
29
|
-
token: "",
|
|
30
|
-
error
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
if (payload && typeof payload === "object") return fromObject(payload);
|
|
34
|
-
if (typeof payload !== "string") return {
|
|
35
|
-
token: "",
|
|
36
|
-
error: ""
|
|
37
|
-
};
|
|
38
|
-
const value = payload.trim();
|
|
39
|
-
if (!value) return {
|
|
40
|
-
token: "",
|
|
41
|
-
error: ""
|
|
42
|
-
};
|
|
43
|
-
try {
|
|
44
|
-
const decoded = JSON.parse(value);
|
|
45
|
-
if (decoded && typeof decoded === "object") return fromObject(decoded);
|
|
46
|
-
} catch {}
|
|
47
|
-
if (value.includes("=")) {
|
|
48
|
-
const params = new URLSearchParams(value);
|
|
49
|
-
const token = (params.get("dataKey") || params.get("data_key") || "").trim();
|
|
50
|
-
const responseCode = (params.get("responseCode") || params.get("response_code") || "").trim();
|
|
51
|
-
const responseMessage = (params.get("responseMessage") || params.get("response_message") || "").trim();
|
|
52
|
-
const error = (params.get("error") || params.get("message") || "").trim();
|
|
53
|
-
if (token) return {
|
|
54
|
-
token,
|
|
55
|
-
error: ""
|
|
56
|
-
};
|
|
57
|
-
if (responseCode && responseCode !== "001") {
|
|
58
|
-
const codeMessage = MONERIS_RESPONSE_MESSAGES[responseCode] || `Moneris response code ${responseCode}.`;
|
|
59
|
-
return {
|
|
60
|
-
token: "",
|
|
61
|
-
error: responseMessage || codeMessage
|
|
62
|
-
};
|
|
63
|
-
}
|
|
64
|
-
return {
|
|
65
|
-
token: "",
|
|
66
|
-
error
|
|
67
|
-
};
|
|
68
|
-
}
|
|
69
|
-
if (/^[A-Za-z0-9._-]{8,}$/.test(value)) return {
|
|
70
|
-
token: value,
|
|
71
|
-
error: ""
|
|
72
|
-
};
|
|
73
|
-
return {
|
|
74
|
-
token: "",
|
|
75
|
-
error: ""
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
var monerisModule = definePaymentModule({
|
|
79
|
-
id: "moneris",
|
|
80
|
-
defaultRequiredInputSuffixes: ["monerisTokenId"],
|
|
81
|
-
load: async () => null,
|
|
82
|
-
onBeforeAuthorize: async (args) => {
|
|
83
|
-
const { field, services, options } = args;
|
|
84
|
-
const fieldState = field;
|
|
85
|
-
const endpointUrl = (options.provider.endpointUrl || "").trim();
|
|
86
|
-
const iframe = field.querySelector("[data-formie-moneris-frame]");
|
|
87
|
-
let endpointOrigin = "";
|
|
88
|
-
try {
|
|
89
|
-
endpointOrigin = new URL(endpointUrl, window.location.origin).origin;
|
|
90
|
-
} catch {
|
|
91
|
-
endpointOrigin = "";
|
|
92
|
-
}
|
|
93
|
-
if (!iframe?.contentWindow || !endpointOrigin) {
|
|
94
|
-
services.addError("Moneris frame or endpoint is missing.");
|
|
95
|
-
return false;
|
|
96
|
-
}
|
|
97
|
-
fieldState.__formieMonerisAuthorizeCleanup?.();
|
|
98
|
-
const requestId = (fieldState.__formieMonerisAuthorizeRequestId || 0) + 1;
|
|
99
|
-
fieldState.__formieMonerisAuthorizeRequestId = requestId;
|
|
100
|
-
return new Promise((resolve) => {
|
|
101
|
-
let resolved = false;
|
|
102
|
-
let lastError = "";
|
|
103
|
-
let timeout = 0;
|
|
104
|
-
const cleanup = () => {
|
|
105
|
-
window.removeEventListener("message", messageHandler);
|
|
106
|
-
window.clearTimeout(timeout);
|
|
107
|
-
if (fieldState.__formieMonerisAuthorizeCleanup === cleanup) fieldState.__formieMonerisAuthorizeCleanup = null;
|
|
108
|
-
};
|
|
109
|
-
const messageHandler = (event) => {
|
|
110
|
-
if (resolved || requestId !== fieldState.__formieMonerisAuthorizeRequestId) return;
|
|
111
|
-
if (event.origin !== endpointOrigin) return;
|
|
112
|
-
const result = extractMonerisToken(event.data);
|
|
113
|
-
if (result.token) {
|
|
114
|
-
resolved = true;
|
|
115
|
-
cleanup();
|
|
116
|
-
services.updateInputs("monerisTokenId", result.token);
|
|
117
|
-
resolve(true);
|
|
118
|
-
} else if (result.error) lastError = result.error;
|
|
119
|
-
};
|
|
120
|
-
fieldState.__formieMonerisAuthorizeCleanup = cleanup;
|
|
121
|
-
timeout = window.setTimeout(() => {
|
|
122
|
-
if (resolved) return;
|
|
123
|
-
resolved = true;
|
|
124
|
-
cleanup();
|
|
125
|
-
services.addError(lastError || "Moneris tokenization timed out. Please try again.");
|
|
126
|
-
resolve(false);
|
|
127
|
-
}, 1e4);
|
|
128
|
-
window.addEventListener("message", messageHandler);
|
|
129
|
-
try {
|
|
130
|
-
iframe.contentWindow?.postMessage("tokenize", endpointOrigin);
|
|
131
|
-
} catch {
|
|
132
|
-
resolved = true;
|
|
133
|
-
cleanup();
|
|
134
|
-
services.addError("Moneris tokenization could not be started.");
|
|
135
|
-
resolve(false);
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
},
|
|
139
|
-
setup: async (ctx) => {
|
|
140
|
-
const { services } = ctx;
|
|
141
|
-
const messageHandler = (event) => {
|
|
142
|
-
if (!event.origin.includes("moneris")) return;
|
|
143
|
-
const result = extractMonerisToken(event.data);
|
|
144
|
-
if (result.token) services.updateInputs("monerisTokenId", result.token);
|
|
145
|
-
};
|
|
146
|
-
const unbind = services.events.onRoot("message", messageHandler);
|
|
147
|
-
return { destroy: () => {
|
|
148
|
-
unbind();
|
|
149
|
-
const fieldState = ctx.target;
|
|
150
|
-
fieldState.__formieMonerisAuthorizeCleanup?.();
|
|
151
|
-
fieldState.__formieMonerisAuthorizeCleanup = null;
|
|
152
|
-
} };
|
|
153
|
-
},
|
|
154
|
-
onAfterSubmit: async ({ services }) => {
|
|
155
|
-
services.updateInputs("monerisTokenId", "");
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
//#endregion
|
|
159
|
-
export { monerisModule };
|
|
@@ -1,192 +0,0 @@
|
|
|
1
|
-
import { s as getPaymentProviderActionEventName } from "./event-names-DamGPtXR.js";
|
|
2
|
-
import { t as createDebug } from "./debug-KnZeKYBI.js";
|
|
3
|
-
import { t as definePaymentModule } from "./api-DE7LfK-R.js";
|
|
4
|
-
import { r as loadScriptAndEnsureGlobal } from "./scripts-BGD_iU_6.js";
|
|
5
|
-
//#region src/js/modules/payments/opayo.ts
|
|
6
|
-
var SCRIPT_ID = "FORMIE_OPAYO_SCRIPT";
|
|
7
|
-
var SCRIPT_SRC_LIVE = "https://live.opayo.eu.elavon.com/api/v1/js/sagepay.js";
|
|
8
|
-
var SCRIPT_SRC_SANDBOX = "https://sandbox.opayo.eu.elavon.com/api/v1/js/sagepay.js";
|
|
9
|
-
var debug = createDebug("payments", "opayo");
|
|
10
|
-
var CHALLENGE_EVENT = getPaymentProviderActionEventName("opayo", "challenge");
|
|
11
|
-
var CHALLENGE_RESPONSE_MESSAGE = "formie:payment:opayo:challenge:response";
|
|
12
|
-
var opayoModule = definePaymentModule({
|
|
13
|
-
id: "opayo",
|
|
14
|
-
defaultRequiredInputSuffixes: ["opayoTokenId"],
|
|
15
|
-
load: async (ctx) => {
|
|
16
|
-
const { provider } = ctx.options;
|
|
17
|
-
await loadScriptAndEnsureGlobal("sagepayOwnForm", {
|
|
18
|
-
id: SCRIPT_ID,
|
|
19
|
-
src: Boolean(provider.useSandbox) ? SCRIPT_SRC_SANDBOX : SCRIPT_SRC_LIVE,
|
|
20
|
-
timeoutMs: 1e4
|
|
21
|
-
});
|
|
22
|
-
return null;
|
|
23
|
-
},
|
|
24
|
-
onBeforeAuthorize: async (args) => {
|
|
25
|
-
const { field, services, options } = args;
|
|
26
|
-
const provider = options.provider;
|
|
27
|
-
const handle = provider.handle || "opayo";
|
|
28
|
-
const form = services.form;
|
|
29
|
-
if (!form?.action) {
|
|
30
|
-
services.addError("Form action is missing.");
|
|
31
|
-
debug.warn("Missing form action before authorize.");
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
const sagepayOwnForm = window.sagepayOwnForm;
|
|
35
|
-
if (!sagepayOwnForm) {
|
|
36
|
-
services.addError("Opayo script failed to load.");
|
|
37
|
-
debug.warn("sagepayOwnForm global not available.");
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
const cardholderName = field.querySelector("[data-opayo-card=\"cardholder-name\"]")?.value ?? "";
|
|
41
|
-
let cardNumber = field.querySelector("[data-opayo-card=\"card-number\"]")?.value ?? "";
|
|
42
|
-
let expiryDate = field.querySelector("[data-opayo-card=\"expiry-date\"]")?.value ?? "";
|
|
43
|
-
const securityCode = field.querySelector("[data-opayo-card=\"security-code\"]")?.value ?? "";
|
|
44
|
-
cardNumber = cardNumber.replace(/[\s/]/g, "");
|
|
45
|
-
expiryDate = expiryDate.replace(/[\s/]/g, "");
|
|
46
|
-
return new Promise((resolve) => {
|
|
47
|
-
const formData = new FormData();
|
|
48
|
-
formData.append("action", "formie/payment-webhooks/process-callback");
|
|
49
|
-
formData.append("merchantSessionKey", "true");
|
|
50
|
-
formData.append("handle", handle);
|
|
51
|
-
formData.append("sessionToken", provider.sessionToken || "");
|
|
52
|
-
fetch(form.action, {
|
|
53
|
-
method: "POST",
|
|
54
|
-
body: formData
|
|
55
|
-
}).then(async (res) => {
|
|
56
|
-
if (res.status < 200 || res.status >= 300) {
|
|
57
|
-
services.addError(`${res.status}: ${res.statusText}`);
|
|
58
|
-
debug.warn("Merchant session request failed.", {
|
|
59
|
-
status: res.status,
|
|
60
|
-
statusText: res.statusText
|
|
61
|
-
});
|
|
62
|
-
resolve(false);
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
try {
|
|
66
|
-
const merchantSessionKey = (await res.json()).merchantSessionKey;
|
|
67
|
-
if (!merchantSessionKey) {
|
|
68
|
-
services.addError("Unable to get merchant session.");
|
|
69
|
-
debug.warn("merchantSessionKey missing in callback response.");
|
|
70
|
-
resolve(false);
|
|
71
|
-
return;
|
|
72
|
-
}
|
|
73
|
-
sagepayOwnForm({ merchantSessionKey }).tokeniseCardDetails({
|
|
74
|
-
cardDetails: {
|
|
75
|
-
cardholderName,
|
|
76
|
-
cardNumber,
|
|
77
|
-
expiryDate,
|
|
78
|
-
securityCode
|
|
79
|
-
},
|
|
80
|
-
onTokenised: (result) => {
|
|
81
|
-
if (result.success && result.cardIdentifier) {
|
|
82
|
-
services.updateInputs("opayoTokenId", result.cardIdentifier);
|
|
83
|
-
services.updateInputs("opayoSessionKey", merchantSessionKey);
|
|
84
|
-
debug.log("Tokenization succeeded.", { hasCardIdentifier: !!result.cardIdentifier });
|
|
85
|
-
resolve(true);
|
|
86
|
-
} else {
|
|
87
|
-
services.addError(result.errors?.[0]?.message || "Tokenization failed.");
|
|
88
|
-
debug.warn("Tokenization failed.", result);
|
|
89
|
-
resolve(false);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
});
|
|
93
|
-
} catch {
|
|
94
|
-
services.addError("Unable to parse merchant session response.");
|
|
95
|
-
debug.warn("Failed to parse merchant session response.");
|
|
96
|
-
resolve(false);
|
|
97
|
-
}
|
|
98
|
-
}).catch(() => {
|
|
99
|
-
services.addError("Network error. Please try again.");
|
|
100
|
-
debug.warn("Network error requesting merchant session.");
|
|
101
|
-
resolve(false);
|
|
102
|
-
});
|
|
103
|
-
});
|
|
104
|
-
},
|
|
105
|
-
setup: async (ctx) => {
|
|
106
|
-
const { services } = ctx;
|
|
107
|
-
ctx.target;
|
|
108
|
-
let activeDialog = null;
|
|
109
|
-
let handling3DSResponse = false;
|
|
110
|
-
const closeDialog = () => {
|
|
111
|
-
if (activeDialog?.parentNode) activeDialog.parentNode.removeChild(activeDialog);
|
|
112
|
-
activeDialog = null;
|
|
113
|
-
};
|
|
114
|
-
const unbind3DS = services.events.onForm(CHALLENGE_EVENT, ((event) => {
|
|
115
|
-
const data = event.detail?.data;
|
|
116
|
-
if (!data?.acsUrl || !data?.creq) return;
|
|
117
|
-
handling3DSResponse = false;
|
|
118
|
-
debug.log("Received payment challenge event.", {
|
|
119
|
-
hasAcsUrl: !!data.acsUrl,
|
|
120
|
-
hasCreq: !!data.creq
|
|
121
|
-
});
|
|
122
|
-
const md = (services.form?.querySelector("input[name*=\"opayoSessionKey\"]"))?.value || "";
|
|
123
|
-
const dialog = document.createElement("div");
|
|
124
|
-
dialog.className = "formie-modal";
|
|
125
|
-
dialog.id = `formie-opayo-dialog-${Math.random().toString(36).slice(2, 9)}`;
|
|
126
|
-
dialog.innerHTML = `
|
|
127
|
-
<div class="formie-modal-backdrop" data-dialog-close></div>
|
|
128
|
-
<div class="formie-modal-content">
|
|
129
|
-
<div class="formie-loading formie-loading-large" style="--formie-loading-width: 3rem; --formie-loading-height: 3rem; top: 50%; margin-top: -1.5rem;"></div>
|
|
130
|
-
<iframe width="100%" height="100%" style="width: 100%; height: 100%; position: relative; z-index: 1;"></iframe>
|
|
131
|
-
</div>
|
|
132
|
-
`;
|
|
133
|
-
const iframe = dialog.querySelector("iframe");
|
|
134
|
-
const esc = (s) => s.replace(/&/g, "&").replace(/"/g, """).replace(/</g, "<");
|
|
135
|
-
const callbackUrl = data.returnUrl || data.redirectUrl || "";
|
|
136
|
-
const html = `<form action="${esc(data.acsUrl)}" method="post">
|
|
137
|
-
<input type="hidden" name="creq" value="${esc(data.creq || "")}" />
|
|
138
|
-
<input type="hidden" name="threeDSSessionData" value="${esc(data.threeDSSessionData || "")}" />
|
|
139
|
-
<input type="hidden" name="MD" value="${esc(md)}" />
|
|
140
|
-
<input type="hidden" name="TermUrl" value="${esc(callbackUrl)}" />
|
|
141
|
-
<input type="hidden" name="ThreeDSNotificationURL" value="${esc(callbackUrl)}" />
|
|
142
|
-
</form><script>document.forms[0].submit();<\/script>`;
|
|
143
|
-
closeDialog();
|
|
144
|
-
document.body.appendChild(dialog);
|
|
145
|
-
activeDialog = dialog;
|
|
146
|
-
if (iframe?.contentWindow) {
|
|
147
|
-
iframe.contentWindow.document.open();
|
|
148
|
-
iframe.contentWindow.document.write(html);
|
|
149
|
-
iframe.contentWindow.document.close();
|
|
150
|
-
}
|
|
151
|
-
}));
|
|
152
|
-
const messageHandler = (event) => {
|
|
153
|
-
if (event.data?.message !== CHALLENGE_RESPONSE_MESSAGE) return;
|
|
154
|
-
if (!activeDialog) {
|
|
155
|
-
debug.log("Ignoring 3DS response without active dialog.");
|
|
156
|
-
return;
|
|
157
|
-
}
|
|
158
|
-
if (handling3DSResponse) {
|
|
159
|
-
debug.warn("Ignoring duplicate 3DS response while processing.");
|
|
160
|
-
return;
|
|
161
|
-
}
|
|
162
|
-
handling3DSResponse = true;
|
|
163
|
-
debug.log("Received payment challenge response message.", event.data?.value);
|
|
164
|
-
closeDialog();
|
|
165
|
-
services.removeError();
|
|
166
|
-
if (event.data?.value?.error) {
|
|
167
|
-
services.addError(event.data.value.error.message);
|
|
168
|
-
services.releaseSubmitLoading();
|
|
169
|
-
handling3DSResponse = false;
|
|
170
|
-
return;
|
|
171
|
-
}
|
|
172
|
-
services.updateInputs("opayo3DSComplete", event.data.value?.transactionId ?? "");
|
|
173
|
-
services.triggerSubmit();
|
|
174
|
-
};
|
|
175
|
-
window.addEventListener("message", messageHandler);
|
|
176
|
-
return { destroy: () => {
|
|
177
|
-
unbind3DS();
|
|
178
|
-
window.removeEventListener("message", messageHandler);
|
|
179
|
-
closeDialog();
|
|
180
|
-
handling3DSResponse = false;
|
|
181
|
-
} };
|
|
182
|
-
},
|
|
183
|
-
onAfterSubmit: async ({ services }) => {
|
|
184
|
-
services.updateInputs([
|
|
185
|
-
"opayoTokenId",
|
|
186
|
-
"opayoSessionKey",
|
|
187
|
-
"opayo3DSComplete"
|
|
188
|
-
], "");
|
|
189
|
-
}
|
|
190
|
-
});
|
|
191
|
-
//#endregion
|
|
192
|
-
export { opayoModule };
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { s as getPaymentProviderActionEventName } from "./event-names-DamGPtXR.js";
|
|
2
|
-
import { t as definePaymentModule } from "./api-DE7LfK-R.js";
|
|
3
|
-
import { r as loadScriptAndEnsureGlobal } from "./scripts-BGD_iU_6.js";
|
|
4
|
-
//#region src/js/modules/payments/paddle.ts
|
|
5
|
-
var SCRIPT_ID = "FORMIE_PADDLE_SCRIPT";
|
|
6
|
-
var CHECKOUT_EVENT = getPaymentProviderActionEventName("paddle", "initialize");
|
|
7
|
-
var paddleModule = definePaymentModule({
|
|
8
|
-
id: "paddle",
|
|
9
|
-
defaultRequiredInputSuffixes: ["paddleCheckoutData"],
|
|
10
|
-
load: async () => null,
|
|
11
|
-
setup: async (ctx) => {
|
|
12
|
-
const { services } = ctx;
|
|
13
|
-
ctx.target;
|
|
14
|
-
const provider = ctx.options.provider;
|
|
15
|
-
const clientSideToken = provider.clientSideToken;
|
|
16
|
-
if (!clientSideToken?.trim()) {
|
|
17
|
-
services.addError("Missing clientSideToken for Paddle.");
|
|
18
|
-
return {};
|
|
19
|
-
}
|
|
20
|
-
let paddle;
|
|
21
|
-
try {
|
|
22
|
-
paddle = await loadScriptAndEnsureGlobal("Paddle", {
|
|
23
|
-
id: SCRIPT_ID,
|
|
24
|
-
src: "https://cdn.paddle.com/paddle/v2/paddle.js"
|
|
25
|
-
});
|
|
26
|
-
paddle.Environment.set(provider.environment || "production");
|
|
27
|
-
} catch (error) {
|
|
28
|
-
services.addError(error instanceof Error ? error.message : "Failed to load Paddle SDK.");
|
|
29
|
-
return {};
|
|
30
|
-
}
|
|
31
|
-
paddle.Initialize({
|
|
32
|
-
token: clientSideToken,
|
|
33
|
-
checkout: { settings: {
|
|
34
|
-
displayMode: "overlay",
|
|
35
|
-
variant: "multi-page"
|
|
36
|
-
} },
|
|
37
|
-
eventCallback: (e) => {
|
|
38
|
-
if (e.name === "checkout.completed") {
|
|
39
|
-
services.updateInputs("paddleCheckoutInit", "");
|
|
40
|
-
services.updateInputs("paddleCheckoutData", JSON.stringify(e.data || {}));
|
|
41
|
-
setTimeout(() => {
|
|
42
|
-
paddle.Checkout.close();
|
|
43
|
-
services.triggerSubmit();
|
|
44
|
-
}, 500);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
const openCheckout = (data) => {
|
|
49
|
-
if (!data?.items) {
|
|
50
|
-
services.addError("Missing Paddle checkout items.");
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
try {
|
|
54
|
-
services.releaseSubmitLoading();
|
|
55
|
-
paddle.Checkout.open(data);
|
|
56
|
-
} catch (error) {
|
|
57
|
-
services.addError(error instanceof Error ? error.message : "Unable to open Paddle checkout.");
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
return true;
|
|
61
|
-
};
|
|
62
|
-
const unbindCheckout = services.events.onForm(CHECKOUT_EVENT, ((event) => {
|
|
63
|
-
openCheckout(event.detail?.data);
|
|
64
|
-
}));
|
|
65
|
-
return { destroy: () => {
|
|
66
|
-
unbindCheckout();
|
|
67
|
-
} };
|
|
68
|
-
},
|
|
69
|
-
onAfterSubmit: async ({ services }) => {
|
|
70
|
-
services.updateInputs("paddleCheckoutInit", "true");
|
|
71
|
-
services.updateInputs("paddleCheckoutData", "");
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
//#endregion
|
|
75
|
-
export { paddleModule };
|
|
@@ -1,121 +0,0 @@
|
|
|
1
|
-
import { t as definePaymentModule } from "./api-DE7LfK-R.js";
|
|
2
|
-
import { r as loadScriptAndEnsureGlobal } from "./scripts-BGD_iU_6.js";
|
|
3
|
-
import { t as ensureModuleStyles } from "./styles-BIh6g7V_.js";
|
|
4
|
-
import paypalCss from "#theme/integrations/_paypal.css?inline";
|
|
5
|
-
//#region src/js/modules/payments/paypal.ts
|
|
6
|
-
ensureModuleStyles("paypal", [paypalCss]);
|
|
7
|
-
var SCRIPT_ID = "FORMIE_PAYPAL_SCRIPT";
|
|
8
|
-
function extractAuthIdFromAuthorization(result) {
|
|
9
|
-
if (!result) return "";
|
|
10
|
-
const payments = (result.purchase_units || [])[0]?.payments || {};
|
|
11
|
-
const authorizations = payments.authorizations || [];
|
|
12
|
-
const captures = payments.captures || [];
|
|
13
|
-
return String(authorizations[0]?.id || captures[0]?.id || "").trim();
|
|
14
|
-
}
|
|
15
|
-
function getScriptUrl(clientId, currency) {
|
|
16
|
-
return `https://www.paypal.com/sdk/js?${[
|
|
17
|
-
"intent=authorize",
|
|
18
|
-
`currency=${encodeURIComponent(currency)}`,
|
|
19
|
-
`client-id=${encodeURIComponent(clientId)}`
|
|
20
|
-
].join("&")}`;
|
|
21
|
-
}
|
|
22
|
-
var paypalModule = definePaymentModule({
|
|
23
|
-
id: "paypal",
|
|
24
|
-
defaultRequiredInputSuffixes: ["paypalOrderId", "paypalAuthId"],
|
|
25
|
-
load: async (ctx) => {
|
|
26
|
-
const { provider } = ctx.options;
|
|
27
|
-
const clientId = provider.clientId;
|
|
28
|
-
if (!clientId?.trim()) {
|
|
29
|
-
console.error("[formie] Missing clientId for PayPal.");
|
|
30
|
-
return null;
|
|
31
|
-
}
|
|
32
|
-
await loadScriptAndEnsureGlobal("paypal", {
|
|
33
|
-
id: SCRIPT_ID,
|
|
34
|
-
src: getScriptUrl(clientId, provider.currency || "AUD")
|
|
35
|
-
});
|
|
36
|
-
return window.paypal;
|
|
37
|
-
},
|
|
38
|
-
mount: async (args) => {
|
|
39
|
-
const { api, field, services, options, provider } = args;
|
|
40
|
-
const placeholder = field.querySelector("[data-formie-paypal-button]");
|
|
41
|
-
if (!placeholder || !api) return null;
|
|
42
|
-
if (placeholder.getAttribute("data-formie-paypal-rendered") === "true") return null;
|
|
43
|
-
placeholder.innerHTML = "";
|
|
44
|
-
const useSandbox = Boolean(provider.useSandbox);
|
|
45
|
-
const currencyResult = services.resolveCurrency({
|
|
46
|
-
value: provider.currency,
|
|
47
|
-
defaultCurrency: "AUD"
|
|
48
|
-
});
|
|
49
|
-
if (!currencyResult.ok) {
|
|
50
|
-
services.addError("error" in currencyResult ? currencyResult.error : "Invalid PayPal currency.");
|
|
51
|
-
return null;
|
|
52
|
-
}
|
|
53
|
-
const currency = currencyResult.value;
|
|
54
|
-
const style = {
|
|
55
|
-
layout: provider.buttonLayout || "vertical",
|
|
56
|
-
color: provider.buttonColor || "gold",
|
|
57
|
-
shape: provider.buttonShape || "rect",
|
|
58
|
-
label: provider.buttonLabel || "paypal",
|
|
59
|
-
width: provider.buttonWidth || 250,
|
|
60
|
-
height: provider.buttonHeight || 35
|
|
61
|
-
};
|
|
62
|
-
if (style.layout === "horizontal") style.tagline = provider.buttonTagline ?? true;
|
|
63
|
-
const paypalOptions = {
|
|
64
|
-
env: useSandbox ? "sandbox" : "production",
|
|
65
|
-
style,
|
|
66
|
-
createOrder: (_data, actions) => {
|
|
67
|
-
services.removeError();
|
|
68
|
-
const amountResult = services.resolveAmount({
|
|
69
|
-
type: provider.amountType,
|
|
70
|
-
fixed: provider.amountFixed,
|
|
71
|
-
variable: provider.amountVariable
|
|
72
|
-
});
|
|
73
|
-
if (!amountResult.ok) {
|
|
74
|
-
const errorMessage = "error" in amountResult ? amountResult.error : "Invalid PayPal amount.";
|
|
75
|
-
services.addError(errorMessage);
|
|
76
|
-
throw new Error(errorMessage);
|
|
77
|
-
}
|
|
78
|
-
return actions.order.create({
|
|
79
|
-
intent: "AUTHORIZE",
|
|
80
|
-
application_context: { user_action: "CONTINUE" },
|
|
81
|
-
purchase_units: [{ amount: {
|
|
82
|
-
currency_code: currency,
|
|
83
|
-
value: String(amountResult.value)
|
|
84
|
-
} }]
|
|
85
|
-
});
|
|
86
|
-
},
|
|
87
|
-
onError: (err) => {
|
|
88
|
-
services.addError(err?.message || "PayPal error.");
|
|
89
|
-
},
|
|
90
|
-
onApprove: async (data, actions) => {
|
|
91
|
-
try {
|
|
92
|
-
const authId = extractAuthIdFromAuthorization(await actions.order.authorize());
|
|
93
|
-
services.updateInputs("paypalOrderId", data.orderID);
|
|
94
|
-
services.updateInputs("paypalAuthId", authId || "");
|
|
95
|
-
if (authId) services.addSuccess("Payment authorized. Finalize the form to complete payment.");
|
|
96
|
-
else services.addSuccess("PayPal approval received. Finalizing payment on submit.");
|
|
97
|
-
} catch {
|
|
98
|
-
services.addError("Unable to authorize payment. Please try again.");
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
};
|
|
102
|
-
const buttons = api.Buttons(paypalOptions);
|
|
103
|
-
placeholder.setAttribute("data-formie-paypal-rendered", "true");
|
|
104
|
-
return buttons.render(placeholder);
|
|
105
|
-
},
|
|
106
|
-
unmount: async (args) => {
|
|
107
|
-
if (args.widget?.close) args.widget.close();
|
|
108
|
-
const placeholder = args.field.querySelector("[data-formie-paypal-button]");
|
|
109
|
-
if (placeholder) {
|
|
110
|
-
placeholder.removeAttribute("data-formie-paypal-rendered");
|
|
111
|
-
placeholder.innerHTML = "";
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
onAfterSubmit: async ({ services }) => {
|
|
115
|
-
services.updateInputs(["paypalOrderId", "paypalAuthId"], "");
|
|
116
|
-
services.removeSuccess();
|
|
117
|
-
services.removeError();
|
|
118
|
-
}
|
|
119
|
-
});
|
|
120
|
-
//#endregion
|
|
121
|
-
export { paypalModule };
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
import { t as definePaymentModule } from "./api-DE7LfK-R.js";
|
|
2
|
-
import { r as loadScriptAndEnsureGlobal } from "./scripts-BGD_iU_6.js";
|
|
3
|
-
import { t as ensureModuleStyles } from "./styles-BIh6g7V_.js";
|
|
4
|
-
import paywayCss from "#theme/integrations/_payway.css?inline";
|
|
5
|
-
//#region src/js/modules/payments/payway.ts
|
|
6
|
-
ensureModuleStyles("payway", [paywayCss]);
|
|
7
|
-
var SCRIPT_ID = "FORMIE_PAYWAY_SCRIPT";
|
|
8
|
-
var paywayModule = definePaymentModule({
|
|
9
|
-
id: "payway",
|
|
10
|
-
defaultRequiredInputSuffixes: ["paywayTokenId"],
|
|
11
|
-
load: async (ctx) => {
|
|
12
|
-
const { provider } = ctx.options;
|
|
13
|
-
if (!provider.publishableKey?.trim()) {
|
|
14
|
-
console.error("[formie] Missing publishableKey for PayWay.");
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
await loadScriptAndEnsureGlobal("payway", {
|
|
18
|
-
id: SCRIPT_ID,
|
|
19
|
-
src: "https://api.payway.com.au/rest/v1/payway.js"
|
|
20
|
-
});
|
|
21
|
-
return null;
|
|
22
|
-
},
|
|
23
|
-
mount: async (args) => {
|
|
24
|
-
const { field, services, options } = args;
|
|
25
|
-
const provider = options.provider;
|
|
26
|
-
if (!field.querySelector("[data-formie-payway-button]")) return null;
|
|
27
|
-
const payway = window.payway;
|
|
28
|
-
if (!payway) return null;
|
|
29
|
-
return new Promise((resolve) => {
|
|
30
|
-
payway.createCreditCardFrame({
|
|
31
|
-
layout: "wide",
|
|
32
|
-
publishableApiKey: provider.publishableKey || "",
|
|
33
|
-
tokenMode: "callback"
|
|
34
|
-
}, (err, frame) => {
|
|
35
|
-
if (err || !frame) {
|
|
36
|
-
services.addError(err?.message || "PayWay frame failed to load.");
|
|
37
|
-
resolve(null);
|
|
38
|
-
return;
|
|
39
|
-
}
|
|
40
|
-
resolve(frame);
|
|
41
|
-
});
|
|
42
|
-
});
|
|
43
|
-
},
|
|
44
|
-
unmount: async (args) => {
|
|
45
|
-
args.widget?.destroy();
|
|
46
|
-
},
|
|
47
|
-
onBeforeAuthorize: async (args) => {
|
|
48
|
-
const { widget, services } = args;
|
|
49
|
-
if (!widget) {
|
|
50
|
-
services.addError("PayWay card frame is not ready.");
|
|
51
|
-
return false;
|
|
52
|
-
}
|
|
53
|
-
return new Promise((resolve) => {
|
|
54
|
-
widget.getToken((err, data) => {
|
|
55
|
-
if (err) {
|
|
56
|
-
services.addError(err.message);
|
|
57
|
-
resolve(false);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
if (data?.singleUseTokenId) {
|
|
61
|
-
services.updateInputs("paywayTokenId", data.singleUseTokenId);
|
|
62
|
-
resolve(true);
|
|
63
|
-
} else {
|
|
64
|
-
services.addError("Tokenization failed.");
|
|
65
|
-
resolve(false);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
},
|
|
70
|
-
onAfterSubmit: async ({ services }) => {
|
|
71
|
-
services.updateInputs("paywayTokenId", "");
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
//#endregion
|
|
75
|
-
export { paywayModule };
|