@justifi/webcomponents 5.4.4 → 5.5.0
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/Api-KMweahmp.js +74 -0
- package/dist/cjs/{Business-d88b77fd.js → Business-DyiDiIuO.js} +1 -1
- package/dist/cjs/{Checkout-5352009d.js → Checkout-RAGvjVPj.js} +1 -1
- package/dist/cjs/{ComponentError-233ac749.js → ComponentError-C4MdBBMe.js} +1 -0
- package/dist/cjs/{Payment-bccd8f7d.js → Payment-CQCmj3Ck.js} +2 -2
- package/dist/cjs/{SubAccount-2a302ead.js → Refund-DpKGhW3o.js} +25 -1
- package/dist/cjs/_commonjsHelpers-BJu3ubxk.js +10 -0
- package/dist/cjs/additional-questions-details_5.cjs.entry.js +5 -11
- package/dist/cjs/{badge-364e6311.js → badge-BXpCpcer.js} +2 -2
- package/dist/cjs/bank-account-document-form-inputs_4.cjs.entry.js +25 -43
- package/dist/cjs/bank-account-form_9.cjs.entry.js +93 -97
- package/dist/cjs/{business-additional-questions-schema-8568cb79.js → business-additional-questions-schema-mzZ2gYHQ.js} +2 -2
- package/dist/cjs/business-details-core.cjs.entry.js +6 -10
- package/dist/cjs/{business-form-options-62e9c8ab.js → business-form-options-BCj0efiD.js} +1 -1
- package/dist/cjs/{business-identity-schema-518ab6eb.js → business-identity-schema-dt0zCW0R.js} +2 -2
- package/dist/cjs/{business.service-6e8a29a2.js → business.service-Crmkeulk.js} +23 -8
- package/dist/cjs/{button-4a9fd41e.js → button-KWTLx2LP.js} +2 -2
- package/dist/cjs/{check-pkg-version-e6dcbeb7.js → check-pkg-version-CLsX6cK5.js} +3 -3
- package/dist/cjs/{checkout.service-0a7835dc.js → checkout.service-r90INf2g.js} +13 -10
- package/dist/cjs/checkouts-list-core.cjs.entry.js +25 -31
- package/dist/cjs/{payments-list-params-state-442d9944.js → checkouts-list-params-state-Cmfy_CND.js} +1 -1
- package/dist/cjs/{checkouts-table-8a1b49ff.js → checkouts-table-5jU4JUcM.js} +4 -4
- package/dist/cjs/custom-popper_4.cjs.entry.js +27 -52
- package/dist/cjs/{dispute.service-6efc7d7f.js → dispute.service-CGgfmGU-.js} +20 -11
- package/dist/cjs/{event-types-5a6ce2b0.js → event-types-CJapDsYA.js} +3 -3
- package/dist/cjs/form-alert_5.cjs.entry.js +10 -19
- package/dist/cjs/form-control-checkbox.cjs.entry.js +9 -18
- package/dist/cjs/form-control-date.cjs.entry.js +9 -19
- package/dist/cjs/{form-control-error-text-3cff9b7b.js → form-control-error-text-D19AMaOO.js} +2 -2
- package/dist/cjs/form-control-file-v2_2.cjs.entry.js +11 -30
- package/dist/cjs/{form-control-help-text-94ffed2c.js → form-control-help-text-CbrDvt9D.js} +2 -2
- package/dist/cjs/form-control-help-text.cjs.entry.js +1 -5
- package/dist/cjs/form-control-monetary-provisioning.cjs.entry.js +13 -22
- package/dist/cjs/form-control-monetary.cjs.entry.js +13 -22
- package/dist/cjs/form-control-number-masked_2.cjs.entry.js +12 -25
- package/dist/cjs/form-control-number.cjs.entry.js +9 -18
- package/dist/cjs/form-control-radio.cjs.entry.js +7 -17
- package/dist/cjs/{get-business-d8f5db51.js → get-business-BBzGEPBG.js} +3 -3
- package/dist/cjs/get-payment-details-CKg1Lb3_.js +42 -0
- package/dist/cjs/{get-payout-csv-7607c71e.js → get-payout-csv-DD9C5yMw.js} +11 -11
- package/dist/cjs/{get-subaccounts-ae5b35a8.js → get-subaccounts-YlFT-fBr.js} +11 -10
- package/dist/cjs/gross-payment-chart-core.cjs.entry.js +262 -270
- package/dist/cjs/{header-1-43b2b905.js → header-1-ZNnpq6yT.js} +2 -2
- package/dist/cjs/{header-3-eb250a04.js → header-3-D6LxdW_A.js} +2 -2
- package/dist/cjs/{helpers-602962eb.js → helpers-B5OCqlIM.js} +1 -1
- package/dist/cjs/{iframe-input-styles-state-d0de0b24.js → iframe-input-styles-state-CQL59u0d.js} +2 -2
- package/dist/cjs/iframe-input.cjs.entry.js +1640 -0
- package/dist/cjs/{index-750475a3.js → index-1MT3Z4XI.js} +1 -1
- package/dist/cjs/{index-d2d0b181.js → index-DhcqPIbT.js} +4 -5
- package/dist/cjs/{index-5b9a3b5f.js → index-DtkhH7sB.js} +460 -271
- package/dist/cjs/index.esm-CVuJLXJZ.js +11807 -0
- package/dist/cjs/{input-handlers-cff032bb.js → input-handlers-DYl_0IwC.js} +1 -1
- package/dist/cjs/{insurance-state-71f8b653.js → insurance-state-q5eNmjIK.js} +3 -3
- package/dist/cjs/justifi-additional-questions-form-step-core_6.cjs.entry.js +64 -94
- package/dist/cjs/justifi-additional-questions-form-step_9.cjs.entry.js +36 -86
- package/dist/cjs/justifi-additional-statement_8.cjs.entry.js +36 -54
- package/dist/cjs/justifi-business-details.cjs.entry.js +16 -20
- package/dist/cjs/justifi-business-form.cjs.entry.js +34 -38
- package/dist/cjs/justifi-business-representative-form-inputs.cjs.entry.js +6 -11
- package/dist/cjs/justifi-checkout-core.cjs.entry.js +31 -34
- package/dist/cjs/justifi-checkout.cjs.entry.js +23 -29
- package/dist/cjs/justifi-checkouts-list-filters.cjs.entry.js +15 -18
- package/dist/cjs/justifi-checkouts-list.cjs.entry.js +25 -30
- package/dist/cjs/justifi-details.cjs.entry.js +3 -6
- package/dist/cjs/justifi-dispute-management-core.cjs.entry.js +5 -11
- package/dist/cjs/justifi-dispute-management.cjs.entry.js +19 -23
- package/dist/cjs/justifi-dispute-notification_3.cjs.entry.js +38 -52
- package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +13 -16
- package/dist/cjs/justifi-order-terminals.cjs.entry.js +29 -37
- package/dist/cjs/justifi-owner-form_3.cjs.entry.js +29 -52
- package/dist/cjs/justifi-payment-details.cjs.entry.js +24 -52
- package/dist/cjs/justifi-payment-provisioning-core.cjs.entry.js +15 -23
- package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +15 -16
- package/dist/cjs/justifi-payments-list-filters.cjs.entry.js +11 -17
- package/dist/cjs/justifi-payments-list.cjs.entry.js +25 -29
- package/dist/cjs/justifi-payout-details.cjs.entry.js +21 -26
- package/dist/cjs/justifi-payouts-list-filters.cjs.entry.js +9 -12
- package/dist/cjs/justifi-payouts-list.cjs.entry.js +27 -33
- package/dist/cjs/justifi-refund-payment.cjs.entry.js +189 -69
- package/dist/cjs/justifi-season-interruption-insurance-core.cjs.entry.js +10 -27
- package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +24 -35
- package/dist/cjs/justifi-terminal-orders-list-filters.cjs.entry.js +24 -26
- package/dist/cjs/justifi-terminal-orders-list.cjs.entry.js +29 -29
- package/dist/cjs/justifi-terminals-list-filters.cjs.entry.js +21 -25
- package/dist/cjs/justifi-terminals-list.cjs.entry.js +26 -31
- package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +24 -28
- package/dist/cjs/loader.cjs.js +3 -5
- package/dist/cjs/lodash-CvSCBJ_8.js +17216 -0
- package/dist/cjs/package-5B4P3NpD.js +9 -0
- package/dist/cjs/pagination-menu.cjs.entry.js +3 -5
- package/dist/cjs/{parts-5ca90f9a.js → parts-D_uKOPFe.js} +3 -1
- package/dist/cjs/payment-details-core.cjs.entry.js +19 -22
- package/dist/cjs/{payment-provisioning-actions-382ab48c.js → payment-provisioning-actions-BkWSDJQQ.js} +2 -2
- package/dist/cjs/payment.service-BrHUGHYs.js +23 -0
- package/dist/cjs/payments-list-core.cjs.entry.js +25 -30
- package/dist/cjs/{terminal-orders-list-params-state-c419078f.js → payments-list-params-state-Cmfy_CND.js} +1 -1
- package/dist/cjs/{payments-status-075aad0a.js → payments-status-DAzq_Z13.js} +2 -2
- package/dist/cjs/{payments-table-a076755a.js → payments-table-BEpL6oJQ.js} +4 -4
- package/dist/cjs/payout-details-core.cjs.entry.js +14 -18
- package/dist/cjs/payouts-list-core.cjs.entry.js +26 -33
- package/dist/cjs/{checkouts-list-params-state-644d3639.js → payouts-list-params-state-Cmfy_CND.js} +1 -1
- package/dist/cjs/{payouts-status-ced97c2b.js → payouts-status-CYrKPRld.js} +2 -2
- package/dist/cjs/{payouts-table-aedce326.js → payouts-table-Bbi23U5v.js} +4 -4
- package/dist/cjs/{schema-validations-a7cefbdf.js → schema-validations-p4OCdblz.js} +4 -4
- package/dist/cjs/{skeleton-e8aa41d0.js → skeleton-C59M0QK2.js} +2 -2
- package/dist/cjs/{spinner-580453f2.js → spinner-736baCoH.js} +2 -2
- package/dist/cjs/{styled-host-94309bab.js → styled-host-JifnTMIV.js} +2 -3
- package/dist/cjs/table-filters-menu.cjs.entry.js +4 -10
- package/dist/cjs/terminal-orders-list-core.cjs.entry.js +24 -29
- package/dist/cjs/{payouts-list-params-state-033b76d6.js → terminal-orders-list-params-state-Cmfy_CND.js} +1 -1
- package/dist/cjs/{terminal-orders-table-3b247193.js → terminal-orders-table-w4Yaf83b.js} +35 -5
- package/dist/cjs/terminal-quantity-selector.cjs.entry.js +6 -12
- package/dist/cjs/{terminal.service-ab62c344.js → terminal.service-BjSo5Cm4.js} +11 -11
- package/dist/cjs/terminals-list-core.cjs.entry.js +25 -31
- package/dist/cjs/terminals-list-params-state-Cmfy_CND.js +22 -0
- package/dist/cjs/{terminals-table-594643fd.js → terminals-table-F6pkR97i.js} +4 -4
- package/dist/cjs/{utils-f8714daa.js → utils-D3seTk2e.js} +2 -2
- package/dist/cjs/utils-DmZ8Dia3.js +23987 -0
- package/dist/cjs/{utils-7a478c37.js → utils-l0veqT9y.js} +1 -1
- package/dist/cjs/webcomponents.cjs.js +7 -7
- package/dist/collection/actions/payment/get-payment-details.js +5 -2
- package/dist/collection/actions/refund/refund-actions.js +31 -0
- package/dist/collection/api/Api.js +32 -13
- package/dist/collection/api/ComponentError.js +1 -0
- package/dist/collection/api/Refund.js +32 -0
- package/dist/collection/api/TerminalOrder.js +3 -0
- package/dist/collection/api/index.js +1 -0
- package/dist/collection/api/services/analytics.service.js +1 -1
- package/dist/collection/api/services/business.service.js +22 -7
- package/dist/collection/api/services/checkout.service.js +6 -3
- package/dist/collection/api/services/dispute.service.js +13 -4
- package/dist/collection/api/services/insurance.service.js +8 -2
- package/dist/collection/api/services/payment.service.js +3 -3
- package/dist/collection/api/services/payout.service.js +3 -3
- package/dist/collection/api/services/provision.service.js +4 -1
- package/dist/collection/api/services/refund.service.js +10 -0
- package/dist/collection/api/services/reports.service.js +1 -1
- package/dist/collection/api/services/subaccounts.service.js +1 -1
- package/dist/collection/api/services/terminal.service.js +4 -4
- package/dist/collection/api/services/terminal_orders.service.js +5 -1
- package/dist/collection/collection-manifest.json +3 -5
- package/dist/collection/components/business-details/additional-questions-details/additional-questions-details.js +4 -4
- package/dist/collection/components/business-details/business-details-core.js +4 -3
- package/dist/collection/components/business-details/business-details.js +6 -8
- package/dist/collection/components/business-details/generic-info-details/generic-info-details.js +4 -4
- package/dist/collection/components/business-details/legal-address-details/legal-address-details.js +4 -4
- package/dist/collection/components/business-details/owner-details/owner-details.js +4 -4
- package/dist/collection/components/business-details/representative-details/representative-details.js +4 -4
- package/dist/collection/components/business-forms/business-form/additional-questions/additional-questions.js +4 -2
- package/dist/collection/components/business-forms/business-form/business-core-info/business-core-info.js +4 -2
- package/dist/collection/components/business-forms/business-form/business-form.js +20 -13
- package/dist/collection/components/business-forms/business-form/business-representative/business-representative.js +6 -4
- package/dist/collection/components/business-forms/business-form/legal-address-form/legal-address-form.js +4 -3
- package/dist/collection/components/business-forms/owner-form/identity-address/identity-address-form.js +11 -7
- package/dist/collection/components/business-forms/owner-form/owner-form-core.js +34 -22
- package/dist/collection/components/business-forms/owner-form/owner-form-inputs.js +10 -6
- package/dist/collection/components/business-forms/owner-form/owner-form.js +22 -19
- package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step-core.js +15 -11
- package/dist/collection/components/business-forms/payment-provisioning/additional-questions/business-additional-questions-form-step.js +9 -10
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-document-inputs.js +11 -8
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/bank-account-form-inputs.js +13 -10
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step-core.js +23 -16
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-bank-account-form-step.js +9 -12
- package/dist/collection/components/business-forms/payment-provisioning/bank-account/business-documents-on-file.js +6 -2
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step-core.js +17 -12
- package/dist/collection/components/business-forms/payment-provisioning/business-core-info/business-core-info-form-step.js +9 -10
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step-core.js +20 -14
- package/dist/collection/components/business-forms/payment-provisioning/business-owners/business-owners-form-step.js +9 -10
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-inputs.js +10 -6
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step-core.js +14 -10
- package/dist/collection/components/business-forms/payment-provisioning/business-representative/business-representative-form-step.js +9 -10
- package/dist/collection/components/business-forms/payment-provisioning/form-control-monetary-provisioning.js +31 -21
- package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step-core.js +14 -10
- package/dist/collection/components/business-forms/payment-provisioning/legal-address-form/legal-address-form-step.js +9 -10
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-core.js +24 -16
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-buttons.js +20 -14
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning-form-steps.js +21 -12
- package/dist/collection/components/business-forms/payment-provisioning/payment-provisioning.js +12 -8
- package/dist/collection/components/business-forms/payment-provisioning/terms-and-conditions/business-terms-conditions-form-step.js +13 -13
- package/dist/collection/components/checkout/bank-account-form/bank-account-form.js +3 -2
- package/dist/collection/components/checkout/billing-form/billing-form-schema.js +21 -0
- package/dist/collection/components/checkout/billing-form/billing-form.js +203 -0
- package/dist/collection/components/checkout/card-form/card-form.js +5 -4
- package/dist/collection/components/checkout/checkout-core.js +88 -37
- package/dist/collection/components/checkout/checkout.js +70 -28
- package/dist/collection/components/checkout/new-payment-method.js +110 -30
- package/dist/collection/components/checkout/payment-method-options.js +91 -36
- package/dist/collection/components/checkout/saved-payment-method.js +7 -4
- package/dist/collection/components/checkout/sezzle-payment-method.js +19 -15
- package/dist/collection/components/checkouts-list/checkouts-list-core.js +17 -14
- package/dist/collection/components/checkouts-list/checkouts-list-filters.js +7 -5
- package/dist/collection/components/checkouts-list/checkouts-list.js +16 -12
- package/dist/collection/components/dispute-management/dispute-management-core.js +11 -8
- package/dist/collection/components/dispute-management/dispute-management.js +12 -9
- package/dist/collection/components/dispute-management/dispute-notification.js +11 -9
- package/dist/collection/components/dispute-management/dispute-response/additional-statement.js +10 -9
- package/dist/collection/components/dispute-management/dispute-response/cancellation-policy.js +10 -8
- package/dist/collection/components/dispute-management/dispute-response/customer-details.js +10 -8
- package/dist/collection/components/dispute-management/dispute-response/dispute-response-core.js +21 -14
- package/dist/collection/components/dispute-management/dispute-response/dispute-response.js +16 -13
- package/dist/collection/components/dispute-management/dispute-response/duplicate-charge.js +10 -8
- package/dist/collection/components/dispute-management/dispute-response/electronic-evidence.js +10 -8
- package/dist/collection/components/dispute-management/dispute-response/product-or-service.js +10 -8
- package/dist/collection/components/dispute-management/dispute-response/refund-policy.js +10 -8
- package/dist/collection/components/dispute-management/dispute-response/shipping-details.js +10 -8
- package/dist/collection/components/gross-payment-chart/gross-payment-chart-core.js +5 -4
- package/dist/collection/components/gross-payment-chart/gross-payment-chart.js +7 -6
- package/dist/collection/components/insurance/season-interruption/season-interruption-insurance-core.js +44 -30
- package/dist/collection/components/insurance/season-interruption/season-interruption-insurance.js +40 -32
- package/dist/collection/components/order-terminals/order-terminals.js +19 -14
- package/dist/collection/components/order-terminals/terminal-quantity-selector/terminal-quantity-selector.js +19 -13
- package/dist/collection/components/payment-details/payment-details-core.js +13 -12
- package/dist/collection/components/payment-details/payment-details.js +29 -6
- package/dist/collection/components/payments-list/payments-list-core.js +12 -11
- package/dist/collection/components/payments-list/payments-list-filters.js +17 -12
- package/dist/collection/components/payments-list/payments-list.js +16 -11
- package/dist/collection/components/payout-details/payout-details-core.js +11 -8
- package/dist/collection/components/payout-details/payout-details.js +11 -9
- package/dist/collection/components/payouts-list/payouts-list-core.js +21 -16
- package/dist/collection/components/payouts-list/payouts-list-filters.js +8 -6
- package/dist/collection/components/payouts-list/payouts-list.js +16 -13
- package/dist/collection/components/refund-payment/refund-loading.js +6 -0
- package/dist/collection/components/refund-payment/refund-payment-schema.js +26 -11
- package/dist/collection/components/refund-payment/refund-payment.js +157 -57
- package/dist/collection/components/terminal-orders-list/terminal-order-status.js +15 -0
- package/dist/collection/components/terminal-orders-list/terminal-orders-list-core.js +12 -11
- package/dist/collection/components/terminal-orders-list/terminal-orders-list-filters.js +18 -11
- package/dist/collection/components/terminal-orders-list/terminal-orders-list.js +16 -11
- package/dist/collection/components/terminal-orders-list/terminal-orders-table.js +11 -1
- package/dist/collection/components/terminals-list/terminals-list-core.js +17 -14
- package/dist/collection/components/terminals-list/terminals-list-filters.js +10 -7
- package/dist/collection/components/terminals-list/terminals-list.js +16 -12
- package/dist/collection/components/tokenize-payment-method/tokenize-payment-method.js +71 -19
- package/dist/collection/styles/parts.js +2 -1
- package/dist/collection/ui-components/custom-popper/custom-popper.js +19 -8
- package/dist/collection/ui-components/details/details.js +3 -4
- package/dist/collection/ui-components/filters/table-filters-menu.js +8 -7
- package/dist/collection/ui-components/form/form-control-checkbox.js +25 -17
- package/dist/collection/ui-components/form/form-control-date.js +32 -21
- package/dist/collection/ui-components/form/form-control-file-v2.js +23 -18
- package/dist/collection/ui-components/form/form-control-file.js +28 -21
- package/dist/collection/ui-components/form/form-control-monetary.js +35 -23
- package/dist/collection/ui-components/form/form-control-number-masked.js +28 -19
- package/dist/collection/ui-components/form/form-control-number.js +25 -17
- package/dist/collection/ui-components/form/form-control-radio.js +28 -19
- package/dist/collection/ui-components/form/form-control-select.js +29 -19
- package/dist/collection/ui-components/form/form-control-text.js +32 -21
- package/dist/collection/ui-components/form/form-control-textarea.js +32 -21
- package/dist/collection/ui-components/form/form-helpers/form-alert/form-alert.js +6 -6
- package/dist/collection/ui-components/form/form-helpers/form-control-help-text/form-control-help-text.js +6 -6
- package/dist/collection/ui-components/form/form-helpers/form-control-tooltip/form-control-tooltip.js +3 -6
- package/dist/collection/ui-components/form/hidden-input.js +1 -1
- package/dist/collection/ui-components/form/iframe-input.js +14 -12
- package/dist/collection/ui-components/pagination-menu/pagination-menu.js +6 -0
- package/dist/collection/utils/utils.js +8 -0
- package/dist/docs.d.ts +8 -0
- package/dist/docs.json +1844 -905
- package/dist/esm/Api-C9CDE-UM.js +72 -0
- package/dist/esm/{Business-0855931c.js → Business-D6XNzizo.js} +2 -2
- package/dist/esm/{Checkout-18d8bf94.js → Checkout-Dfpql997.js} +1 -1
- package/dist/esm/{ComponentError-c61dce41.js → ComponentError-SdntD1xf.js} +2 -1
- package/dist/esm/{Document-1907c0d4.js → Document-Ct-uNz2r.js} +1 -1
- package/dist/esm/{Payment-806af354.js → Payment-BADkZFaz.js} +2 -2
- package/dist/esm/{SubAccount-7520271c.js → Refund-t_P1yy9d.js} +25 -2
- package/dist/esm/_commonjsHelpers-BFTU3MAI.js +7 -0
- package/dist/esm/additional-questions-details_5.entry.js +5 -9
- package/dist/esm/{badge-1be14e8c.js → badge-C4TzL9CB.js} +3 -3
- package/dist/esm/bank-account-document-form-inputs_4.entry.js +25 -41
- package/dist/esm/bank-account-form_9.entry.js +91 -93
- package/dist/esm/{business-additional-questions-schema-56308a54.js → business-additional-questions-schema-W6okG5Xu.js} +2 -2
- package/dist/esm/business-details-core.entry.js +6 -8
- package/dist/esm/{business-form-options-86a13078.js → business-form-options-Bn05PRR4.js} +1 -1
- package/dist/esm/{business-identity-schema-24fcc4ef.js → business-identity-schema-lqdJS3MT.js} +2 -2
- package/dist/esm/{business.service-999196a4.js → business.service-B136meVo.js} +23 -8
- package/dist/esm/{button-fcee4da7.js → button-CI85Rqy5.js} +2 -2
- package/dist/esm/{check-pkg-version-47fc35a7.js → check-pkg-version-Wd4E_Njt.js} +3 -3
- package/dist/esm/{checkout.service-e38e477f.js → checkout.service-4tnXBKGq.js} +13 -10
- package/dist/esm/checkouts-list-core.entry.js +25 -29
- package/dist/esm/{checkouts-list-params-state-7bdf00bd.js → checkouts-list-params-state-Gbxdxjoi.js} +1 -1
- package/dist/esm/{checkouts-table-39a031a0.js → checkouts-table-CHM4YCCZ.js} +4 -4
- package/dist/esm/custom-popper_4.entry.js +27 -50
- package/dist/esm/{dispute.service-7ba6d5a4.js → dispute.service-Bwh8pBe9.js} +20 -11
- package/dist/esm/{event-types-1bc52f1f.js → event-types-CooIFpFI.js} +3 -3
- package/dist/esm/form-alert_5.entry.js +10 -17
- package/dist/esm/form-control-checkbox.entry.js +9 -16
- package/dist/esm/form-control-date.entry.js +9 -17
- package/dist/esm/{form-control-error-text-176d20d8.js → form-control-error-text-3q5yVuMQ.js} +2 -2
- package/dist/esm/form-control-file-v2_2.entry.js +11 -28
- package/dist/esm/{form-control-help-text-83764e14.js → form-control-help-text-BplkZkPF.js} +2 -2
- package/dist/esm/form-control-help-text.entry.js +1 -3
- package/dist/esm/form-control-monetary-provisioning.entry.js +13 -20
- package/dist/esm/form-control-monetary.entry.js +13 -20
- package/dist/esm/form-control-number-masked_2.entry.js +12 -23
- package/dist/esm/form-control-number.entry.js +9 -16
- package/dist/esm/form-control-radio.entry.js +7 -15
- package/dist/esm/{get-business-b7511690.js → get-business-B3c5gg1D.js} +3 -3
- package/dist/esm/get-payment-details-BbZmEGge.js +40 -0
- package/dist/esm/{get-payout-csv-fa34f40b.js → get-payout-csv-BKq22mOI.js} +11 -11
- package/dist/esm/{get-subaccounts-3c6b9e84.js → get-subaccounts-58LQOtEI.js} +10 -9
- package/dist/esm/gross-payment-chart-core.entry.js +262 -268
- package/dist/esm/{header-1-215a146f.js → header-1-BX6i3__G.js} +2 -2
- package/dist/esm/{header-3-afd16f23.js → header-3-D0Sy-7DJ.js} +2 -2
- package/dist/esm/{helpers-96ea3464.js → helpers-Mu7LQT-w.js} +2 -2
- package/dist/esm/{iframe-input-styles-state-ff730fe5.js → iframe-input-styles-state-DyXIZw1A.js} +3 -3
- package/dist/esm/iframe-input.entry.js +1638 -0
- package/dist/esm/{index-29fcfdf5.js → index-BUM1DfV9.js} +459 -250
- package/dist/esm/{index-d9a73ce3.js → index-Ce_F4E0f.js} +1 -1
- package/dist/esm/{index-a47fdc7f.js → index-Cuk6aIda.js} +4 -5
- package/dist/esm/index.esm-BCNUj0Dx.js +11801 -0
- package/dist/esm/{input-handlers-270ac806.js → input-handlers-CX6mSvOM.js} +1 -1
- package/dist/esm/{insurance-state-d2df8e88.js → insurance-state-BhklYgGK.js} +3 -3
- package/dist/esm/justifi-additional-questions-form-step-core_6.entry.js +64 -92
- package/dist/esm/justifi-additional-questions-form-step_9.entry.js +36 -84
- package/dist/esm/justifi-additional-statement_8.entry.js +36 -52
- package/dist/esm/justifi-business-details.entry.js +16 -18
- package/dist/esm/justifi-business-form.entry.js +34 -36
- package/dist/esm/justifi-business-representative-form-inputs.entry.js +6 -9
- package/dist/esm/justifi-checkout-core.entry.js +31 -32
- package/dist/esm/justifi-checkout.entry.js +23 -27
- package/dist/esm/justifi-checkouts-list-filters.entry.js +15 -16
- package/dist/esm/justifi-checkouts-list.entry.js +25 -28
- package/dist/esm/justifi-details.entry.js +3 -4
- package/dist/esm/justifi-dispute-management-core.entry.js +5 -9
- package/dist/esm/justifi-dispute-management.entry.js +19 -21
- package/dist/esm/justifi-dispute-notification_3.entry.js +38 -50
- package/dist/esm/justifi-gross-payment-chart.entry.js +13 -14
- package/dist/esm/justifi-order-terminals.entry.js +26 -32
- package/dist/esm/justifi-owner-form_3.entry.js +29 -50
- package/dist/esm/justifi-payment-details.entry.js +22 -48
- package/dist/esm/justifi-payment-provisioning-core.entry.js +15 -21
- package/dist/esm/justifi-payment-provisioning.entry.js +15 -14
- package/dist/esm/justifi-payments-list-filters.entry.js +11 -15
- package/dist/esm/justifi-payments-list.entry.js +25 -27
- package/dist/esm/justifi-payout-details.entry.js +20 -23
- package/dist/esm/justifi-payouts-list-filters.entry.js +9 -10
- package/dist/esm/justifi-payouts-list.entry.js +26 -30
- package/dist/esm/justifi-refund-payment.entry.js +189 -67
- package/dist/esm/justifi-season-interruption-insurance-core.entry.js +10 -25
- package/dist/esm/justifi-season-interruption-insurance.entry.js +24 -33
- package/dist/esm/justifi-terminal-orders-list-filters.entry.js +19 -19
- package/dist/esm/justifi-terminal-orders-list.entry.js +28 -26
- package/dist/esm/justifi-terminals-list-filters.entry.js +17 -19
- package/dist/esm/justifi-terminals-list.entry.js +25 -28
- package/dist/esm/justifi-tokenize-payment-method.entry.js +24 -26
- package/dist/esm/loader.js +4 -4
- package/dist/esm/lodash-BqWxUrkh.js +17214 -0
- package/dist/esm/package-gAO-RwrF.js +7 -0
- package/dist/esm/pagination-menu.entry.js +3 -3
- package/dist/esm/{parts-fd740f54.js → parts-CB88j97I.js} +3 -2
- package/dist/esm/payment-details-core.entry.js +19 -20
- package/dist/esm/{payment-provisioning-actions-beadac34.js → payment-provisioning-actions-CZYFFdTf.js} +3 -3
- package/dist/esm/payment.service-Co_fPTvK.js +21 -0
- package/dist/esm/payments-list-core.entry.js +25 -28
- package/dist/esm/{payments-list-params-state-d05b24aa.js → payments-list-params-state-Gbxdxjoi.js} +1 -1
- package/dist/esm/{payments-status-74d22728.js → payments-status-BLhcMfnC.js} +2 -2
- package/dist/esm/{payments-table-8134f5e1.js → payments-table-VcaC77NC.js} +4 -4
- package/dist/esm/payout-details-core.entry.js +14 -16
- package/dist/esm/payouts-list-core.entry.js +26 -31
- package/dist/esm/{payouts-list-params-state-ebcee300.js → payouts-list-params-state-Gbxdxjoi.js} +1 -1
- package/dist/esm/{payouts-status-29d31099.js → payouts-status-B9SSljnL.js} +2 -2
- package/dist/esm/{payouts-table-c1ced46a.js → payouts-table-DWBaNPmV.js} +4 -4
- package/dist/esm/{schema-validations-5af4266a.js → schema-validations-BsbYeDDR.js} +5 -5
- package/dist/esm/{skeleton-ab3f676e.js → skeleton-B-oFGeeG.js} +2 -2
- package/dist/esm/{spinner-27479716.js → spinner-ptEcaLdc.js} +2 -2
- package/dist/esm/{styled-host-32228b45.js → styled-host-BHVh70Zk.js} +2 -3
- package/dist/esm/table-filters-menu.entry.js +4 -8
- package/dist/esm/terminal-orders-list-core.entry.js +24 -27
- package/dist/esm/{terminal-orders-list-params-state-8fec0a0b.js → terminal-orders-list-params-state-Gbxdxjoi.js} +1 -1
- package/dist/esm/{terminal-orders-table-93e84d25.js → terminal-orders-table-fuxIpfJ2.js} +35 -5
- package/dist/esm/terminal-quantity-selector.entry.js +6 -10
- package/dist/esm/{terminal.service-d173566d.js → terminal.service-BLOZ-ZlR.js} +11 -11
- package/dist/esm/terminals-list-core.entry.js +25 -29
- package/dist/esm/terminals-list-params-state-Gbxdxjoi.js +16 -0
- package/dist/esm/{terminals-table-ff24bf27.js → terminals-table-Dn71oQMb.js} +4 -4
- package/dist/esm/{utils-96d9c205.js → utils-B4pV3GWr.js} +2 -2
- package/dist/esm/utils-BWcTxbSg.js +23969 -0
- package/dist/esm/{utils-fd99b806.js → utils-Dccsn9BY.js} +2 -2
- package/dist/esm/webcomponents.js +6 -5
- package/dist/module/Api.js +32 -76
- package/dist/module/Business.js +2 -2
- package/dist/module/ComponentError.js +2 -1
- package/dist/module/Document.js +1 -1
- package/dist/module/{SubAccount.js → Refund.js} +24 -1
- package/dist/module/_commonjsHelpers.js +7 -0
- package/dist/module/additional-questions-details2.js +1 -2
- package/dist/module/additional-questions.js +2 -3
- package/dist/module/additional-statement.js +6 -9
- package/dist/module/badge.js +1 -1
- package/dist/module/bank-account-document-inputs.js +4 -6
- package/dist/module/bank-account-form-inputs2.js +1 -5
- package/dist/module/bank-account-form2.js +0 -1
- package/dist/module/billing-form.js +122 -4
- package/dist/module/business-additional-questions-form-step-core.js +7 -11
- package/dist/module/business-additional-questions-form-step.js +1 -6
- package/dist/module/business-additional-questions-schema.js +1 -1
- package/dist/module/business-address-schema.js +1 -1
- package/dist/module/business-bank-account-form-step-core.js +13 -18
- package/dist/module/business-bank-account-form-step.js +3 -9
- package/dist/module/business-core-info-form-step-core.js +6 -11
- package/dist/module/business-core-info-form-step.js +1 -6
- package/dist/module/business-core-info-schema.js +1 -1
- package/dist/module/business-core-info.js +2 -3
- package/dist/module/business-details-core2.js +1 -3
- package/dist/module/business-documents-on-file2.js +1 -1
- package/dist/module/business-form-options.js +1 -1
- package/dist/module/business-identity-schema.js +1 -1
- package/dist/module/business-owners-form-step-core.js +5 -11
- package/dist/module/business-owners-form-step.js +1 -6
- package/dist/module/business-representative-form-inputs.js +1 -4
- package/dist/module/business-representative-form-step-core.js +5 -9
- package/dist/module/business-representative-form-step.js +1 -6
- package/dist/module/business-representative.js +3 -4
- package/dist/module/business-terms-conditions-form-step.js +6 -12
- package/dist/module/business.service.js +22 -7
- package/dist/module/button.js +1 -1
- package/dist/module/cancellation-policy.js +6 -8
- package/dist/module/card-form2.js +2 -3
- package/dist/module/check-pkg-version.js +1 -1
- package/dist/module/checkout-core.js +57 -69
- package/dist/module/checkout.service.js +7 -4
- package/dist/module/checkouts-list-core2.js +12 -17
- package/dist/module/custom-popper2.js +13 -16
- package/dist/module/customer-details.js +6 -8
- package/dist/module/details.js +0 -1
- package/dist/module/dispute-management-core.js +4 -8
- package/dist/module/dispute-notification.js +3 -6
- package/dist/module/dispute-response-actions.js +16 -7
- package/dist/module/dispute-response-core.js +12 -16
- package/dist/module/dispute-response.js +6 -12
- package/dist/module/duplicate-charge.js +6 -8
- package/dist/module/electronic-evidence.js +5 -7
- package/dist/module/event-types2.js +21 -61
- package/dist/module/event-types3.js +61 -21
- package/dist/module/form-alert2.js +1 -3
- package/dist/module/form-control-checkbox2.js +6 -13
- package/dist/module/form-control-date2.js +6 -14
- package/dist/module/form-control-file-v22.js +2 -10
- package/dist/module/form-control-file2.js +5 -15
- package/dist/module/form-control-help-text.js +1 -1
- package/dist/module/form-control-help-text2.js +30 -9
- package/dist/module/form-control-help-text3.js +9 -32
- package/dist/module/form-control-monetary-provisioning2.js +8 -15
- package/dist/module/form-control-monetary2.js +9 -17
- package/dist/module/form-control-number-masked2.js +4 -12
- package/dist/module/form-control-number.js +6 -13
- package/dist/module/form-control-radio2.js +6 -14
- package/dist/module/form-control-select2.js +5 -13
- package/dist/module/form-control-text2.js +5 -14
- package/dist/module/form-control-textarea2.js +7 -16
- package/dist/module/form-control-tooltip2.js +0 -3
- package/dist/module/form.js +9773 -903
- package/dist/module/generic-info-details2.js +0 -1
- package/dist/module/get-business.js +2 -2
- package/dist/module/get-payment-details.js +40 -0
- package/dist/module/get-payout-csv.js +6 -6
- package/dist/module/get-subaccounts.js +5 -4
- package/dist/module/gross-payment-chart-core2.js +257 -264
- package/dist/module/helpers.js +1 -1
- package/dist/module/hidden-input2.js +3 -3
- package/dist/module/identity-address-form.js +2 -5
- package/dist/module/iframe-input-styles-state.js +2 -2
- package/dist/module/iframe-input2.js +1481 -1478
- package/dist/module/index2.js +3 -4
- package/dist/module/index3.js +1 -1
- package/dist/module/{billing-form.d.ts → justifi-billing-form.d.ts} +4 -4
- package/dist/module/justifi-billing-form.js +6 -0
- package/dist/module/justifi-business-details.js +1 -5
- package/dist/module/justifi-business-form.js +7 -10
- package/dist/module/justifi-checkout.js +47 -62
- package/dist/module/justifi-checkouts-list-filters.js +4 -5
- package/dist/module/justifi-checkouts-list.js +8 -11
- package/dist/module/justifi-dispute-management.js +6 -9
- package/dist/module/justifi-gross-payment-chart.js +4 -7
- package/dist/module/justifi-order-terminals.js +6 -13
- package/dist/module/justifi-payment-details.js +6 -38
- package/dist/module/justifi-payment-provisioning.js +5 -6
- package/dist/module/justifi-payments-list-filters.js +6 -11
- package/dist/module/justifi-payments-list.js +8 -10
- package/dist/module/justifi-payout-details.js +6 -9
- package/dist/module/justifi-payouts-list-filters.js +4 -6
- package/dist/module/justifi-payouts-list.js +8 -12
- package/dist/module/justifi-refund-payment.js +184 -61
- package/dist/module/justifi-season-interruption-insurance.js +13 -23
- package/dist/module/justifi-terminal-orders-list-filters.js +8 -9
- package/dist/module/justifi-terminal-orders-list.js +13 -11
- package/dist/module/justifi-terminals-list-filters.js +6 -8
- package/dist/module/justifi-terminals-list.js +8 -11
- package/dist/module/justifi-tokenize-payment-method.js +46 -58
- package/dist/module/legal-address-details2.js +1 -2
- package/dist/module/legal-address-form-step-core.js +6 -10
- package/dist/module/legal-address-form-step.js +1 -6
- package/dist/module/legal-address-form.js +1 -3
- package/dist/module/lodash.js +17201 -17191
- package/dist/module/new-payment-method.js +43 -55
- package/dist/module/owner-details2.js +0 -1
- package/dist/module/owner-form-core2.js +8 -18
- package/dist/module/owner-form-inputs2.js +1 -4
- package/dist/module/owner-form.js +1 -11
- package/dist/module/package.js +3 -77
- package/dist/module/pagination-menu2.js +1 -1
- package/dist/module/parts.js +3 -2
- package/dist/module/payment-details-core2.js +11 -13
- package/dist/module/payment-method-options.js +43 -61
- package/dist/module/payment-provisioning-actions.js +2 -2
- package/dist/module/payment-provisioning-core.js +8 -14
- package/dist/module/payment-provisioning-form-buttons.js +2 -8
- package/dist/module/payment-provisioning-form-steps.js +2 -7
- package/dist/module/payment.service.js +4 -4
- package/dist/module/payments-list-core2.js +10 -14
- package/dist/module/payout-details-core2.js +6 -9
- package/dist/module/payouts-list-core2.js +14 -20
- package/dist/module/product-or-service.js +5 -7
- package/dist/module/refund-policy.js +6 -8
- package/dist/module/representative-details2.js +0 -1
- package/dist/module/saved-payment-method.js +4 -6
- package/dist/module/schema-validations.js +2 -2
- package/dist/module/season-interruption-insurance-core.js +4 -20
- package/dist/module/sezzle-payment-method.js +3 -12
- package/dist/module/shipping-details.js +6 -8
- package/dist/module/spinner.js +1 -1
- package/dist/module/styled-host.js +1 -2
- package/dist/module/table-filters-menu2.js +3 -7
- package/dist/module/terminal-orders-list-core2.js +35 -15
- package/dist/module/terminal-quantity-selector2.js +4 -8
- package/dist/module/terminal.service.js +5 -5
- package/dist/module/terminals-list-core2.js +12 -17
- package/dist/module/utils.js +1 -1
- package/dist/module/utils2.js +23787 -3819
- package/dist/module/utils4.js +2 -2
- package/dist/types/actions/payment/get-payment-details.d.ts +4 -2
- package/dist/types/actions/refund/refund-actions.d.ts +12 -0
- package/dist/types/api/Api.d.ts +30 -5
- package/dist/types/api/ComponentError.d.ts +2 -1
- package/dist/types/api/Payment.d.ts +1 -11
- package/dist/types/api/Refund.d.ts +45 -0
- package/dist/types/api/TerminalOrder.d.ts +4 -1
- package/dist/types/api/index.d.ts +1 -0
- package/dist/types/api/services/payment.service.d.ts +2 -2
- package/dist/types/api/services/refund.service.d.ts +7 -0
- package/dist/types/components/business-forms/payment-provisioning/form-control-monetary-provisioning.d.ts +1 -1
- package/dist/types/components/business-forms/schemas/business-form-schema.d.ts +3 -3
- package/dist/types/components/business-forms/schemas/business-identity-schema.d.ts +1 -1
- package/dist/types/components/checkout/{billing-forms → billing-form}/billing-form-schema.d.ts +1 -11
- package/dist/types/components/checkout/{billing-forms/billing-form → billing-form}/billing-form.d.ts +8 -6
- package/dist/types/components/checkout/checkout-core.d.ts +6 -2
- package/dist/types/components/checkout/checkout.d.ts +6 -2
- package/dist/types/components/checkout/new-payment-method.d.ts +7 -3
- package/dist/types/components/checkout/payment-method-options.d.ts +6 -2
- package/dist/types/components/payment-details/payment-details.d.ts +1 -0
- package/dist/types/components/refund-payment/refund-loading.d.ts +1 -0
- package/dist/types/components/refund-payment/refund-payment-schema.d.ts +6 -6
- package/dist/types/components/refund-payment/refund-payment.d.ts +18 -12
- package/dist/types/components/terminal-orders-list/terminal-orders-list-filters.d.ts +1 -1
- package/dist/types/components/tokenize-payment-method/tokenize-payment-method.d.ts +4 -0
- package/dist/types/components.d.ts +45 -74
- package/dist/types/stencil-public-runtime.d.ts +9 -0
- package/dist/types/styles/parts.d.ts +6 -5
- package/dist/types/ui-components/form/form-control-monetary.d.ts +1 -1
- package/dist/types/utils/utils.d.ts +1 -0
- package/dist/webcomponents/{p-701a13ca.js → p-01wziNa9.js} +1 -1
- package/dist/webcomponents/p-063dd981.entry.js +1 -0
- package/dist/webcomponents/p-08d5b491.entry.js +1 -0
- package/dist/webcomponents/{p-70be104e.js → p-0czqizJW.js} +1 -1
- package/dist/webcomponents/p-1049c0c5.entry.js +1 -0
- package/dist/webcomponents/p-1ydcg9ti.js +1 -0
- package/dist/webcomponents/p-2c2f6743.entry.js +1 -0
- package/dist/webcomponents/p-2d80f427.entry.js +1 -0
- package/dist/webcomponents/p-2f6c0a07.entry.js +1 -0
- package/dist/webcomponents/p-2fe9576b.entry.js +1 -0
- package/dist/webcomponents/p-307a0db6.entry.js +1 -0
- package/dist/webcomponents/p-3147bfe2.entry.js +1 -0
- package/dist/webcomponents/p-332ce001.entry.js +1 -0
- package/dist/webcomponents/p-34cfafed.entry.js +1 -0
- package/dist/webcomponents/p-3995c8b8.entry.js +1 -0
- package/dist/webcomponents/p-3e084a0e.entry.js +1 -0
- package/dist/webcomponents/p-43c1c278.entry.js +1 -0
- package/dist/webcomponents/p-456f8c0a.entry.js +1 -0
- package/dist/webcomponents/p-4addd069.entry.js +1 -0
- package/dist/webcomponents/p-4ee6482d.entry.js +1 -0
- package/dist/webcomponents/p-507f7a31.entry.js +1 -0
- package/dist/webcomponents/p-50aa4e4d.entry.js +1 -0
- package/dist/webcomponents/p-5a07a84c.entry.js +1 -0
- package/dist/webcomponents/p-5dc3a795.entry.js +1 -0
- package/dist/webcomponents/p-62bdcca1.entry.js +1 -0
- package/dist/webcomponents/p-65345bd4.entry.js +1 -0
- package/dist/webcomponents/p-6a54d69b.entry.js +1 -0
- package/dist/webcomponents/p-6c4927e7.entry.js +1 -0
- package/dist/webcomponents/p-6d2a48f5.entry.js +1 -0
- package/dist/webcomponents/p-7414b942.entry.js +1 -0
- package/dist/webcomponents/p-7ddd7122.entry.js +20 -0
- package/dist/webcomponents/p-80dca817.entry.js +1 -0
- package/dist/webcomponents/p-815937bb.entry.js +1 -0
- package/dist/webcomponents/p-86fdc0a1.entry.js +1 -0
- package/dist/webcomponents/p-98111d03.entry.js +1 -0
- package/dist/webcomponents/p-9a9bb294.entry.js +1 -0
- package/dist/webcomponents/p-9bbfde16.entry.js +1 -0
- package/dist/webcomponents/p-B7ErpLYA.js +1 -0
- package/dist/webcomponents/p-BBsCnePk.js +1 -0
- package/dist/webcomponents/p-BFTU3MAI.js +1 -0
- package/dist/webcomponents/p-BHHWVg32.js +1 -0
- package/dist/webcomponents/p-BHbsXXRt.js +1 -0
- package/dist/webcomponents/p-BM61p7vG.js +1 -0
- package/dist/webcomponents/p-BODr6HXb.js +1 -0
- package/dist/webcomponents/p-BUM1DfV9.js +2 -0
- package/dist/webcomponents/p-BVwkHwTc.js +1 -0
- package/dist/webcomponents/p-BWFriesi.js +1 -0
- package/dist/webcomponents/p-Bde7dY9t.js +9 -0
- package/dist/webcomponents/{p-1366a019.js → p-BjB_yKBJ.js} +1 -1
- package/dist/webcomponents/p-Bo92MHrs.js +1 -0
- package/dist/webcomponents/p-BoPxMyJA.js +1 -0
- package/dist/webcomponents/{p-5d1d2fd7.js → p-BrvbVMVq.js} +1 -1
- package/dist/webcomponents/{p-a5579f53.js → p-BuYnqWwT.js} +1 -1
- package/dist/webcomponents/p-BxPlB-C5.js +1 -0
- package/dist/webcomponents/{p-3f5e6602.js → p-Bxs6fi7a.js} +1 -1
- package/dist/webcomponents/{p-bfe9748b.js → p-C3nDCvFQ.js} +1 -1
- package/dist/webcomponents/{p-87f8c596.js → p-C5RuuShs.js} +1 -1
- package/dist/webcomponents/p-CB88j97I.js +1 -0
- package/dist/webcomponents/p-CGz3XHQc.js +1 -0
- package/dist/webcomponents/p-CLBRsaLx.js +1 -0
- package/dist/webcomponents/{p-4cc3c7f9.js → p-CTBH4Lj9.js} +1 -1
- package/dist/webcomponents/p-CYsU0lEI.js +1 -0
- package/dist/webcomponents/p-CjunQqer.js +1 -0
- package/dist/webcomponents/{p-12074378.js → p-CnyMKcfC.js} +1 -1
- package/dist/webcomponents/p-CpTwq2jw.js +1 -0
- package/dist/webcomponents/{p-61f0a2ce.js → p-Ct-uNz2r.js} +1 -1
- package/dist/webcomponents/p-CwHcfOV7.js +1 -0
- package/dist/webcomponents/p-Cy4aIACq.js +1 -0
- package/dist/webcomponents/p-D7s2671S.js +1 -0
- package/dist/webcomponents/{p-ca6cdfe6.js → p-D89x2FYg.js} +1 -1
- package/dist/webcomponents/p-D9t-X0IY.js +1 -0
- package/dist/webcomponents/p-DLpKiPxJ.js +1 -0
- package/dist/webcomponents/p-DVnVdicA.js +1 -0
- package/dist/webcomponents/p-DhEfW-kS.js +1 -0
- package/dist/webcomponents/p-DhQ2XlhY.js +1 -0
- package/dist/webcomponents/p-Dna7whFY.js +1 -0
- package/dist/webcomponents/p-DoH48u6u.js +1 -0
- package/dist/webcomponents/p-Dt-vy9Le.js +1 -0
- package/dist/webcomponents/p-DzPbgN8M.js +1 -0
- package/dist/webcomponents/{p-c9b78275.js → p-IA90llLO.js} +1 -1
- package/dist/webcomponents/p-JcczGkik.js +1 -0
- package/dist/webcomponents/p-QYQ4VLoz.js +1 -0
- package/dist/webcomponents/{p-9dd8685c.js → p-SdntD1xf.js} +1 -1
- package/dist/webcomponents/p-ZUQEru6m.js +1 -0
- package/dist/webcomponents/p-a22974fd.entry.js +1 -0
- package/dist/webcomponents/p-a2bf5919.entry.js +1 -0
- package/dist/webcomponents/p-a9eff0f2.entry.js +1 -0
- package/dist/webcomponents/p-ab99e4c6.entry.js +1 -0
- package/dist/webcomponents/p-b7053613.entry.js +1 -0
- package/dist/webcomponents/p-bb8f7062.entry.js +1 -0
- package/dist/webcomponents/p-be04a09c.entry.js +1 -0
- package/dist/webcomponents/p-bplwtwD3.js +1 -0
- package/dist/webcomponents/p-c38c742e.entry.js +1 -0
- package/dist/webcomponents/p-c558725e.entry.js +1 -0
- package/dist/webcomponents/p-c6534f5f.entry.js +1 -0
- package/dist/webcomponents/p-c6cf707c.entry.js +1 -0
- package/dist/webcomponents/p-c70dcec1.entry.js +1 -0
- package/dist/webcomponents/p-c8d608a1.entry.js +1 -0
- package/dist/webcomponents/p-ce20d709.entry.js +1 -0
- package/dist/webcomponents/p-cf8f69de.entry.js +1 -0
- package/dist/webcomponents/p-d5675bf5.entry.js +1 -0
- package/dist/webcomponents/p-def42fc7.entry.js +1 -0
- package/dist/webcomponents/p-dfcf19f2.entry.js +1 -0
- package/dist/webcomponents/p-e0896deb.entry.js +1 -0
- package/dist/webcomponents/p-e3962860.entry.js +1 -0
- package/dist/webcomponents/p-e3cd72ad.entry.js +1 -0
- package/dist/webcomponents/p-e52d5ead.entry.js +1 -0
- package/dist/webcomponents/p-eYaGyUvS.js +1 -0
- package/dist/webcomponents/p-eb31e5c7.entry.js +1 -0
- package/dist/webcomponents/p-eb677eb2.entry.js +1 -0
- package/dist/webcomponents/p-f0301d11.entry.js +1 -0
- package/dist/webcomponents/p-f51e4213.entry.js +1 -0
- package/dist/webcomponents/p-gAO-RwrF.js +1 -0
- package/dist/webcomponents/p-hkXaxw9l.js +1 -0
- package/dist/webcomponents/p-p7aAf5_m.js +1 -0
- package/dist/webcomponents/p-sXe3gn-5.js +1 -0
- package/dist/webcomponents/p-y-Ys7Rd-.js +1 -0
- package/dist/webcomponents/p-z1GJDdMW.js +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/package.json +6 -7
- package/dist/cjs/Api-83d93333.js +0 -118
- package/dist/cjs/billing-form_3.cjs.entry.js +0 -1733
- package/dist/cjs/index.esm-544c08fd.js +0 -2937
- package/dist/cjs/lodash-dbf6a6a4.js +0 -17206
- package/dist/cjs/package-5a9f02b2.js +0 -83
- package/dist/cjs/payment.service-537e049d.js +0 -23
- package/dist/cjs/terminals-list-params-state-236f06f6.js +0 -22
- package/dist/cjs/utils-4120664c.js +0 -4018
- package/dist/collection/components/checkout/billing-forms/billing-form/billing-form.js +0 -137
- package/dist/collection/components/checkout/billing-forms/billing-form-schema.js +0 -26
- package/dist/collection/components/checkout/billing-forms/billing-form-wrapper.js +0 -183
- package/dist/collection/components/checkout/billing-forms/postal-form/postal-form.js +0 -136
- package/dist/esm/Api-52242eb0.js +0 -116
- package/dist/esm/billing-form_3.entry.js +0 -1727
- package/dist/esm/index.esm-feedf26f.js +0 -2931
- package/dist/esm/lodash-faeb5a52.js +0 -17204
- package/dist/esm/package-c8466624.js +0 -81
- package/dist/esm/payment.service-af5bd8be.js +0 -21
- package/dist/esm/terminals-list-params-state-e4b2ec23.js +0 -16
- package/dist/esm/utils-ec50661e.js +0 -4001
- package/dist/loader/package.json +0 -11
- package/dist/module/billing-form-schema.js +0 -16
- package/dist/module/billing-form-wrapper.js +0 -114
- package/dist/module/billing-form2.js +0 -90
- package/dist/module/justifi-billing-form-wrapper.d.ts +0 -11
- package/dist/module/justifi-billing-form-wrapper.js +0 -6
- package/dist/module/postal-form.d.ts +0 -11
- package/dist/module/postal-form.js +0 -6
- package/dist/module/postal-form2.js +0 -83
- package/dist/types/components/checkout/billing-forms/billing-form-wrapper.d.ts +0 -19
- package/dist/types/components/checkout/billing-forms/postal-form/postal-form.d.ts +0 -20
- package/dist/webcomponents/p-01033194.js +0 -1
- package/dist/webcomponents/p-04d6b37e.entry.js +0 -1
- package/dist/webcomponents/p-092515e0.js +0 -1
- package/dist/webcomponents/p-0b61d4d3.entry.js +0 -1
- package/dist/webcomponents/p-0c7ec110.entry.js +0 -1
- package/dist/webcomponents/p-0f0020e1.entry.js +0 -1
- package/dist/webcomponents/p-0fa216eb.entry.js +0 -1
- package/dist/webcomponents/p-1361d8eb.entry.js +0 -1
- package/dist/webcomponents/p-13717638.entry.js +0 -1
- package/dist/webcomponents/p-142bfae3.js +0 -1
- package/dist/webcomponents/p-1cfa5df9.entry.js +0 -1
- package/dist/webcomponents/p-1ff8810b.js +0 -1
- package/dist/webcomponents/p-2123c150.js +0 -1
- package/dist/webcomponents/p-21def20b.entry.js +0 -1
- package/dist/webcomponents/p-23cd76af.entry.js +0 -1
- package/dist/webcomponents/p-25b82529.entry.js +0 -1
- package/dist/webcomponents/p-27546fa9.entry.js +0 -1
- package/dist/webcomponents/p-275c3dc9.js +0 -1
- package/dist/webcomponents/p-2783e363.js +0 -2
- package/dist/webcomponents/p-290fa30d.entry.js +0 -1
- package/dist/webcomponents/p-2a9d7f6b.js +0 -1
- package/dist/webcomponents/p-2aad7e3b.entry.js +0 -1
- package/dist/webcomponents/p-2b8aaa7d.entry.js +0 -1
- package/dist/webcomponents/p-3075b7e1.entry.js +0 -1
- package/dist/webcomponents/p-31dcaeaf.entry.js +0 -1
- package/dist/webcomponents/p-35c296fc.entry.js +0 -1
- package/dist/webcomponents/p-373a19fe.entry.js +0 -1
- package/dist/webcomponents/p-375657fe.entry.js +0 -1
- package/dist/webcomponents/p-3cc7527a.entry.js +0 -1
- package/dist/webcomponents/p-3cf317d3.entry.js +0 -1
- package/dist/webcomponents/p-407d6d29.entry.js +0 -1
- package/dist/webcomponents/p-4451de8d.entry.js +0 -1
- package/dist/webcomponents/p-4f7432c3.entry.js +0 -1
- package/dist/webcomponents/p-536497fe.entry.js +0 -1
- package/dist/webcomponents/p-536fb8e2.js +0 -1
- package/dist/webcomponents/p-537bce77.js +0 -1
- package/dist/webcomponents/p-54556fc6.js +0 -1
- package/dist/webcomponents/p-56c7fc8d.js +0 -1
- package/dist/webcomponents/p-58ee6ce9.js +0 -1
- package/dist/webcomponents/p-5a541d35.js +0 -1
- package/dist/webcomponents/p-5a9d7ca0.entry.js +0 -1
- package/dist/webcomponents/p-5b76dbe1.entry.js +0 -1
- package/dist/webcomponents/p-5f6b4bc9.js +0 -1
- package/dist/webcomponents/p-645db2cb.entry.js +0 -1
- package/dist/webcomponents/p-673c1bca.js +0 -1
- package/dist/webcomponents/p-753d983c.entry.js +0 -1
- package/dist/webcomponents/p-76549a24.js +0 -1
- package/dist/webcomponents/p-7d85af5c.js +0 -1
- package/dist/webcomponents/p-7e8732f7.entry.js +0 -1
- package/dist/webcomponents/p-81a6c3e2.entry.js +0 -1
- package/dist/webcomponents/p-829480e7.entry.js +0 -1
- package/dist/webcomponents/p-86605101.js +0 -1
- package/dist/webcomponents/p-87a4fb5b.js +0 -1
- package/dist/webcomponents/p-927cb6df.js +0 -1
- package/dist/webcomponents/p-94e4f1f1.entry.js +0 -1
- package/dist/webcomponents/p-96c23cda.entry.js +0 -1
- package/dist/webcomponents/p-9a9732e1.js +0 -1
- package/dist/webcomponents/p-9fecad5a.js +0 -1
- package/dist/webcomponents/p-a3cced75.entry.js +0 -1
- package/dist/webcomponents/p-a5f5cc2e.entry.js +0 -1
- package/dist/webcomponents/p-a8c69f51.entry.js +0 -1
- package/dist/webcomponents/p-ab45511e.js +0 -1
- package/dist/webcomponents/p-ad713ab6.entry.js +0 -1
- package/dist/webcomponents/p-adecb91a.entry.js +0 -1
- package/dist/webcomponents/p-ae7edce5.js +0 -1
- package/dist/webcomponents/p-ae891abb.entry.js +0 -1
- package/dist/webcomponents/p-af3315b5.entry.js +0 -1
- package/dist/webcomponents/p-b218af87.entry.js +0 -1
- package/dist/webcomponents/p-b50ca848.entry.js +0 -1
- package/dist/webcomponents/p-b84ee6d8.js +0 -1
- package/dist/webcomponents/p-b8664571.entry.js +0 -1
- package/dist/webcomponents/p-bb4b3f79.entry.js +0 -1
- package/dist/webcomponents/p-beec0b60.js +0 -1
- package/dist/webcomponents/p-bf12999f.js +0 -1
- package/dist/webcomponents/p-bf195b35.js +0 -1
- package/dist/webcomponents/p-bfc2d88a.js +0 -1
- package/dist/webcomponents/p-c6be72b0.js +0 -10
- package/dist/webcomponents/p-c8b78136.js +0 -1
- package/dist/webcomponents/p-cbad44b7.js +0 -1
- package/dist/webcomponents/p-cc2f75a3.entry.js +0 -1
- package/dist/webcomponents/p-ccb9ee53.js +0 -1
- package/dist/webcomponents/p-cd93c62b.entry.js +0 -19
- package/dist/webcomponents/p-d757fcf5.js +0 -1
- package/dist/webcomponents/p-dbc1a95b.js +0 -1
- package/dist/webcomponents/p-dd2938d3.entry.js +0 -1
- package/dist/webcomponents/p-de03d0f8.js +0 -1
- package/dist/webcomponents/p-dec18cc4.js +0 -1
- package/dist/webcomponents/p-e1ae5e80.entry.js +0 -1
- package/dist/webcomponents/p-e3855f51.entry.js +0 -1
- package/dist/webcomponents/p-e73be1b9.entry.js +0 -1
- package/dist/webcomponents/p-e9867f8b.entry.js +0 -1
- package/dist/webcomponents/p-ef1db3da.entry.js +0 -1
- package/dist/webcomponents/p-f13b2991.entry.js +0 -1
- package/dist/webcomponents/p-f20466f7.entry.js +0 -1
- package/dist/webcomponents/p-f20b6ce1.js +0 -1
- package/dist/webcomponents/p-f4739d31.js +0 -1
- package/dist/webcomponents/p-f4aeb100.js +0 -1
- package/dist/webcomponents/p-f8fccf44.js +0 -1
- package/dist/webcomponents/p-f930504f.entry.js +0 -1
- package/dist/webcomponents/p-faa35b47.entry.js +0 -1
- package/dist/webcomponents/p-fb2db8da.entry.js +0 -1
- package/dist/webcomponents/p-fca89e9b.entry.js +0 -1
- /package/dist/cjs/{Dispute-eb6bad54.js → Dispute-CruQTF6_.js} +0 -0
- /package/dist/cjs/{Document-0b828345.js → Document-rXGBUaOh.js} +0 -0
- /package/dist/cjs/{Pagination-0da8f095.js → Pagination-Dediz133.js} +0 -0
- /package/dist/cjs/{app-globals-3a1e7e63.js → app-globals-V2Kpy_OQ.js} +0 -0
- /package/dist/cjs/{event-types-8edaabbb.js → event-types-BWQT2lwu.js} +0 -0
- /package/dist/cjs/{event-types-180a85a9.js → event-types-DNOUef41.js} +0 -0
- /package/dist/cjs/{form-input-masks-0879c139.js → form-input-masks-DgXd0f4V.js} +0 -0
- /package/dist/cjs/{state-options-4fbcb48a.js → state-options-CIT9xdTz.js} +0 -0
- /package/dist/cjs/{utils-bc03ca40.js → utils-DAyWinG2.js} +0 -0
- /package/dist/esm/{Dispute-5fd28ec9.js → Dispute-7MWRbTXI.js} +0 -0
- /package/dist/esm/{Pagination-afc8f96d.js → Pagination-CLHwhyvu.js} +0 -0
- /package/dist/esm/{app-globals-0f993ce5.js → app-globals-DQuL1Twl.js} +0 -0
- /package/dist/esm/{event-types-07cdb9a0.js → event-types-Bg2SZArf.js} +0 -0
- /package/dist/esm/{event-types-5c87de02.js → event-types-XYgDHrVL.js} +0 -0
- /package/dist/esm/{form-input-masks-0e18300f.js → form-input-masks-B-iV5cYd.js} +0 -0
- /package/dist/esm/{state-options-a356fb11.js → state-options-BX8GieXu.js} +0 -0
- /package/dist/esm/{utils-20cdf321.js → utils-BnjCmwMr.js} +0 -0
- /package/dist/webcomponents/{p-abdbcd8e.js → p-7MWRbTXI.js} +0 -0
- /package/dist/webcomponents/{p-525db3e8.js → p-B-iV5cYd.js} +0 -0
- /package/dist/webcomponents/{p-6078a370.js → p-BX8GieXu.js} +0 -0
- /package/dist/webcomponents/{p-667ebd79.js → p-Bg2SZArf.js} +0 -0
- /package/dist/webcomponents/{p-e3c22aa9.js → p-BnjCmwMr.js} +0 -0
- /package/dist/webcomponents/{p-56f6ce4c.js → p-CLHwhyvu.js} +0 -0
- /package/dist/webcomponents/{p-1ad5995e.js → p-Ce_F4E0f.js} +0 -0
- /package/dist/webcomponents/{p-e1255160.js → p-DQuL1Twl.js} +0 -0
- /package/dist/webcomponents/{p-73f9be7c.js → p-XYgDHrVL.js} +0 -0
|
@@ -0,0 +1,1638 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host, g as getElement } from './index-BUM1DfV9.js';
|
|
2
|
+
import { g as getDefaultExportFromCjs } from './_commonjsHelpers-BFTU3MAI.js';
|
|
3
|
+
import { F as FormControlErrorText } from './form-control-error-text-3q5yVuMQ.js';
|
|
4
|
+
import { p as packageJson } from './package-gAO-RwrF.js';
|
|
5
|
+
import { i as iframeInputStyles } from './iframe-input-styles-state-DyXIZw1A.js';
|
|
6
|
+
import { i as inputInvalidAndFocused, b as inputInvalid, a as inputFocused, c as input, l as label } from './parts-CB88j97I.js';
|
|
7
|
+
import './index-Cuk6aIda.js';
|
|
8
|
+
|
|
9
|
+
var iframeResizer = {exports: {}};
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* File: iframeResizer.js
|
|
13
|
+
* Desc: Force iframes to size to content.
|
|
14
|
+
* Requires: iframeResizer.contentWindow.js to be loaded into the target frame.
|
|
15
|
+
* Doc: https://iframe-resizer.com
|
|
16
|
+
* Author: David J. Bradshaw - info@iframe-resizer.com
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
var hasRequiredIframeResizer;
|
|
20
|
+
|
|
21
|
+
function requireIframeResizer () {
|
|
22
|
+
if (hasRequiredIframeResizer) return iframeResizer.exports;
|
|
23
|
+
hasRequiredIframeResizer = 1;
|
|
24
|
+
(function (module) {
|
|
25
|
+
console.info(`
|
|
26
|
+
IFRAME-RESIZER
|
|
27
|
+
|
|
28
|
+
Iframe-Resizer 5 is now available via the following two packages:
|
|
29
|
+
|
|
30
|
+
* @iframe-resizer/parent
|
|
31
|
+
* @iframe-resizer/child
|
|
32
|
+
|
|
33
|
+
Additionally their are also new versions of iframe-resizer for React, Vue, and jQuery.
|
|
34
|
+
|
|
35
|
+
Version 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.
|
|
36
|
+
|
|
37
|
+
Please see https://iframe-resizer.com/upgrade for more details.
|
|
38
|
+
`)
|
|
39
|
+
|
|
40
|
+
// eslint-disable-next-line sonarjs/cognitive-complexity, no-shadow-restricted-names
|
|
41
|
+
;(function (undefined$1) {
|
|
42
|
+
if (typeof window === 'undefined') return // don't run for server side render
|
|
43
|
+
|
|
44
|
+
// var VERSION = '4.3.11'
|
|
45
|
+
|
|
46
|
+
var count = 0,
|
|
47
|
+
destroyObserver,
|
|
48
|
+
logEnabled = false,
|
|
49
|
+
hiddenCheckEnabled = false,
|
|
50
|
+
msgHeader = 'message',
|
|
51
|
+
msgHeaderLen = msgHeader.length,
|
|
52
|
+
msgId = '[iFrameSizer]', // Must match iframe msg ID
|
|
53
|
+
msgIdLen = msgId.length,
|
|
54
|
+
pagePosition = null,
|
|
55
|
+
requestAnimationFrame = window.requestAnimationFrame,
|
|
56
|
+
resetRequiredMethods = Object.freeze({
|
|
57
|
+
max: 1,
|
|
58
|
+
scroll: 1,
|
|
59
|
+
bodyScroll: 1,
|
|
60
|
+
documentElementScroll: 1
|
|
61
|
+
}),
|
|
62
|
+
settings = {},
|
|
63
|
+
timer = null,
|
|
64
|
+
defaults = Object.freeze({
|
|
65
|
+
autoResize: true,
|
|
66
|
+
bodyBackground: null,
|
|
67
|
+
bodyMargin: null,
|
|
68
|
+
bodyMarginV1: 8,
|
|
69
|
+
bodyPadding: null,
|
|
70
|
+
checkOrigin: true,
|
|
71
|
+
inPageLinks: false,
|
|
72
|
+
enablePublicMethods: true,
|
|
73
|
+
heightCalculationMethod: 'bodyOffset',
|
|
74
|
+
id: 'iFrameResizer',
|
|
75
|
+
interval: 32,
|
|
76
|
+
license: '1jqr0si6pnt',
|
|
77
|
+
log: false,
|
|
78
|
+
maxHeight: Infinity,
|
|
79
|
+
maxWidth: Infinity,
|
|
80
|
+
minHeight: 0,
|
|
81
|
+
minWidth: 0,
|
|
82
|
+
mouseEvents: true,
|
|
83
|
+
resizeFrom: 'parent',
|
|
84
|
+
scrolling: false,
|
|
85
|
+
sizeHeight: true,
|
|
86
|
+
sizeWidth: false,
|
|
87
|
+
warningTimeout: 5000,
|
|
88
|
+
tolerance: 0,
|
|
89
|
+
widthCalculationMethod: 'scroll',
|
|
90
|
+
onClose: function () {
|
|
91
|
+
return true
|
|
92
|
+
},
|
|
93
|
+
onClosed: function () {},
|
|
94
|
+
onInit: function () {},
|
|
95
|
+
onMessage: function () {
|
|
96
|
+
warn('onMessage function not defined');
|
|
97
|
+
},
|
|
98
|
+
onMouseEnter: function () {},
|
|
99
|
+
onMouseLeave: function () {},
|
|
100
|
+
onResized: function () {},
|
|
101
|
+
onScroll: function () {
|
|
102
|
+
return true
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
function getMutationObserver() {
|
|
107
|
+
return (
|
|
108
|
+
window.MutationObserver ||
|
|
109
|
+
window.WebKitMutationObserver ||
|
|
110
|
+
window.MozMutationObserver
|
|
111
|
+
)
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function addEventListener(el, evt, func) {
|
|
115
|
+
el.addEventListener(evt, func, false);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function removeEventListener(el, evt, func) {
|
|
119
|
+
el.removeEventListener(evt, func, false);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function setupRequestAnimationFrame() {
|
|
123
|
+
var vendors = ['moz', 'webkit', 'o', 'ms'];
|
|
124
|
+
var x;
|
|
125
|
+
|
|
126
|
+
// Remove vendor prefixing if prefixed and break early if not
|
|
127
|
+
for (x = 0; x < vendors.length && !requestAnimationFrame; x += 1) {
|
|
128
|
+
requestAnimationFrame = window[vendors[x] + 'RequestAnimationFrame'];
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
if (requestAnimationFrame) {
|
|
132
|
+
// Firefox extension content-scripts have a globalThis object that is not the same as window.
|
|
133
|
+
// Binding `requestAnimationFrame` to window allows the function to work and prevents errors
|
|
134
|
+
// being thrown when run in that context, and should be a no-op in every other context.
|
|
135
|
+
requestAnimationFrame = requestAnimationFrame.bind(window);
|
|
136
|
+
} else {
|
|
137
|
+
log('setup', 'RequestAnimationFrame not supported');
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function getMyID(iframeId) {
|
|
142
|
+
var retStr = 'Host page: ' + iframeId;
|
|
143
|
+
|
|
144
|
+
if (window.top !== window.self) {
|
|
145
|
+
retStr =
|
|
146
|
+
window.parentIFrame && window.parentIFrame.getId
|
|
147
|
+
? window.parentIFrame.getId() + ': ' + iframeId
|
|
148
|
+
: 'Nested host page: ' + iframeId;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return retStr
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function formatLogHeader(iframeId) {
|
|
155
|
+
return msgId + '[' + getMyID(iframeId) + ']'
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
function isLogEnabled(iframeId) {
|
|
159
|
+
return settings[iframeId] ? settings[iframeId].log : logEnabled
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
function log(iframeId, msg) {
|
|
163
|
+
output('log', iframeId, msg, isLogEnabled(iframeId));
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
function info(iframeId, msg) {
|
|
167
|
+
output('info', iframeId, msg, isLogEnabled(iframeId));
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
function warn(iframeId, msg) {
|
|
171
|
+
output('warn', iframeId, msg, true);
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
function output(type, iframeId, msg, enabled) {
|
|
175
|
+
if (true === enabled && 'object' === typeof window.console) {
|
|
176
|
+
// eslint-disable-next-line no-console
|
|
177
|
+
console[type](formatLogHeader(iframeId), msg);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
function iFrameListener(event) {
|
|
182
|
+
function resizeIFrame() {
|
|
183
|
+
function resize() {
|
|
184
|
+
setSize(messageData);
|
|
185
|
+
setPagePosition(iframeId);
|
|
186
|
+
on('onResized', messageData);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
ensureInRange('Height');
|
|
190
|
+
ensureInRange('Width');
|
|
191
|
+
|
|
192
|
+
syncResize(resize, messageData, 'init');
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
function processMsg() {
|
|
196
|
+
var data = msg.slice(msgIdLen).split(':');
|
|
197
|
+
var height = data[1] ? parseInt(data[1], 10) : 0;
|
|
198
|
+
var iframe = settings[data[0]] && settings[data[0]].iframe;
|
|
199
|
+
var compStyle = getComputedStyle(iframe);
|
|
200
|
+
|
|
201
|
+
return {
|
|
202
|
+
iframe: iframe,
|
|
203
|
+
id: data[0],
|
|
204
|
+
height: height + getPaddingEnds(compStyle) + getBorderEnds(compStyle),
|
|
205
|
+
width: data[2],
|
|
206
|
+
type: data[3]
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function getPaddingEnds(compStyle) {
|
|
211
|
+
if (compStyle.boxSizing !== 'border-box') {
|
|
212
|
+
return 0
|
|
213
|
+
}
|
|
214
|
+
var top = compStyle.paddingTop ? parseInt(compStyle.paddingTop, 10) : 0;
|
|
215
|
+
var bot = compStyle.paddingBottom
|
|
216
|
+
? parseInt(compStyle.paddingBottom, 10)
|
|
217
|
+
: 0;
|
|
218
|
+
return top + bot
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function getBorderEnds(compStyle) {
|
|
222
|
+
if (compStyle.boxSizing !== 'border-box') {
|
|
223
|
+
return 0
|
|
224
|
+
}
|
|
225
|
+
var top = compStyle.borderTopWidth
|
|
226
|
+
? parseInt(compStyle.borderTopWidth, 10)
|
|
227
|
+
: 0;
|
|
228
|
+
var bot = compStyle.borderBottomWidth
|
|
229
|
+
? parseInt(compStyle.borderBottomWidth, 10)
|
|
230
|
+
: 0;
|
|
231
|
+
return top + bot
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function ensureInRange(Dimension) {
|
|
235
|
+
var max = Number(settings[iframeId]['max' + Dimension]),
|
|
236
|
+
min = Number(settings[iframeId]['min' + Dimension]),
|
|
237
|
+
dimension = Dimension.toLowerCase(),
|
|
238
|
+
size = Number(messageData[dimension]);
|
|
239
|
+
|
|
240
|
+
log(iframeId, 'Checking ' + dimension + ' is in range ' + min + '-' + max);
|
|
241
|
+
|
|
242
|
+
if (size < min) {
|
|
243
|
+
size = min;
|
|
244
|
+
log(iframeId, 'Set ' + dimension + ' to min value');
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
if (size > max) {
|
|
248
|
+
size = max;
|
|
249
|
+
log(iframeId, 'Set ' + dimension + ' to max value');
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
messageData[dimension] = '' + size;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
function isMessageFromIFrame() {
|
|
256
|
+
function checkAllowedOrigin() {
|
|
257
|
+
function checkList() {
|
|
258
|
+
var i = 0,
|
|
259
|
+
retCode = false;
|
|
260
|
+
|
|
261
|
+
log(
|
|
262
|
+
iframeId,
|
|
263
|
+
'Checking connection is from allowed list of origins: ' +
|
|
264
|
+
checkOrigin
|
|
265
|
+
);
|
|
266
|
+
|
|
267
|
+
for (; i < checkOrigin.length; i++) {
|
|
268
|
+
if (checkOrigin[i] === origin) {
|
|
269
|
+
retCode = true;
|
|
270
|
+
break
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return retCode
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
function checkSingle() {
|
|
277
|
+
var remoteHost = settings[iframeId] && settings[iframeId].remoteHost;
|
|
278
|
+
log(iframeId, 'Checking connection is from: ' + remoteHost);
|
|
279
|
+
return origin === remoteHost
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
return checkOrigin.constructor === Array ? checkList() : checkSingle()
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
var origin = event.origin,
|
|
286
|
+
checkOrigin = settings[iframeId] && settings[iframeId].checkOrigin;
|
|
287
|
+
|
|
288
|
+
if (checkOrigin && '' + origin !== 'null' && !checkAllowedOrigin()) {
|
|
289
|
+
throw new Error(
|
|
290
|
+
'Unexpected message received from: ' +
|
|
291
|
+
origin +
|
|
292
|
+
' for ' +
|
|
293
|
+
messageData.iframe.id +
|
|
294
|
+
'. Message was: ' +
|
|
295
|
+
event.data +
|
|
296
|
+
'. This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.'
|
|
297
|
+
)
|
|
298
|
+
}
|
|
299
|
+
|
|
300
|
+
return true
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function isMessageForUs() {
|
|
304
|
+
return (
|
|
305
|
+
msgId === ('' + msg).slice(0, msgIdLen) &&
|
|
306
|
+
msg.slice(msgIdLen).split(':')[0] in settings
|
|
307
|
+
) // ''+Protects against non-string msg
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
function isMessageFromMetaParent() {
|
|
311
|
+
// Test if this message is from a parent above us. This is an ugly test, however, updating
|
|
312
|
+
// the message format would break backwards compatibility.
|
|
313
|
+
var retCode = messageData.type in { true: 1, false: 1, undefined: 1 };
|
|
314
|
+
|
|
315
|
+
if (retCode) {
|
|
316
|
+
log(iframeId, 'Ignoring init message from meta parent page');
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
return retCode
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
function getMsgBody(offset) {
|
|
323
|
+
return msg.slice(msg.indexOf(':') + msgHeaderLen + offset)
|
|
324
|
+
}
|
|
325
|
+
|
|
326
|
+
function forwardMsgFromIFrame(msgBody) {
|
|
327
|
+
log(
|
|
328
|
+
iframeId,
|
|
329
|
+
'onMessage passed: {iframe: ' +
|
|
330
|
+
messageData.iframe.id +
|
|
331
|
+
', message: ' +
|
|
332
|
+
msgBody +
|
|
333
|
+
'}'
|
|
334
|
+
);
|
|
335
|
+
|
|
336
|
+
on('onMessage', {
|
|
337
|
+
iframe: messageData.iframe,
|
|
338
|
+
message: JSON.parse(msgBody)
|
|
339
|
+
});
|
|
340
|
+
|
|
341
|
+
log(iframeId, '--');
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
function getPageInfo() {
|
|
345
|
+
var bodyPosition = document.body.getBoundingClientRect(),
|
|
346
|
+
iFramePosition = messageData.iframe.getBoundingClientRect();
|
|
347
|
+
|
|
348
|
+
return JSON.stringify({
|
|
349
|
+
iframeHeight: iFramePosition.height,
|
|
350
|
+
iframeWidth: iFramePosition.width,
|
|
351
|
+
clientHeight: Math.max(
|
|
352
|
+
document.documentElement.clientHeight,
|
|
353
|
+
window.innerHeight || 0
|
|
354
|
+
),
|
|
355
|
+
clientWidth: Math.max(
|
|
356
|
+
document.documentElement.clientWidth,
|
|
357
|
+
window.innerWidth || 0
|
|
358
|
+
),
|
|
359
|
+
offsetTop: parseInt(iFramePosition.top - bodyPosition.top, 10),
|
|
360
|
+
offsetLeft: parseInt(iFramePosition.left - bodyPosition.left, 10),
|
|
361
|
+
scrollTop: window.pageYOffset,
|
|
362
|
+
scrollLeft: window.pageXOffset,
|
|
363
|
+
documentHeight: document.documentElement.clientHeight,
|
|
364
|
+
documentWidth: document.documentElement.clientWidth,
|
|
365
|
+
windowHeight: window.innerHeight,
|
|
366
|
+
windowWidth: window.innerWidth
|
|
367
|
+
})
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
function sendPageInfoToIframe(iframe, iframeId) {
|
|
371
|
+
function debouncedTrigger() {
|
|
372
|
+
trigger('Send Page Info', 'pageInfo:' + getPageInfo(), iframe, iframeId);
|
|
373
|
+
}
|
|
374
|
+
debounceFrameEvents(debouncedTrigger, 32, iframeId);
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
function startPageInfoMonitor() {
|
|
378
|
+
function setListener(type, func) {
|
|
379
|
+
function sendPageInfo() {
|
|
380
|
+
if (settings[id]) {
|
|
381
|
+
sendPageInfoToIframe(settings[id].iframe, id);
|
|
382
|
+
} else {
|
|
383
|
+
stop();
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
['scroll', 'resize'].forEach(function (evt) {
|
|
387
|
+
log(id, type + evt + ' listener for sendPageInfo');
|
|
388
|
+
func(window, evt, sendPageInfo);
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
function stop() {
|
|
393
|
+
setListener('Remove ', removeEventListener);
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
function start() {
|
|
397
|
+
setListener('Add ', addEventListener);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
var id = iframeId; // Create locally scoped copy of iFrame ID
|
|
401
|
+
|
|
402
|
+
start();
|
|
403
|
+
|
|
404
|
+
if (settings[id]) {
|
|
405
|
+
settings[id].stopPageInfo = stop;
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
function stopPageInfoMonitor() {
|
|
410
|
+
if (settings[iframeId] && settings[iframeId].stopPageInfo) {
|
|
411
|
+
settings[iframeId].stopPageInfo();
|
|
412
|
+
delete settings[iframeId].stopPageInfo;
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function checkIFrameExists() {
|
|
417
|
+
var retBool = true;
|
|
418
|
+
|
|
419
|
+
if (null === messageData.iframe) {
|
|
420
|
+
warn(iframeId, 'IFrame (' + messageData.id + ') not found');
|
|
421
|
+
retBool = false;
|
|
422
|
+
}
|
|
423
|
+
return retBool
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
function getElementPosition(target) {
|
|
427
|
+
var iFramePosition = target.getBoundingClientRect();
|
|
428
|
+
|
|
429
|
+
getPagePosition(iframeId);
|
|
430
|
+
|
|
431
|
+
return {
|
|
432
|
+
x: Math.floor(Number(iFramePosition.left) + Number(pagePosition.x)),
|
|
433
|
+
y: Math.floor(Number(iFramePosition.top) + Number(pagePosition.y))
|
|
434
|
+
}
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
function scrollRequestFromChild(addOffset) {
|
|
438
|
+
/* istanbul ignore next */ // Not testable in Karma
|
|
439
|
+
function reposition() {
|
|
440
|
+
pagePosition = newPosition;
|
|
441
|
+
scrollTo();
|
|
442
|
+
log(iframeId, '--');
|
|
443
|
+
}
|
|
444
|
+
|
|
445
|
+
function calcOffset() {
|
|
446
|
+
return {
|
|
447
|
+
x: Number(messageData.width) + offset.x,
|
|
448
|
+
y: Number(messageData.height) + offset.y
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
function scrollParent() {
|
|
453
|
+
if (window.parentIFrame) {
|
|
454
|
+
window.parentIFrame['scrollTo' + (addOffset ? 'Offset' : '')](
|
|
455
|
+
newPosition.x,
|
|
456
|
+
newPosition.y
|
|
457
|
+
);
|
|
458
|
+
} else {
|
|
459
|
+
warn(
|
|
460
|
+
iframeId,
|
|
461
|
+
'Unable to scroll to requested position, window.parentIFrame not found'
|
|
462
|
+
);
|
|
463
|
+
}
|
|
464
|
+
}
|
|
465
|
+
|
|
466
|
+
var offset = addOffset
|
|
467
|
+
? getElementPosition(messageData.iframe)
|
|
468
|
+
: { x: 0, y: 0 },
|
|
469
|
+
newPosition = calcOffset();
|
|
470
|
+
|
|
471
|
+
log(
|
|
472
|
+
iframeId,
|
|
473
|
+
'Reposition requested from iFrame (offset x:' +
|
|
474
|
+
offset.x +
|
|
475
|
+
' y:' +
|
|
476
|
+
offset.y +
|
|
477
|
+
')'
|
|
478
|
+
);
|
|
479
|
+
|
|
480
|
+
if (window.top === window.self) {
|
|
481
|
+
reposition();
|
|
482
|
+
} else {
|
|
483
|
+
scrollParent();
|
|
484
|
+
}
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
function scrollTo() {
|
|
488
|
+
if (false === on('onScroll', pagePosition)) {
|
|
489
|
+
unsetPagePosition();
|
|
490
|
+
} else {
|
|
491
|
+
setPagePosition(iframeId);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
function findTarget(location) {
|
|
496
|
+
function jumpToTarget() {
|
|
497
|
+
var jumpPosition = getElementPosition(target);
|
|
498
|
+
|
|
499
|
+
log(
|
|
500
|
+
iframeId,
|
|
501
|
+
'Moving to in page link (#' +
|
|
502
|
+
hash +
|
|
503
|
+
') at x: ' +
|
|
504
|
+
jumpPosition.x +
|
|
505
|
+
' y: ' +
|
|
506
|
+
jumpPosition.y
|
|
507
|
+
);
|
|
508
|
+
pagePosition = {
|
|
509
|
+
x: jumpPosition.x,
|
|
510
|
+
y: jumpPosition.y
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
scrollTo();
|
|
514
|
+
log(iframeId, '--');
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
function jumpToParent() {
|
|
518
|
+
if (window.parentIFrame) {
|
|
519
|
+
window.parentIFrame.moveToAnchor(hash);
|
|
520
|
+
} else {
|
|
521
|
+
log(
|
|
522
|
+
iframeId,
|
|
523
|
+
'In page link #' +
|
|
524
|
+
hash +
|
|
525
|
+
' not found and window.parentIFrame not found'
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
var hash = location.split('#')[1] || '',
|
|
531
|
+
hashData = decodeURIComponent(hash),
|
|
532
|
+
target =
|
|
533
|
+
document.getElementById(hashData) ||
|
|
534
|
+
document.getElementsByName(hashData)[0];
|
|
535
|
+
|
|
536
|
+
if (target) {
|
|
537
|
+
jumpToTarget();
|
|
538
|
+
} else if (window.top === window.self) {
|
|
539
|
+
log(iframeId, 'In page link #' + hash + ' not found');
|
|
540
|
+
} else {
|
|
541
|
+
jumpToParent();
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
function onMouse(event) {
|
|
546
|
+
var mousePos = {};
|
|
547
|
+
|
|
548
|
+
if (Number(messageData.width) === 0 && Number(messageData.height) === 0) {
|
|
549
|
+
var data = getMsgBody(9).split(':');
|
|
550
|
+
mousePos = {
|
|
551
|
+
x: data[1],
|
|
552
|
+
y: data[0]
|
|
553
|
+
};
|
|
554
|
+
} else {
|
|
555
|
+
mousePos = {
|
|
556
|
+
x: messageData.width,
|
|
557
|
+
y: messageData.height
|
|
558
|
+
};
|
|
559
|
+
}
|
|
560
|
+
|
|
561
|
+
on(event, {
|
|
562
|
+
iframe: messageData.iframe,
|
|
563
|
+
screenX: Number(mousePos.x),
|
|
564
|
+
screenY: Number(mousePos.y),
|
|
565
|
+
type: messageData.type
|
|
566
|
+
});
|
|
567
|
+
}
|
|
568
|
+
|
|
569
|
+
function on(funcName, val) {
|
|
570
|
+
return chkEvent(iframeId, funcName, val)
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
function actionMsg() {
|
|
574
|
+
if (settings[iframeId] && settings[iframeId].firstRun) firstRun();
|
|
575
|
+
|
|
576
|
+
switch (messageData.type) {
|
|
577
|
+
case 'close': {
|
|
578
|
+
closeIFrame(messageData.iframe);
|
|
579
|
+
break
|
|
580
|
+
}
|
|
581
|
+
|
|
582
|
+
case 'message': {
|
|
583
|
+
forwardMsgFromIFrame(getMsgBody(6));
|
|
584
|
+
break
|
|
585
|
+
}
|
|
586
|
+
|
|
587
|
+
case 'mouseenter': {
|
|
588
|
+
onMouse('onMouseEnter');
|
|
589
|
+
break
|
|
590
|
+
}
|
|
591
|
+
|
|
592
|
+
case 'mouseleave': {
|
|
593
|
+
onMouse('onMouseLeave');
|
|
594
|
+
break
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
case 'autoResize': {
|
|
598
|
+
settings[iframeId].autoResize = JSON.parse(getMsgBody(9));
|
|
599
|
+
break
|
|
600
|
+
}
|
|
601
|
+
|
|
602
|
+
case 'scrollTo': {
|
|
603
|
+
scrollRequestFromChild(false);
|
|
604
|
+
break
|
|
605
|
+
}
|
|
606
|
+
|
|
607
|
+
case 'scrollToOffset': {
|
|
608
|
+
scrollRequestFromChild(true);
|
|
609
|
+
break
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
case 'pageInfo': {
|
|
613
|
+
sendPageInfoToIframe(
|
|
614
|
+
settings[iframeId] && settings[iframeId].iframe,
|
|
615
|
+
iframeId
|
|
616
|
+
);
|
|
617
|
+
startPageInfoMonitor();
|
|
618
|
+
break
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
case 'pageInfoStop': {
|
|
622
|
+
stopPageInfoMonitor();
|
|
623
|
+
break
|
|
624
|
+
}
|
|
625
|
+
|
|
626
|
+
case 'inPageLink': {
|
|
627
|
+
findTarget(getMsgBody(9));
|
|
628
|
+
break
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
case 'reset': {
|
|
632
|
+
resetIFrame(messageData);
|
|
633
|
+
break
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
case 'init': {
|
|
637
|
+
resizeIFrame();
|
|
638
|
+
on('onInit', messageData.iframe);
|
|
639
|
+
break
|
|
640
|
+
}
|
|
641
|
+
|
|
642
|
+
default: {
|
|
643
|
+
if (
|
|
644
|
+
Number(messageData.width) === 0 &&
|
|
645
|
+
Number(messageData.height) === 0
|
|
646
|
+
) {
|
|
647
|
+
warn(
|
|
648
|
+
'Unsupported message received (' +
|
|
649
|
+
messageData.type +
|
|
650
|
+
'), this is likely due to the iframe containing a later ' +
|
|
651
|
+
'version of iframe-resizer than the parent page'
|
|
652
|
+
);
|
|
653
|
+
} else {
|
|
654
|
+
resizeIFrame();
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
function hasSettings(iframeId) {
|
|
661
|
+
var retBool = true;
|
|
662
|
+
|
|
663
|
+
if (!settings[iframeId]) {
|
|
664
|
+
retBool = false;
|
|
665
|
+
warn(
|
|
666
|
+
messageData.type +
|
|
667
|
+
' No settings for ' +
|
|
668
|
+
iframeId +
|
|
669
|
+
'. Message was: ' +
|
|
670
|
+
msg
|
|
671
|
+
);
|
|
672
|
+
}
|
|
673
|
+
|
|
674
|
+
return retBool
|
|
675
|
+
}
|
|
676
|
+
|
|
677
|
+
function iFrameReadyMsgReceived() {
|
|
678
|
+
// eslint-disable-next-line no-restricted-syntax, guard-for-in
|
|
679
|
+
for (var iframeId in settings) {
|
|
680
|
+
trigger(
|
|
681
|
+
'iFrame requested init',
|
|
682
|
+
createOutgoingMsg(iframeId),
|
|
683
|
+
settings[iframeId].iframe,
|
|
684
|
+
iframeId
|
|
685
|
+
);
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
function firstRun() {
|
|
690
|
+
if (settings[iframeId]) {
|
|
691
|
+
settings[iframeId].firstRun = false;
|
|
692
|
+
}
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
var msg = event.data,
|
|
696
|
+
messageData = {},
|
|
697
|
+
iframeId = null;
|
|
698
|
+
|
|
699
|
+
if ('[iFrameResizerChild]Ready' === msg) {
|
|
700
|
+
iFrameReadyMsgReceived();
|
|
701
|
+
} else if (isMessageForUs()) {
|
|
702
|
+
messageData = processMsg();
|
|
703
|
+
iframeId = messageData.id;
|
|
704
|
+
if (settings[iframeId]) {
|
|
705
|
+
settings[iframeId].loaded = true;
|
|
706
|
+
}
|
|
707
|
+
|
|
708
|
+
if (!isMessageFromMetaParent() && hasSettings(iframeId)) {
|
|
709
|
+
log(iframeId, 'Received: ' + msg);
|
|
710
|
+
|
|
711
|
+
if (checkIFrameExists() && isMessageFromIFrame()) {
|
|
712
|
+
actionMsg();
|
|
713
|
+
}
|
|
714
|
+
}
|
|
715
|
+
} else {
|
|
716
|
+
info(iframeId, 'Ignored: ' + msg);
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
function chkEvent(iframeId, funcName, val) {
|
|
721
|
+
var func = null,
|
|
722
|
+
retVal = null;
|
|
723
|
+
|
|
724
|
+
if (settings[iframeId]) {
|
|
725
|
+
func = settings[iframeId][funcName];
|
|
726
|
+
|
|
727
|
+
if ('function' === typeof func) {
|
|
728
|
+
retVal = func(val);
|
|
729
|
+
} else {
|
|
730
|
+
throw new TypeError(
|
|
731
|
+
funcName + ' on iFrame[' + iframeId + '] is not a function'
|
|
732
|
+
)
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
return retVal
|
|
737
|
+
}
|
|
738
|
+
|
|
739
|
+
function removeIframeListeners(iframe) {
|
|
740
|
+
var iframeId = iframe.id;
|
|
741
|
+
delete settings[iframeId];
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
function closeIFrame(iframe) {
|
|
745
|
+
var iframeId = iframe.id;
|
|
746
|
+
if (chkEvent(iframeId, 'onClose', iframeId) === false) {
|
|
747
|
+
log(iframeId, 'Close iframe cancelled by onClose event');
|
|
748
|
+
return
|
|
749
|
+
}
|
|
750
|
+
log(iframeId, 'Removing iFrame: ' + iframeId);
|
|
751
|
+
|
|
752
|
+
try {
|
|
753
|
+
// Catch race condition error with React
|
|
754
|
+
if (iframe.parentNode) {
|
|
755
|
+
iframe.parentNode.removeChild(iframe);
|
|
756
|
+
}
|
|
757
|
+
} catch (error) {
|
|
758
|
+
warn(error);
|
|
759
|
+
}
|
|
760
|
+
|
|
761
|
+
chkEvent(iframeId, 'onClosed', iframeId);
|
|
762
|
+
log(iframeId, '--');
|
|
763
|
+
removeIframeListeners(iframe);
|
|
764
|
+
if (destroyObserver) {
|
|
765
|
+
destroyObserver.disconnect();
|
|
766
|
+
destroyObserver = null;
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
|
|
770
|
+
function getPagePosition(iframeId) {
|
|
771
|
+
if (null === pagePosition) {
|
|
772
|
+
pagePosition = {
|
|
773
|
+
x:
|
|
774
|
+
window.pageXOffset === undefined$1
|
|
775
|
+
? document.documentElement.scrollLeft
|
|
776
|
+
: window.pageXOffset,
|
|
777
|
+
y:
|
|
778
|
+
window.pageYOffset === undefined$1
|
|
779
|
+
? document.documentElement.scrollTop
|
|
780
|
+
: window.pageYOffset
|
|
781
|
+
};
|
|
782
|
+
log(
|
|
783
|
+
iframeId,
|
|
784
|
+
'Get page position: ' + pagePosition.x + ',' + pagePosition.y
|
|
785
|
+
);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
|
|
789
|
+
function setPagePosition(iframeId) {
|
|
790
|
+
if (null !== pagePosition) {
|
|
791
|
+
window.scrollTo(pagePosition.x, pagePosition.y);
|
|
792
|
+
log(
|
|
793
|
+
iframeId,
|
|
794
|
+
'Set page position: ' + pagePosition.x + ',' + pagePosition.y
|
|
795
|
+
);
|
|
796
|
+
unsetPagePosition();
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
|
|
800
|
+
function unsetPagePosition() {
|
|
801
|
+
pagePosition = null;
|
|
802
|
+
}
|
|
803
|
+
|
|
804
|
+
function resetIFrame(messageData) {
|
|
805
|
+
function reset() {
|
|
806
|
+
setSize(messageData);
|
|
807
|
+
trigger('reset', 'reset', messageData.iframe, messageData.id);
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
log(
|
|
811
|
+
messageData.id,
|
|
812
|
+
'Size reset requested by ' +
|
|
813
|
+
('init' === messageData.type ? 'host page' : 'iFrame')
|
|
814
|
+
);
|
|
815
|
+
getPagePosition(messageData.id);
|
|
816
|
+
syncResize(reset, messageData, 'reset');
|
|
817
|
+
}
|
|
818
|
+
|
|
819
|
+
function setSize(messageData) {
|
|
820
|
+
function setDimension(dimension) {
|
|
821
|
+
if (!messageData.id) {
|
|
822
|
+
log('undefined', 'messageData id not set');
|
|
823
|
+
return
|
|
824
|
+
}
|
|
825
|
+
messageData.iframe.style[dimension] = messageData[dimension] + 'px';
|
|
826
|
+
log(
|
|
827
|
+
messageData.id,
|
|
828
|
+
'IFrame (' +
|
|
829
|
+
iframeId +
|
|
830
|
+
') ' +
|
|
831
|
+
dimension +
|
|
832
|
+
' set to ' +
|
|
833
|
+
messageData[dimension] +
|
|
834
|
+
'px'
|
|
835
|
+
);
|
|
836
|
+
}
|
|
837
|
+
|
|
838
|
+
function chkZero(dimension) {
|
|
839
|
+
// FireFox sets dimension of hidden iFrames to zero.
|
|
840
|
+
// So if we detect that set up an event to check for
|
|
841
|
+
// when iFrame becomes visible.
|
|
842
|
+
|
|
843
|
+
/* istanbul ignore next */ // Not testable in PhantomJS
|
|
844
|
+
if (!hiddenCheckEnabled && '0' === messageData[dimension]) {
|
|
845
|
+
hiddenCheckEnabled = true;
|
|
846
|
+
log(iframeId, 'Hidden iFrame detected, creating visibility listener');
|
|
847
|
+
fixHiddenIFrames();
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
function processDimension(dimension) {
|
|
852
|
+
setDimension(dimension);
|
|
853
|
+
chkZero(dimension);
|
|
854
|
+
}
|
|
855
|
+
|
|
856
|
+
var iframeId = messageData.iframe.id;
|
|
857
|
+
|
|
858
|
+
if (settings[iframeId]) {
|
|
859
|
+
if (settings[iframeId].sizeHeight) {
|
|
860
|
+
processDimension('height');
|
|
861
|
+
}
|
|
862
|
+
if (settings[iframeId].sizeWidth) {
|
|
863
|
+
processDimension('width');
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
|
|
868
|
+
function syncResize(func, messageData, doNotSync) {
|
|
869
|
+
/* istanbul ignore if */ // Not testable in PhantomJS
|
|
870
|
+
if (
|
|
871
|
+
doNotSync !== messageData.type &&
|
|
872
|
+
requestAnimationFrame &&
|
|
873
|
+
// including check for jasmine because had trouble getting spy to work in unit test using requestAnimationFrame
|
|
874
|
+
!window.jasmine
|
|
875
|
+
) {
|
|
876
|
+
log(messageData.id, 'Requesting animation frame');
|
|
877
|
+
requestAnimationFrame(func);
|
|
878
|
+
} else {
|
|
879
|
+
func();
|
|
880
|
+
}
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
function trigger(calleeMsg, msg, iframe, id, noResponseWarning) {
|
|
884
|
+
function postMessageToIFrame() {
|
|
885
|
+
var target = settings[id] && settings[id].targetOrigin;
|
|
886
|
+
log(
|
|
887
|
+
id,
|
|
888
|
+
'[' +
|
|
889
|
+
calleeMsg +
|
|
890
|
+
'] Sending msg to iframe[' +
|
|
891
|
+
id +
|
|
892
|
+
'] (' +
|
|
893
|
+
msg +
|
|
894
|
+
') targetOrigin: ' +
|
|
895
|
+
target
|
|
896
|
+
);
|
|
897
|
+
iframe.contentWindow.postMessage(msgId + msg, target);
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
function iFrameNotFound() {
|
|
901
|
+
warn(id, '[' + calleeMsg + '] IFrame(' + id + ') not found');
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
function chkAndSend() {
|
|
905
|
+
if (
|
|
906
|
+
iframe &&
|
|
907
|
+
'contentWindow' in iframe &&
|
|
908
|
+
null !== iframe.contentWindow
|
|
909
|
+
) {
|
|
910
|
+
// Null test for PhantomJS
|
|
911
|
+
postMessageToIFrame();
|
|
912
|
+
} else {
|
|
913
|
+
iFrameNotFound();
|
|
914
|
+
}
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
function warnOnNoResponse() {
|
|
918
|
+
function warning() {
|
|
919
|
+
if (settings[id] && !settings[id].loaded && !errorShown) {
|
|
920
|
+
errorShown = true;
|
|
921
|
+
warn(
|
|
922
|
+
id,
|
|
923
|
+
'IFrame has not responded within ' +
|
|
924
|
+
settings[id].warningTimeout / 1000 +
|
|
925
|
+
' seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning.'
|
|
926
|
+
);
|
|
927
|
+
}
|
|
928
|
+
}
|
|
929
|
+
|
|
930
|
+
if (
|
|
931
|
+
!!noResponseWarning &&
|
|
932
|
+
settings[id] &&
|
|
933
|
+
!!settings[id].warningTimeout
|
|
934
|
+
) {
|
|
935
|
+
settings[id].msgTimeout = setTimeout(
|
|
936
|
+
warning,
|
|
937
|
+
settings[id].warningTimeout
|
|
938
|
+
);
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
var errorShown = false;
|
|
943
|
+
|
|
944
|
+
id = id || iframe.id;
|
|
945
|
+
|
|
946
|
+
if (settings[id]) {
|
|
947
|
+
chkAndSend();
|
|
948
|
+
warnOnNoResponse();
|
|
949
|
+
}
|
|
950
|
+
}
|
|
951
|
+
|
|
952
|
+
function createOutgoingMsg(iframeId) {
|
|
953
|
+
return (
|
|
954
|
+
iframeId +
|
|
955
|
+
':' +
|
|
956
|
+
settings[iframeId].bodyMarginV1 +
|
|
957
|
+
':' +
|
|
958
|
+
settings[iframeId].sizeWidth +
|
|
959
|
+
':' +
|
|
960
|
+
settings[iframeId].log +
|
|
961
|
+
':' +
|
|
962
|
+
settings[iframeId].interval +
|
|
963
|
+
':' +
|
|
964
|
+
settings[iframeId].enablePublicMethods +
|
|
965
|
+
':' +
|
|
966
|
+
settings[iframeId].autoResize +
|
|
967
|
+
':' +
|
|
968
|
+
settings[iframeId].bodyMargin +
|
|
969
|
+
':' +
|
|
970
|
+
settings[iframeId].heightCalculationMethod +
|
|
971
|
+
':' +
|
|
972
|
+
settings[iframeId].bodyBackground +
|
|
973
|
+
':' +
|
|
974
|
+
settings[iframeId].bodyPadding +
|
|
975
|
+
':' +
|
|
976
|
+
settings[iframeId].tolerance +
|
|
977
|
+
':' +
|
|
978
|
+
settings[iframeId].inPageLinks +
|
|
979
|
+
':' +
|
|
980
|
+
settings[iframeId].resizeFrom +
|
|
981
|
+
':' +
|
|
982
|
+
settings[iframeId].widthCalculationMethod +
|
|
983
|
+
':' +
|
|
984
|
+
settings[iframeId].mouseEvents
|
|
985
|
+
)
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
function isNumber(value) {
|
|
989
|
+
return typeof value === 'number'
|
|
990
|
+
}
|
|
991
|
+
|
|
992
|
+
function setupIFrame(iframe, options) {
|
|
993
|
+
function setLimits() {
|
|
994
|
+
function addStyle(style) {
|
|
995
|
+
var styleValue = settings[iframeId][style];
|
|
996
|
+
if (Infinity !== styleValue && 0 !== styleValue) {
|
|
997
|
+
iframe.style[style] = isNumber(styleValue)
|
|
998
|
+
? styleValue + 'px'
|
|
999
|
+
: styleValue;
|
|
1000
|
+
log(iframeId, 'Set ' + style + ' = ' + iframe.style[style]);
|
|
1001
|
+
}
|
|
1002
|
+
}
|
|
1003
|
+
|
|
1004
|
+
function chkMinMax(dimension) {
|
|
1005
|
+
if (
|
|
1006
|
+
settings[iframeId]['min' + dimension] >
|
|
1007
|
+
settings[iframeId]['max' + dimension]
|
|
1008
|
+
) {
|
|
1009
|
+
throw new Error(
|
|
1010
|
+
'Value for min' +
|
|
1011
|
+
dimension +
|
|
1012
|
+
' can not be greater than max' +
|
|
1013
|
+
dimension
|
|
1014
|
+
)
|
|
1015
|
+
}
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
chkMinMax('Height');
|
|
1019
|
+
chkMinMax('Width');
|
|
1020
|
+
|
|
1021
|
+
addStyle('maxHeight');
|
|
1022
|
+
addStyle('minHeight');
|
|
1023
|
+
addStyle('maxWidth');
|
|
1024
|
+
addStyle('minWidth');
|
|
1025
|
+
}
|
|
1026
|
+
|
|
1027
|
+
function newId() {
|
|
1028
|
+
var id = (options && options.id) || defaults.id + count++;
|
|
1029
|
+
if (null !== document.getElementById(id)) {
|
|
1030
|
+
id += count++;
|
|
1031
|
+
}
|
|
1032
|
+
return id
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
function ensureHasId(iframeId) {
|
|
1036
|
+
if (typeof iframeId !== 'string') {
|
|
1037
|
+
throw new TypeError('Invaild id for iFrame. Expected String')
|
|
1038
|
+
}
|
|
1039
|
+
|
|
1040
|
+
if ('' === iframeId) {
|
|
1041
|
+
// eslint-disable-next-line no-multi-assign
|
|
1042
|
+
iframe.id = iframeId = newId();
|
|
1043
|
+
logEnabled = (options || {}).log;
|
|
1044
|
+
log(
|
|
1045
|
+
iframeId,
|
|
1046
|
+
'Added missing iframe ID: ' + iframeId + ' (' + iframe.src + ')'
|
|
1047
|
+
);
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
return iframeId
|
|
1051
|
+
}
|
|
1052
|
+
|
|
1053
|
+
function setScrolling() {
|
|
1054
|
+
log(
|
|
1055
|
+
iframeId,
|
|
1056
|
+
'IFrame scrolling ' +
|
|
1057
|
+
(settings[iframeId] && settings[iframeId].scrolling
|
|
1058
|
+
? 'enabled'
|
|
1059
|
+
: 'disabled') +
|
|
1060
|
+
' for ' +
|
|
1061
|
+
iframeId
|
|
1062
|
+
);
|
|
1063
|
+
iframe.style.overflow =
|
|
1064
|
+
false === (settings[iframeId] && settings[iframeId].scrolling)
|
|
1065
|
+
? 'hidden'
|
|
1066
|
+
: 'auto';
|
|
1067
|
+
switch (settings[iframeId] && settings[iframeId].scrolling) {
|
|
1068
|
+
case 'omit': {
|
|
1069
|
+
break
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
case true: {
|
|
1073
|
+
iframe.scrolling = 'yes';
|
|
1074
|
+
break
|
|
1075
|
+
}
|
|
1076
|
+
|
|
1077
|
+
case false: {
|
|
1078
|
+
iframe.scrolling = 'no';
|
|
1079
|
+
break
|
|
1080
|
+
}
|
|
1081
|
+
|
|
1082
|
+
default: {
|
|
1083
|
+
iframe.scrolling = settings[iframeId]
|
|
1084
|
+
? settings[iframeId].scrolling
|
|
1085
|
+
: 'no';
|
|
1086
|
+
}
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
// The V1 iFrame script expects an int, where as in V2 expects a CSS
|
|
1091
|
+
// string value such as '1px 3em', so if we have an int for V2, set V1=V2
|
|
1092
|
+
// and then convert V2 to a string PX value.
|
|
1093
|
+
function setupBodyMarginValues() {
|
|
1094
|
+
if (
|
|
1095
|
+
'number' ===
|
|
1096
|
+
typeof (settings[iframeId] && settings[iframeId].bodyMargin) ||
|
|
1097
|
+
'0' === (settings[iframeId] && settings[iframeId].bodyMargin)
|
|
1098
|
+
) {
|
|
1099
|
+
settings[iframeId].bodyMarginV1 = settings[iframeId].bodyMargin;
|
|
1100
|
+
settings[iframeId].bodyMargin =
|
|
1101
|
+
'' + settings[iframeId].bodyMargin + 'px';
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
function checkReset() {
|
|
1106
|
+
// Reduce scope of firstRun to function, because IE8's JS execution
|
|
1107
|
+
// context stack is borked and this value gets externally
|
|
1108
|
+
// changed midway through running this function!!!
|
|
1109
|
+
var firstRun = settings[iframeId] && settings[iframeId].firstRun,
|
|
1110
|
+
resetRequertMethod =
|
|
1111
|
+
settings[iframeId] &&
|
|
1112
|
+
settings[iframeId].heightCalculationMethod in resetRequiredMethods;
|
|
1113
|
+
|
|
1114
|
+
if (!firstRun && resetRequertMethod) {
|
|
1115
|
+
resetIFrame({ iframe: iframe, height: 0, width: 0, type: 'init' });
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
|
|
1119
|
+
function setupIFrameObject() {
|
|
1120
|
+
if (settings[iframeId]) {
|
|
1121
|
+
settings[iframeId].iframe.iFrameResizer = {
|
|
1122
|
+
close: closeIFrame.bind(null, settings[iframeId].iframe),
|
|
1123
|
+
|
|
1124
|
+
removeListeners: removeIframeListeners.bind(
|
|
1125
|
+
null,
|
|
1126
|
+
settings[iframeId].iframe
|
|
1127
|
+
),
|
|
1128
|
+
|
|
1129
|
+
resize: trigger.bind(
|
|
1130
|
+
null,
|
|
1131
|
+
'Window resize',
|
|
1132
|
+
'resize',
|
|
1133
|
+
settings[iframeId].iframe
|
|
1134
|
+
),
|
|
1135
|
+
|
|
1136
|
+
moveToAnchor: function (anchor) {
|
|
1137
|
+
trigger(
|
|
1138
|
+
'Move to anchor',
|
|
1139
|
+
'moveToAnchor:' + anchor,
|
|
1140
|
+
settings[iframeId].iframe,
|
|
1141
|
+
iframeId
|
|
1142
|
+
);
|
|
1143
|
+
},
|
|
1144
|
+
|
|
1145
|
+
sendMessage: function (message) {
|
|
1146
|
+
message = JSON.stringify(message);
|
|
1147
|
+
trigger(
|
|
1148
|
+
'Send Message',
|
|
1149
|
+
'message:' + message,
|
|
1150
|
+
settings[iframeId].iframe,
|
|
1151
|
+
iframeId
|
|
1152
|
+
);
|
|
1153
|
+
}
|
|
1154
|
+
};
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
|
|
1158
|
+
// We have to call trigger twice, as we can not be sure if all
|
|
1159
|
+
// iframes have completed loading when this code runs. The
|
|
1160
|
+
// event listener also catches the page changing in the iFrame.
|
|
1161
|
+
function init(msg) {
|
|
1162
|
+
function iFrameLoaded() {
|
|
1163
|
+
trigger('iFrame.onload', msg, iframe, undefined$1, true);
|
|
1164
|
+
checkReset();
|
|
1165
|
+
}
|
|
1166
|
+
|
|
1167
|
+
function createDestroyObserver(MutationObserver) {
|
|
1168
|
+
if (!iframe.parentNode) {
|
|
1169
|
+
return null
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
var destroyObserver = new MutationObserver(function (mutations) {
|
|
1173
|
+
mutations.forEach(function (mutation) {
|
|
1174
|
+
var removedNodes = Array.prototype.slice.call(mutation.removedNodes); // Transform NodeList into an Array
|
|
1175
|
+
removedNodes.forEach(function (removedNode) {
|
|
1176
|
+
if (removedNode === iframe) {
|
|
1177
|
+
closeIFrame(iframe);
|
|
1178
|
+
}
|
|
1179
|
+
});
|
|
1180
|
+
});
|
|
1181
|
+
});
|
|
1182
|
+
destroyObserver.observe(iframe.parentNode, {
|
|
1183
|
+
childList: true
|
|
1184
|
+
});
|
|
1185
|
+
return destroyObserver
|
|
1186
|
+
}
|
|
1187
|
+
|
|
1188
|
+
var MutationObserver = getMutationObserver();
|
|
1189
|
+
if (MutationObserver) {
|
|
1190
|
+
destroyObserver = createDestroyObserver(MutationObserver);
|
|
1191
|
+
}
|
|
1192
|
+
|
|
1193
|
+
addEventListener(iframe, 'load', iFrameLoaded);
|
|
1194
|
+
trigger('init', msg, iframe, undefined$1, true);
|
|
1195
|
+
}
|
|
1196
|
+
|
|
1197
|
+
function checkOptions(options) {
|
|
1198
|
+
if ('object' !== typeof options) {
|
|
1199
|
+
throw new TypeError('Options is not an object')
|
|
1200
|
+
}
|
|
1201
|
+
}
|
|
1202
|
+
|
|
1203
|
+
function copyOptions(options) {
|
|
1204
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
1205
|
+
for (var option in defaults) {
|
|
1206
|
+
if (Object.prototype.hasOwnProperty.call(defaults, option)) {
|
|
1207
|
+
settings[iframeId][option] = Object.prototype.hasOwnProperty.call(
|
|
1208
|
+
options,
|
|
1209
|
+
option
|
|
1210
|
+
)
|
|
1211
|
+
? options[option]
|
|
1212
|
+
: defaults[option];
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
|
|
1217
|
+
function getTargetOrigin(remoteHost) {
|
|
1218
|
+
return '' === remoteHost ||
|
|
1219
|
+
null !== remoteHost.match(/^(about:blank|javascript:|file:\/\/)/)
|
|
1220
|
+
? '*'
|
|
1221
|
+
: remoteHost
|
|
1222
|
+
}
|
|
1223
|
+
|
|
1224
|
+
function depricate(key) {
|
|
1225
|
+
var splitName = key.split('Callback');
|
|
1226
|
+
|
|
1227
|
+
if (splitName.length === 2) {
|
|
1228
|
+
var name =
|
|
1229
|
+
'on' + splitName[0].charAt(0).toUpperCase() + splitName[0].slice(1);
|
|
1230
|
+
this[name] = this[key];
|
|
1231
|
+
delete this[key];
|
|
1232
|
+
warn(
|
|
1233
|
+
iframeId,
|
|
1234
|
+
"Deprecated: '" +
|
|
1235
|
+
key +
|
|
1236
|
+
"' has been renamed '" +
|
|
1237
|
+
name +
|
|
1238
|
+
"'. The old method will be removed in the next major version."
|
|
1239
|
+
);
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
|
|
1243
|
+
function processOptions(options) {
|
|
1244
|
+
options = options || {};
|
|
1245
|
+
|
|
1246
|
+
settings[iframeId] = Object.create(null); // Protect against prototype attacks
|
|
1247
|
+
settings[iframeId].iframe = iframe;
|
|
1248
|
+
settings[iframeId].firstRun = true;
|
|
1249
|
+
settings[iframeId].remoteHost =
|
|
1250
|
+
iframe.src && iframe.src.split('/').slice(0, 3).join('/');
|
|
1251
|
+
|
|
1252
|
+
checkOptions(options);
|
|
1253
|
+
Object.keys(options).forEach(depricate, options);
|
|
1254
|
+
copyOptions(options);
|
|
1255
|
+
|
|
1256
|
+
if (settings[iframeId]) {
|
|
1257
|
+
settings[iframeId].targetOrigin =
|
|
1258
|
+
true === settings[iframeId].checkOrigin
|
|
1259
|
+
? getTargetOrigin(settings[iframeId].remoteHost)
|
|
1260
|
+
: '*';
|
|
1261
|
+
}
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
function beenHere() {
|
|
1265
|
+
return iframeId in settings && 'iFrameResizer' in iframe
|
|
1266
|
+
}
|
|
1267
|
+
|
|
1268
|
+
var iframeId = ensureHasId(iframe.id);
|
|
1269
|
+
|
|
1270
|
+
if (beenHere()) {
|
|
1271
|
+
warn(iframeId, 'Ignored iFrame, already setup.');
|
|
1272
|
+
} else {
|
|
1273
|
+
processOptions(options);
|
|
1274
|
+
setScrolling();
|
|
1275
|
+
setLimits();
|
|
1276
|
+
setupBodyMarginValues();
|
|
1277
|
+
init(createOutgoingMsg(iframeId));
|
|
1278
|
+
setupIFrameObject();
|
|
1279
|
+
}
|
|
1280
|
+
}
|
|
1281
|
+
|
|
1282
|
+
function debouce(fn, time) {
|
|
1283
|
+
if (null === timer) {
|
|
1284
|
+
timer = setTimeout(function () {
|
|
1285
|
+
timer = null;
|
|
1286
|
+
fn();
|
|
1287
|
+
}, time);
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
|
|
1291
|
+
var frameTimer = {};
|
|
1292
|
+
function debounceFrameEvents(fn, time, frameId) {
|
|
1293
|
+
if (!frameTimer[frameId]) {
|
|
1294
|
+
frameTimer[frameId] = setTimeout(function () {
|
|
1295
|
+
frameTimer[frameId] = null;
|
|
1296
|
+
fn();
|
|
1297
|
+
}, time);
|
|
1298
|
+
}
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
// Not testable in PhantomJS
|
|
1302
|
+
/* istanbul ignore next */
|
|
1303
|
+
|
|
1304
|
+
function fixHiddenIFrames() {
|
|
1305
|
+
function checkIFrames() {
|
|
1306
|
+
function checkIFrame(settingId) {
|
|
1307
|
+
function chkDimension(dimension) {
|
|
1308
|
+
return (
|
|
1309
|
+
'0px' ===
|
|
1310
|
+
(settings[settingId] && settings[settingId].iframe.style[dimension])
|
|
1311
|
+
)
|
|
1312
|
+
}
|
|
1313
|
+
|
|
1314
|
+
function isVisible(el) {
|
|
1315
|
+
return null !== el.offsetParent
|
|
1316
|
+
}
|
|
1317
|
+
|
|
1318
|
+
if (
|
|
1319
|
+
settings[settingId] &&
|
|
1320
|
+
isVisible(settings[settingId].iframe) &&
|
|
1321
|
+
(chkDimension('height') || chkDimension('width'))
|
|
1322
|
+
) {
|
|
1323
|
+
trigger(
|
|
1324
|
+
'Visibility change',
|
|
1325
|
+
'resize',
|
|
1326
|
+
settings[settingId].iframe,
|
|
1327
|
+
settingId
|
|
1328
|
+
);
|
|
1329
|
+
}
|
|
1330
|
+
}
|
|
1331
|
+
|
|
1332
|
+
Object.keys(settings).forEach(function (key) {
|
|
1333
|
+
checkIFrame(key);
|
|
1334
|
+
});
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
function mutationObserved(mutations) {
|
|
1338
|
+
log(
|
|
1339
|
+
'window',
|
|
1340
|
+
'Mutation observed: ' + mutations[0].target + ' ' + mutations[0].type
|
|
1341
|
+
);
|
|
1342
|
+
debouce(checkIFrames, 16);
|
|
1343
|
+
}
|
|
1344
|
+
|
|
1345
|
+
function createMutationObserver() {
|
|
1346
|
+
var target = document.querySelector('body'),
|
|
1347
|
+
config = {
|
|
1348
|
+
attributes: true,
|
|
1349
|
+
attributeOldValue: false,
|
|
1350
|
+
characterData: true,
|
|
1351
|
+
characterDataOldValue: false,
|
|
1352
|
+
childList: true,
|
|
1353
|
+
subtree: true
|
|
1354
|
+
},
|
|
1355
|
+
observer = new MutationObserver(mutationObserved);
|
|
1356
|
+
|
|
1357
|
+
observer.observe(target, config);
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
var MutationObserver = getMutationObserver();
|
|
1361
|
+
if (MutationObserver) {
|
|
1362
|
+
createMutationObserver();
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
function resizeIFrames(event) {
|
|
1367
|
+
function resize() {
|
|
1368
|
+
sendTriggerMsg('Window ' + event, 'resize');
|
|
1369
|
+
}
|
|
1370
|
+
|
|
1371
|
+
log('window', 'Trigger event: ' + event);
|
|
1372
|
+
debouce(resize, 16);
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
// Not testable in PhantomJS
|
|
1376
|
+
/* istanbul ignore next */
|
|
1377
|
+
function tabVisible() {
|
|
1378
|
+
function resize() {
|
|
1379
|
+
sendTriggerMsg('Tab Visible', 'resize');
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
if ('hidden' !== document.visibilityState) {
|
|
1383
|
+
log('document', 'Trigger event: Visibility change');
|
|
1384
|
+
debouce(resize, 16);
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
function sendTriggerMsg(eventName, event) {
|
|
1389
|
+
function isIFrameResizeEnabled(iframeId) {
|
|
1390
|
+
return (
|
|
1391
|
+
settings[iframeId] &&
|
|
1392
|
+
'parent' === settings[iframeId].resizeFrom &&
|
|
1393
|
+
settings[iframeId].autoResize &&
|
|
1394
|
+
!settings[iframeId].firstRun
|
|
1395
|
+
)
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
Object.keys(settings).forEach(function (iframeId) {
|
|
1399
|
+
if (isIFrameResizeEnabled(iframeId)) {
|
|
1400
|
+
trigger(eventName, event, settings[iframeId].iframe, iframeId);
|
|
1401
|
+
}
|
|
1402
|
+
});
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
function setupEventListeners() {
|
|
1406
|
+
addEventListener(window, 'message', iFrameListener);
|
|
1407
|
+
|
|
1408
|
+
addEventListener(window, 'resize', function () {
|
|
1409
|
+
resizeIFrames('resize');
|
|
1410
|
+
});
|
|
1411
|
+
|
|
1412
|
+
addEventListener(document, 'visibilitychange', tabVisible);
|
|
1413
|
+
|
|
1414
|
+
addEventListener(document, '-webkit-visibilitychange', tabVisible);
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
function factory() {
|
|
1418
|
+
function init(options, element) {
|
|
1419
|
+
function chkType() {
|
|
1420
|
+
if (!element.tagName) {
|
|
1421
|
+
throw new TypeError('Object is not a valid DOM element')
|
|
1422
|
+
} else if ('IFRAME' !== element.tagName.toUpperCase()) {
|
|
1423
|
+
throw new TypeError(
|
|
1424
|
+
'Expected <IFRAME> tag, found <' + element.tagName + '>'
|
|
1425
|
+
)
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
if (element) {
|
|
1430
|
+
chkType();
|
|
1431
|
+
setupIFrame(element, options);
|
|
1432
|
+
iFrames.push(element);
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
function warnDeprecatedOptions(options) {
|
|
1437
|
+
if (options && options.enablePublicMethods) {
|
|
1438
|
+
warn(
|
|
1439
|
+
'enablePublicMethods option has been removed, public methods are now always available in the iFrame'
|
|
1440
|
+
);
|
|
1441
|
+
}
|
|
1442
|
+
}
|
|
1443
|
+
|
|
1444
|
+
var iFrames;
|
|
1445
|
+
|
|
1446
|
+
setupRequestAnimationFrame();
|
|
1447
|
+
setupEventListeners();
|
|
1448
|
+
|
|
1449
|
+
return function iFrameResizeF(options, target) {
|
|
1450
|
+
iFrames = []; // Only return iFrames past in on this call
|
|
1451
|
+
|
|
1452
|
+
warnDeprecatedOptions(options);
|
|
1453
|
+
|
|
1454
|
+
switch (typeof target) {
|
|
1455
|
+
case 'undefined':
|
|
1456
|
+
case 'string': {
|
|
1457
|
+
Array.prototype.forEach.call(
|
|
1458
|
+
document.querySelectorAll(target || 'iframe'),
|
|
1459
|
+
init.bind(undefined$1, options)
|
|
1460
|
+
);
|
|
1461
|
+
break
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
case 'object': {
|
|
1465
|
+
init(options, target);
|
|
1466
|
+
break
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1469
|
+
default: {
|
|
1470
|
+
throw new TypeError('Unexpected data type (' + typeof target + ')')
|
|
1471
|
+
}
|
|
1472
|
+
}
|
|
1473
|
+
|
|
1474
|
+
return iFrames
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
|
|
1478
|
+
function createJQueryPublicMethod($) {
|
|
1479
|
+
if (!$.fn) {
|
|
1480
|
+
info('', 'Unable to bind to jQuery, it is not fully loaded.');
|
|
1481
|
+
} else if (!$.fn.iFrameResize) {
|
|
1482
|
+
$.fn.iFrameResize = function $iFrameResizeF(options) {
|
|
1483
|
+
function init(index, element) {
|
|
1484
|
+
setupIFrame(element, options);
|
|
1485
|
+
}
|
|
1486
|
+
|
|
1487
|
+
return this.filter('iframe').each(init).end()
|
|
1488
|
+
};
|
|
1489
|
+
}
|
|
1490
|
+
}
|
|
1491
|
+
|
|
1492
|
+
if (window.jQuery !== undefined$1) {
|
|
1493
|
+
createJQueryPublicMethod(window.jQuery);
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
{
|
|
1497
|
+
// Node for browserfy
|
|
1498
|
+
module.exports = factory();
|
|
1499
|
+
}
|
|
1500
|
+
window.iFrameResize = window.iFrameResize || factory();
|
|
1501
|
+
})();
|
|
1502
|
+
} (iframeResizer));
|
|
1503
|
+
return iframeResizer.exports;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
var iframeResizerExports = requireIframeResizer();
|
|
1507
|
+
var iFrameResize = /*@__PURE__*/getDefaultExportFromCjs(iframeResizerExports);
|
|
1508
|
+
|
|
1509
|
+
/**
|
|
1510
|
+
* This approach decouples the communication logic from PaymentMethodForm component,
|
|
1511
|
+
* making it cleaner, more maintainable, and easier to test
|
|
1512
|
+
*/
|
|
1513
|
+
class FrameCommunicationService {
|
|
1514
|
+
constructor(iframe, iframeOrigin) {
|
|
1515
|
+
this.iframe = iframe;
|
|
1516
|
+
this.iframeOrigin = iframeOrigin;
|
|
1517
|
+
}
|
|
1518
|
+
postMessage(eventType, payload) {
|
|
1519
|
+
const message = Object.assign({ eventType }, payload);
|
|
1520
|
+
this.iframe.contentWindow.postMessage(message, this.iframeOrigin);
|
|
1521
|
+
}
|
|
1522
|
+
addMessageListener(callback) {
|
|
1523
|
+
window.addEventListener('message', callback);
|
|
1524
|
+
}
|
|
1525
|
+
removeMessageListener(callback) {
|
|
1526
|
+
window.removeEventListener('message', callback);
|
|
1527
|
+
}
|
|
1528
|
+
postMessageWithResponseListener(eventType, payload) {
|
|
1529
|
+
return new Promise((resolve) => {
|
|
1530
|
+
const responseListener = (event) => {
|
|
1531
|
+
if (event.data.eventType !== eventType)
|
|
1532
|
+
return;
|
|
1533
|
+
window.removeEventListener('message', responseListener);
|
|
1534
|
+
resolve(event.data.data);
|
|
1535
|
+
};
|
|
1536
|
+
window.addEventListener('message', responseListener);
|
|
1537
|
+
this.postMessage(eventType, payload);
|
|
1538
|
+
});
|
|
1539
|
+
}
|
|
1540
|
+
}
|
|
1541
|
+
|
|
1542
|
+
const MessageEventType = {
|
|
1543
|
+
tokenize: 'tokenize',
|
|
1544
|
+
validate: 'validate',
|
|
1545
|
+
};
|
|
1546
|
+
|
|
1547
|
+
const IframeInput = class {
|
|
1548
|
+
constructor(hostRef) {
|
|
1549
|
+
registerInstance(this, hostRef);
|
|
1550
|
+
this.iframeLoaded = createEvent(this, "iframeLoaded");
|
|
1551
|
+
this.isFocused = false;
|
|
1552
|
+
this.isValid = true;
|
|
1553
|
+
this.dispatchMessageEvent = (event) => {
|
|
1554
|
+
const { eventType, data } = event.data;
|
|
1555
|
+
if ((data === null || data === void 0 ? void 0 : data.id) !== this.inputId) {
|
|
1556
|
+
return;
|
|
1557
|
+
}
|
|
1558
|
+
if (eventType === 'focused') {
|
|
1559
|
+
this.isFocused = true;
|
|
1560
|
+
}
|
|
1561
|
+
if (eventType === 'blurred') {
|
|
1562
|
+
this.isFocused = false;
|
|
1563
|
+
}
|
|
1564
|
+
};
|
|
1565
|
+
}
|
|
1566
|
+
disconnectedCallback() {
|
|
1567
|
+
this.frameService.removeMessageListener(this.dispatchMessageEvent);
|
|
1568
|
+
}
|
|
1569
|
+
async validate() {
|
|
1570
|
+
const response = await this.frameService
|
|
1571
|
+
.postMessageWithResponseListener(MessageEventType.validate);
|
|
1572
|
+
this.isValid = response.isValid;
|
|
1573
|
+
this.errorText = response.error.message;
|
|
1574
|
+
return response;
|
|
1575
|
+
}
|
|
1576
|
+
async tokenize(clientId, paymentMethodMetadata, account) {
|
|
1577
|
+
return this.frameService.postMessageWithResponseListener(MessageEventType.tokenize, {
|
|
1578
|
+
clientId,
|
|
1579
|
+
paymentMethodMetadata,
|
|
1580
|
+
account,
|
|
1581
|
+
componentVersion: packageJson.version,
|
|
1582
|
+
});
|
|
1583
|
+
}
|
|
1584
|
+
initializeFrameCommunicationService() {
|
|
1585
|
+
var _a;
|
|
1586
|
+
this.frameService = new FrameCommunicationService(this.iframeElement, this.iframeOrigin);
|
|
1587
|
+
(_a = this.frameService) === null || _a === void 0 ? void 0 : _a.addMessageListener(this.dispatchMessageEvent);
|
|
1588
|
+
}
|
|
1589
|
+
get part() {
|
|
1590
|
+
if (this.isFocused && !this.isValid) {
|
|
1591
|
+
return inputInvalidAndFocused;
|
|
1592
|
+
}
|
|
1593
|
+
if (!this.isValid) {
|
|
1594
|
+
return inputInvalid;
|
|
1595
|
+
}
|
|
1596
|
+
if (this.isFocused) {
|
|
1597
|
+
return inputFocused;
|
|
1598
|
+
}
|
|
1599
|
+
return input;
|
|
1600
|
+
}
|
|
1601
|
+
get style() {
|
|
1602
|
+
if (this.isFocused) {
|
|
1603
|
+
if (!this.isValid) {
|
|
1604
|
+
return iframeInputStyles.focusedAndInvalid;
|
|
1605
|
+
}
|
|
1606
|
+
return iframeInputStyles.focused;
|
|
1607
|
+
}
|
|
1608
|
+
return null;
|
|
1609
|
+
}
|
|
1610
|
+
get urlParams() {
|
|
1611
|
+
// map the iframeInputStyles.fontStyles properties to the urlParams
|
|
1612
|
+
// and encode each property with btoa
|
|
1613
|
+
const encodedObject = Object.fromEntries(Object
|
|
1614
|
+
.entries(iframeInputStyles.fontStyles)
|
|
1615
|
+
.map(([key, value]) => [key, btoa(String(value))]));
|
|
1616
|
+
const params = new URLSearchParams(encodedObject).toString();
|
|
1617
|
+
return params;
|
|
1618
|
+
}
|
|
1619
|
+
render() {
|
|
1620
|
+
return (h(Host, { key: 'b3e863bb8ddced5c0f9493915c9fce9d80d8c567', class: "form-group d-flex flex-column" }, h("div", { key: '20f09bbfad447e157594beade6a081b2df7c19ba', style: {
|
|
1621
|
+
visibility: this.iframeLoaded ? 'visible' : 'hidden',
|
|
1622
|
+
height: this.iframeLoaded ? 'auto' : '0',
|
|
1623
|
+
} }, h("label", { key: '9a85897b5ffd9ea350a59f33f08bd82fb94a2666', class: "form-label", htmlFor: "", part: label }, this.label || ''), h("div", { key: 'd2e01fc5b13b7a5a74eaf56a9825297545a7cd84', class: `p-0 d-flex form-control ${this.isValid ? '' : 'is-invalid'}`, part: this.part, style: Object.assign(Object.assign({}, this.style), { overflow: 'hidden' }) }, h("iframe", { key: '108f8164f00104f43e67f6b9c1cfcbc1a3ba077f', id: this.inputId, name: this.inputId, src: `${this.iframeOrigin}?${this.urlParams}`, ref: el => {
|
|
1624
|
+
this.iframeElement = el;
|
|
1625
|
+
this.initializeFrameCommunicationService();
|
|
1626
|
+
}, width: "100%", onLoad: () => {
|
|
1627
|
+
iFrameResize({
|
|
1628
|
+
log: false,
|
|
1629
|
+
onResized: () => {
|
|
1630
|
+
this.iframeLoaded.emit();
|
|
1631
|
+
}
|
|
1632
|
+
}, this.iframeElement);
|
|
1633
|
+
} })), h(FormControlErrorText, { key: 'a3e141a71221328cd341313be7ceb784846ef177', errorText: this.errorText, name: this.inputId }))));
|
|
1634
|
+
}
|
|
1635
|
+
get el() { return getElement(this); }
|
|
1636
|
+
};
|
|
1637
|
+
|
|
1638
|
+
export { IframeInput as iframe_input };
|