stripe-pwa-elements 3.2.0 → 4.0.1
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/app-globals-V2Kpy_OQ.js +0 -3
- package/dist/cjs/error-FFC4kSs5.js +0 -3
- package/dist/cjs/{factory-CbbbSvkg.js → factory-Cd2VI_N2.js} +216 -77
- package/dist/cjs/{index-Ba1pBePA.js → index-CYbA1N_k.js} +24 -6
- package/dist/cjs/index-Dkb0SxZc.js +4694 -0
- package/dist/cjs/index.cjs.js +0 -1
- package/dist/cjs/ion-icon.cjs.entry.js +22 -13
- package/dist/cjs/loader.cjs.js +2 -3
- package/dist/cjs/stripe-address-element.cjs.entry.js +41 -26
- package/dist/cjs/stripe-card-element-modal.cjs.entry.js +6 -7
- package/dist/cjs/stripe-card-element_2.cjs.entry.js +129 -72
- package/dist/cjs/stripe-currency-selector.cjs.entry.js +20 -10
- package/dist/cjs/stripe-elements.cjs.js +31 -5
- package/dist/cjs/stripe-express-checkout-element.cjs.entry.js +32 -22
- package/dist/cjs/stripe-link-authentication-element.cjs.entry.js +20 -10
- package/dist/cjs/stripe-payment-element.cjs.entry.js +283 -167
- package/dist/cjs/stripe-payment-request-button.cjs.entry.js +30 -18
- package/dist/collection/collection-manifest.json +6 -5
- package/dist/collection/components/stripe-address-element/stripe-address-element.js +36 -21
- package/dist/collection/components/stripe-card-element/stripe-card-element.helpers.js +57 -0
- package/dist/collection/components/stripe-card-element/stripe-card-element.js +62 -68
- package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js +15 -11
- package/dist/collection/components/stripe-currency-selector/stripe-currency-selector.js +17 -6
- package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js +35 -20
- package/dist/collection/components/stripe-link-authentication-element/stripe-link-authentication-element.js +19 -7
- package/dist/collection/components/stripe-modal/stripe-modal.js +18 -7
- package/dist/collection/components/stripe-payment-element/stripe-payment-element.helpers.js +114 -0
- package/dist/collection/components/stripe-payment-element/stripe-payment-element.js +162 -162
- package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js +48 -19
- package/dist/collection/index.js +0 -1
- package/dist/collection/interfaces.js +0 -1
- package/dist/collection/services/address-element-manager.js +3 -4
- package/dist/collection/services/card-element-manager.js +3 -4
- package/dist/collection/services/currency-selector-element-manager.js +3 -4
- package/dist/collection/services/express-checkout-element-manager.js +9 -10
- package/dist/collection/services/factory.js +0 -1
- package/dist/collection/services/interfaces.js +0 -1
- package/dist/collection/services/link-authentication-element-manager.js +3 -4
- package/dist/collection/services/payment-element-manager.js +4 -5
- package/dist/collection/services/stripe-service.js +27 -10
- package/dist/collection/utils/element-finder.js +2 -3
- package/dist/collection/utils/error.js +0 -1
- package/dist/collection/utils/i18n.js +0 -1
- package/dist/collection/utils/platform.js +0 -1
- package/dist/collection/utils/test-setup.js +0 -1
- package/dist/collection/utils/utils.js +2 -3
- package/dist/components/error.js +1 -16
- package/dist/components/factory.js +1 -3736
- package/dist/components/icon.js +1 -459
- package/dist/components/index.d.ts +2 -0
- package/dist/components/index.js +1 -4
- package/dist/components/index2.js +1 -192
- package/dist/components/ion-icon.js +1 -9
- package/dist/components/stripe-address-element.js +1 -327
- package/dist/components/stripe-card-element-modal.js +1 -174
- package/dist/components/stripe-card-element.js +1 -9
- package/dist/components/stripe-card-element2.js +1 -440
- package/dist/components/stripe-currency-selector.js +1 -218
- package/dist/components/stripe-express-checkout-element.js +1 -332
- package/dist/components/stripe-link-authentication-element.js +1 -256
- package/dist/components/stripe-modal.js +1 -9
- package/dist/components/stripe-modal2.js +1 -112
- package/dist/components/stripe-payment-element.js +1 -510
- package/dist/components/stripe-payment-request-button.js +1 -9
- package/dist/components/stripe-payment-request-button2.js +1 -224
- package/dist/components/utils.js +1 -89
- package/dist/esm/app-globals-DQuL1Twl.js +0 -3
- package/dist/esm/error-XRfh5Wrs.js +0 -3
- package/dist/esm/{factory-Drde6-y7.js → factory-VTa1Gc94.js} +216 -77
- package/dist/esm/index-C6bbmyga.js +4677 -0
- package/dist/esm/{index-BHDCxQOb.js → index-CBXaOfXU.js} +24 -6
- package/dist/esm/index.js +0 -1
- package/dist/esm/ion-icon.entry.js +22 -13
- package/dist/esm/loader.js +3 -4
- package/dist/esm/stripe-address-element.entry.js +41 -26
- package/dist/esm/stripe-card-element-modal.entry.js +6 -7
- package/dist/esm/stripe-card-element_2.entry.js +129 -72
- package/dist/esm/stripe-currency-selector.entry.js +20 -10
- package/dist/esm/stripe-elements.js +32 -6
- package/dist/esm/stripe-express-checkout-element.entry.js +32 -22
- package/dist/esm/stripe-link-authentication-element.entry.js +20 -10
- package/dist/esm/stripe-payment-element.entry.js +283 -167
- package/dist/esm/stripe-payment-request-button.entry.js +27 -15
- package/dist/stripe-elements/index.esm.js +0 -2
- package/dist/stripe-elements/p-1bd46766.entry.js +1 -0
- package/dist/stripe-elements/p-1c6e0a45.entry.js +1 -0
- package/dist/stripe-elements/p-3f42ca0c.entry.js +1 -0
- package/dist/stripe-elements/p-5cf62945.entry.js +1 -0
- package/dist/stripe-elements/p-74de1556.entry.js +1 -0
- package/dist/stripe-elements/p-76e57d78.entry.js +1 -0
- package/dist/stripe-elements/p-840d499f.entry.js +1 -0
- package/dist/stripe-elements/p-C6bbmyga.js +2 -0
- package/dist/stripe-elements/p-CBXaOfXU.js +1 -0
- package/dist/stripe-elements/p-CrjrbGJ3.js +1 -0
- package/dist/stripe-elements/p-DQuL1Twl.js +1 -2
- package/dist/stripe-elements/p-XRfh5Wrs.js +1 -2
- package/dist/stripe-elements/p-ae0c336e.entry.js +1 -0
- package/dist/stripe-elements/p-cfd8e081.entry.js +1 -0
- package/dist/stripe-elements/stripe-elements.esm.js +1 -2
- package/dist/stripe-elements/svg/.gitignore +4 -0
- package/dist/types/components/stripe-address-element/stripe-address-element.d.ts +6 -0
- package/dist/types/components/stripe-card-element/stripe-card-element.d.ts +11 -1
- package/dist/types/components/stripe-card-element/stripe-card-element.helpers.d.ts +29 -0
- package/dist/types/components/stripe-card-element-modal/stripe-card-element-modal.d.ts +4 -4
- package/dist/types/components/stripe-currency-selector/stripe-currency-selector.d.ts +6 -0
- package/dist/types/components/stripe-express-checkout-element/stripe-express-checkout-element.d.ts +6 -0
- package/dist/types/components/stripe-link-authentication-element/stripe-link-authentication-element.d.ts +6 -0
- package/dist/types/components/stripe-modal/stripe-modal.d.ts +1 -0
- package/dist/types/components/stripe-payment-element/stripe-payment-element.d.ts +20 -2
- package/dist/types/components/stripe-payment-element/stripe-payment-element.helpers.d.ts +54 -0
- package/dist/types/components/stripe-payment-request-button/stripe-payment-request-button.d.ts +14 -1
- package/dist/types/components.d.ts +139 -29
- package/dist/types/index.d.ts +1 -0
- package/dist/types/services/interfaces.d.ts +4 -3
- package/dist/types/services/stripe-service.d.ts +8 -4
- package/dist/types/stencil-public-runtime.d.ts +110 -5
- package/package.json +50 -30
- package/readme.md +386 -133
- package/dist/cjs/app-globals-V2Kpy_OQ.js.map +0 -1
- package/dist/cjs/error-FFC4kSs5.js.map +0 -1
- package/dist/cjs/factory-CbbbSvkg.js.map +0 -1
- package/dist/cjs/index-BXVW_rzh.js +0 -1932
- package/dist/cjs/index-BXVW_rzh.js.map +0 -1
- package/dist/cjs/index-Ba1pBePA.js.map +0 -1
- package/dist/cjs/index.cjs.js.map +0 -1
- package/dist/cjs/ion-icon.entry.cjs.js.map +0 -1
- package/dist/cjs/loader.cjs.js.map +0 -1
- package/dist/cjs/stripe-address-element.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-card-element-modal.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-card-element.stripe-modal.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-currency-selector.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-elements.cjs.js.map +0 -1
- package/dist/cjs/stripe-express-checkout-element.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-link-authentication-element.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-payment-element.entry.cjs.js.map +0 -1
- package/dist/cjs/stripe-payment-request-button.entry.cjs.js.map +0 -1
- package/dist/collection/components/stripe-address-element/stripe-address-element.js.map +0 -1
- package/dist/collection/components/stripe-card-element/stripe-card-element.js.map +0 -1
- package/dist/collection/components/stripe-card-element-modal/stripe-card-element-modal.js.map +0 -1
- package/dist/collection/components/stripe-currency-selector/stripe-currency-selector.js.map +0 -1
- package/dist/collection/components/stripe-express-checkout-element/stripe-express-checkout-element.js.map +0 -1
- package/dist/collection/components/stripe-link-authentication-element/stripe-link-authentication-element.js.map +0 -1
- package/dist/collection/components/stripe-modal/stripe-modal.js.map +0 -1
- package/dist/collection/components/stripe-payment-element/stripe-payment-element.js.map +0 -1
- package/dist/collection/components/stripe-payment-request-button/stripe-payment-request-button.js.map +0 -1
- package/dist/collection/index.js.map +0 -1
- package/dist/collection/interfaces.js.map +0 -1
- package/dist/collection/services/address-element-manager.js.map +0 -1
- package/dist/collection/services/card-element-manager.js.map +0 -1
- package/dist/collection/services/currency-selector-element-manager.js.map +0 -1
- package/dist/collection/services/express-checkout-element-manager.js.map +0 -1
- package/dist/collection/services/factory.js.map +0 -1
- package/dist/collection/services/interfaces.js.map +0 -1
- package/dist/collection/services/link-authentication-element-manager.js.map +0 -1
- package/dist/collection/services/payment-element-manager.js.map +0 -1
- package/dist/collection/services/stripe-service.js.map +0 -1
- package/dist/collection/utils/element-finder.js.map +0 -1
- package/dist/collection/utils/error.js.map +0 -1
- package/dist/collection/utils/i18n.js.map +0 -1
- package/dist/collection/utils/platform.js.map +0 -1
- package/dist/collection/utils/test-setup.js.map +0 -1
- package/dist/collection/utils/utils.js.map +0 -1
- package/dist/components/error.js.map +0 -1
- package/dist/components/factory.js.map +0 -1
- package/dist/components/icon.js.map +0 -1
- package/dist/components/index.js.map +0 -1
- package/dist/components/index2.js.map +0 -1
- package/dist/components/ion-icon.js.map +0 -1
- package/dist/components/stripe-address-element.js.map +0 -1
- package/dist/components/stripe-card-element-modal.js.map +0 -1
- package/dist/components/stripe-card-element.js.map +0 -1
- package/dist/components/stripe-card-element2.js.map +0 -1
- package/dist/components/stripe-currency-selector.js.map +0 -1
- package/dist/components/stripe-express-checkout-element.js.map +0 -1
- package/dist/components/stripe-link-authentication-element.js.map +0 -1
- package/dist/components/stripe-modal.js.map +0 -1
- package/dist/components/stripe-modal2.js.map +0 -1
- package/dist/components/stripe-payment-element.js.map +0 -1
- package/dist/components/stripe-payment-request-button.js.map +0 -1
- package/dist/components/stripe-payment-request-button2.js.map +0 -1
- package/dist/components/utils.js.map +0 -1
- package/dist/esm/app-globals-DQuL1Twl.js.map +0 -1
- package/dist/esm/error-XRfh5Wrs.js.map +0 -1
- package/dist/esm/factory-Drde6-y7.js.map +0 -1
- package/dist/esm/index-BHDCxQOb.js.map +0 -1
- package/dist/esm/index-DJwTOfxZ.js +0 -1920
- package/dist/esm/index-DJwTOfxZ.js.map +0 -1
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/ion-icon.entry.js.map +0 -1
- package/dist/esm/loader.js.map +0 -1
- package/dist/esm/stripe-address-element.entry.js.map +0 -1
- package/dist/esm/stripe-card-element-modal.entry.js.map +0 -1
- package/dist/esm/stripe-card-element.stripe-modal.entry.js.map +0 -1
- package/dist/esm/stripe-currency-selector.entry.js.map +0 -1
- package/dist/esm/stripe-elements.js.map +0 -1
- package/dist/esm/stripe-express-checkout-element.entry.js.map +0 -1
- package/dist/esm/stripe-link-authentication-element.entry.js.map +0 -1
- package/dist/esm/stripe-payment-element.entry.js.map +0 -1
- package/dist/esm/stripe-payment-request-button.entry.js.map +0 -1
- package/dist/stripe-elements/index.esm.js.map +0 -1
- package/dist/stripe-elements/ion-icon.entry.esm.js.map +0 -1
- package/dist/stripe-elements/loader.esm.js.map +0 -1
- package/dist/stripe-elements/p-02f6e421.entry.js +0 -2
- package/dist/stripe-elements/p-02f6e421.entry.js.map +0 -1
- package/dist/stripe-elements/p-19888fa6.entry.js +0 -2
- package/dist/stripe-elements/p-19888fa6.entry.js.map +0 -1
- package/dist/stripe-elements/p-4d505729.entry.js +0 -2
- package/dist/stripe-elements/p-4d505729.entry.js.map +0 -1
- package/dist/stripe-elements/p-7e7ad92a.entry.js +0 -2
- package/dist/stripe-elements/p-7e7ad92a.entry.js.map +0 -1
- package/dist/stripe-elements/p-8bb4212c.entry.js +0 -2
- package/dist/stripe-elements/p-8bb4212c.entry.js.map +0 -1
- package/dist/stripe-elements/p-9aee2b6b.entry.js +0 -2
- package/dist/stripe-elements/p-9aee2b6b.entry.js.map +0 -1
- package/dist/stripe-elements/p-BHDCxQOb.js +0 -2
- package/dist/stripe-elements/p-BHDCxQOb.js.map +0 -1
- package/dist/stripe-elements/p-DI2vmGaI.js +0 -2
- package/dist/stripe-elements/p-DI2vmGaI.js.map +0 -1
- package/dist/stripe-elements/p-DJwTOfxZ.js +0 -3
- package/dist/stripe-elements/p-DJwTOfxZ.js.map +0 -1
- package/dist/stripe-elements/p-DQuL1Twl.js.map +0 -1
- package/dist/stripe-elements/p-XRfh5Wrs.js.map +0 -1
- package/dist/stripe-elements/p-ba251393.entry.js +0 -2
- package/dist/stripe-elements/p-ba251393.entry.js.map +0 -1
- package/dist/stripe-elements/p-c649edfc.entry.js +0 -2
- package/dist/stripe-elements/p-c649edfc.entry.js.map +0 -1
- package/dist/stripe-elements/p-e8bb43ae.entry.js +0 -2
- package/dist/stripe-elements/p-e8bb43ae.entry.js.map +0 -1
- package/dist/stripe-elements/stripe-address-element.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-card-element-modal.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-card-element.stripe-modal.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-currency-selector.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-elements.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-express-checkout-element.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-link-authentication-element.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-payment-element.entry.esm.js.map +0 -1
- package/dist/stripe-elements/stripe-payment-request-button.entry.esm.js.map +0 -1
|
@@ -1,256 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { c as checkPlatform } from './utils.js';
|
|
3
|
-
import { s as serviceFactory, i as i18n } from './factory.js';
|
|
4
|
-
|
|
5
|
-
const stripeLinkAuthenticationElementCss = ":root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}.stripe-link-authentication-wrap{box-sizing:border-box}.stripe-link-authentication-wrap *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:\"Roboto\", sans-serif;box-sizing:border-box}.stripe-link-authentication-wrap button{cursor:pointer}.stripe-link-authentication-wrap{display:block;width:100%;background:#fff;padding:16px}.stripe-link-authentication-wrap .stripe-link-authentication-container #link-authentication-element .StripeElement{padding:8px 16px;min-height:64px;border-radius:6px;display:flex;justify-content:center;align-items:center}.stripe-link-authentication-wrap .stripe-link-authentication-container #link-authentication-element .StripeElement>.__PrivateStripeElement{width:100%}.stripe-link-authentication-wrap .stripe-link-authentication-container .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}";
|
|
6
|
-
|
|
7
|
-
const StripeLinkAuthenticationElement$1 = /*@__PURE__*/ proxyCustomElement(class StripeLinkAuthenticationElement extends HTMLElement {
|
|
8
|
-
updatePublishableKey(publishableKey) {
|
|
9
|
-
const options = {};
|
|
10
|
-
if (this.stripeAccount) {
|
|
11
|
-
options.stripeAccount = this.stripeAccount;
|
|
12
|
-
}
|
|
13
|
-
this.initStripe(publishableKey, Object.keys(options).length ? options : undefined);
|
|
14
|
-
}
|
|
15
|
-
updateStripeAccountId(stripeAccount) {
|
|
16
|
-
const publishableKey = this.stripeService.state.publishableKey || this.publishableKey;
|
|
17
|
-
if (!publishableKey) {
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
this.initStripe(publishableKey, {
|
|
21
|
-
stripeAccount,
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Get Stripe.js, and initialize elements
|
|
26
|
-
* @param publishableKey
|
|
27
|
-
* @param options
|
|
28
|
-
* @example
|
|
29
|
-
* ```
|
|
30
|
-
* const stripeElement = document.createElement('stripe-link-authentication-element');
|
|
31
|
-
* customElements
|
|
32
|
-
* .whenDefined('stripe-link-authentication-element')
|
|
33
|
-
* .then(() => {
|
|
34
|
-
* stripeElement.initStripe('pk_test_XXXXXXXXX')
|
|
35
|
-
* })
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
async initStripe(publishableKey, options) {
|
|
39
|
-
await this.stripeService.initialize(publishableKey, {
|
|
40
|
-
stripeAccount: options === null || options === void 0 ? void 0 : options.stripeAccount,
|
|
41
|
-
applicationName: this.applicationName,
|
|
42
|
-
});
|
|
43
|
-
// If already successfully loaded, initialize elements immediately
|
|
44
|
-
if (this.stripeService.state.loadStripeStatus === 'success') {
|
|
45
|
-
await this.initElement();
|
|
46
|
-
this.stripeLoadedEventHandler();
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
// Otherwise, wait for successful load
|
|
50
|
-
const unsubscribe = this.stripeService.onChange('loadStripeStatus', async (newState) => {
|
|
51
|
-
if (newState !== 'success') {
|
|
52
|
-
return;
|
|
53
|
-
}
|
|
54
|
-
await this.initElement();
|
|
55
|
-
this.stripeLoadedEventHandler();
|
|
56
|
-
unsubscribe(); // Clean up listener after first success
|
|
57
|
-
});
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Update the progress status
|
|
62
|
-
* @param progress
|
|
63
|
-
* @returns
|
|
64
|
-
* @example
|
|
65
|
-
* ```
|
|
66
|
-
* const stripeElement = document.createElement('stripe-link-authentication-element');
|
|
67
|
-
* customElements
|
|
68
|
-
* .whenDefined('stripe-link-authentication-element')
|
|
69
|
-
* .then(() => {
|
|
70
|
-
* stripeElement.updateProgress('success')
|
|
71
|
-
* })
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
async updateProgress(progress) {
|
|
75
|
-
this.progress = progress;
|
|
76
|
-
return this;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Set error message
|
|
80
|
-
* @param errorMessage string
|
|
81
|
-
* @returns
|
|
82
|
-
* @example
|
|
83
|
-
* ```
|
|
84
|
-
* const stripeElement = document.createElement('stripe-link-authentication-element');
|
|
85
|
-
* customElements
|
|
86
|
-
* .whenDefined('stripe-link-authentication-element')
|
|
87
|
-
* .then(() => {
|
|
88
|
-
* stripeElement.setErrorMessage('Invalid email address')
|
|
89
|
-
* })
|
|
90
|
-
* ```
|
|
91
|
-
*/
|
|
92
|
-
async setErrorMessage(errorMessage) {
|
|
93
|
-
this.linkAuthenticationElementManager.setError(errorMessage);
|
|
94
|
-
return this;
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* Get the current email value from the element
|
|
98
|
-
* @returns {Promise<string | undefined>} The current email value or undefined
|
|
99
|
-
* @example
|
|
100
|
-
* ```
|
|
101
|
-
* const stripeElement = document.createElement('stripe-link-authentication-element');
|
|
102
|
-
* customElements
|
|
103
|
-
* .whenDefined('stripe-link-authentication-element')
|
|
104
|
-
* .then(async () => {
|
|
105
|
-
* const email = await stripeElement.getEmail();
|
|
106
|
-
* console.log(email);
|
|
107
|
-
* })
|
|
108
|
-
* ```
|
|
109
|
-
*/
|
|
110
|
-
async getEmail() {
|
|
111
|
-
return this.linkAuthenticationElementManager.getState().email;
|
|
112
|
-
}
|
|
113
|
-
stripeLoadedEventHandler() {
|
|
114
|
-
const stripe = this.stripeService.getStripe();
|
|
115
|
-
if (!stripe) {
|
|
116
|
-
console.error('Stripe instance is not available');
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
|
-
const event = {
|
|
120
|
-
stripe,
|
|
121
|
-
};
|
|
122
|
-
if (this.stripeDidLoaded) {
|
|
123
|
-
this.stripeDidLoaded(event);
|
|
124
|
-
}
|
|
125
|
-
this.stripeLoaded.emit(event);
|
|
126
|
-
}
|
|
127
|
-
linkAuthenticationChangeEventHandler(email) {
|
|
128
|
-
const linkAuthenticationElement = this.linkAuthenticationElementManager.getElement();
|
|
129
|
-
const stripe = this.stripeService.getStripe();
|
|
130
|
-
if (!linkAuthenticationElement || !stripe) {
|
|
131
|
-
console.error('Link Authentication Element not initialized');
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
const event = {
|
|
135
|
-
stripe,
|
|
136
|
-
linkAuthenticationElement,
|
|
137
|
-
email,
|
|
138
|
-
};
|
|
139
|
-
if (this.handleChange) {
|
|
140
|
-
this.handleChange(event);
|
|
141
|
-
}
|
|
142
|
-
this.linkAuthenticationChange.emit(event);
|
|
143
|
-
}
|
|
144
|
-
componentWillRender() {
|
|
145
|
-
if (!this.stripeService.state.publishableKey) {
|
|
146
|
-
return;
|
|
147
|
-
}
|
|
148
|
-
if (['success', 'loading'].includes(this.stripeService.state.loadStripeStatus)) {
|
|
149
|
-
return;
|
|
150
|
-
}
|
|
151
|
-
this.initStripe(this.stripeService.state.publishableKey, {
|
|
152
|
-
stripeAccount: this.stripeService.state.stripeAccount,
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
constructor(registerHost) {
|
|
156
|
-
super();
|
|
157
|
-
if (registerHost !== false) {
|
|
158
|
-
this.__registerHost();
|
|
159
|
-
}
|
|
160
|
-
this.stripeLoaded = createEvent(this, "stripeLoaded", 7);
|
|
161
|
-
this.linkAuthenticationChange = createEvent(this, "linkAuthenticationChange", 7);
|
|
162
|
-
/**
|
|
163
|
-
* Overwrite the application name that registered
|
|
164
|
-
* For wrapper library (like Capacitor)
|
|
165
|
-
*/
|
|
166
|
-
this.applicationName = 'stripe-pwa-elements';
|
|
167
|
-
/**
|
|
168
|
-
* The progress status
|
|
169
|
-
*/
|
|
170
|
-
this.progress = '';
|
|
171
|
-
// Dependency Injection via factory
|
|
172
|
-
this.stripeService = serviceFactory.createStripeService();
|
|
173
|
-
this.linkAuthenticationElementManager = serviceFactory.createLinkAuthenticationElementManager(this.stripeService);
|
|
174
|
-
if (this.publishableKey) {
|
|
175
|
-
this.initStripe(this.publishableKey, {
|
|
176
|
-
stripeAccount: this.stripeAccount,
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
/**
|
|
181
|
-
* Initialize Component using Stripe Element
|
|
182
|
-
*/
|
|
183
|
-
async initElement() {
|
|
184
|
-
const options = {};
|
|
185
|
-
if (this.defaultEmail) {
|
|
186
|
-
options.defaultValues = {
|
|
187
|
-
email: this.defaultEmail,
|
|
188
|
-
};
|
|
189
|
-
}
|
|
190
|
-
// Initialize link authentication element
|
|
191
|
-
await this.linkAuthenticationElementManager.initialize(this.el, Object.keys(options).length ? options : undefined);
|
|
192
|
-
// Listen for email changes from the manager's store
|
|
193
|
-
this.linkAuthenticationElementManager.onChange('email', email => {
|
|
194
|
-
this.linkAuthenticationChangeEventHandler(email);
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
componentDidLoad() {
|
|
198
|
-
const platform = checkPlatform();
|
|
199
|
-
if (platform) {
|
|
200
|
-
this.el.classList.add(platform);
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
disconnectedCallback() {
|
|
204
|
-
this.linkAuthenticationElementManager.unmount();
|
|
205
|
-
}
|
|
206
|
-
render() {
|
|
207
|
-
const { loadStripeStatus } = this.stripeService.state;
|
|
208
|
-
const { errorMessage } = this.linkAuthenticationElementManager.getState();
|
|
209
|
-
if (loadStripeStatus === 'failure') {
|
|
210
|
-
return h("p", null, i18n.t('Failed to load Stripe'));
|
|
211
|
-
}
|
|
212
|
-
return (h("div", { class: "stripe-link-authentication-wrap" }, h("div", { class: "stripe-link-authentication-container" }, h("div", { id: "link-authentication-element" }), h("div", { id: "link-authentication-errors", class: "stripe-element-errors" }, errorMessage))));
|
|
213
|
-
}
|
|
214
|
-
get el() { return this; }
|
|
215
|
-
static get watchers() { return {
|
|
216
|
-
"publishableKey": ["updatePublishableKey"],
|
|
217
|
-
"stripeAccount": ["updateStripeAccountId"]
|
|
218
|
-
}; }
|
|
219
|
-
static get style() { return stripeLinkAuthenticationElementCss; }
|
|
220
|
-
}, [256, "stripe-link-authentication-element", {
|
|
221
|
-
"publishableKey": [1, "publishable-key"],
|
|
222
|
-
"stripeAccount": [1, "stripe-account"],
|
|
223
|
-
"applicationName": [1, "application-name"],
|
|
224
|
-
"defaultEmail": [1, "default-email"],
|
|
225
|
-
"handleChange": [1040],
|
|
226
|
-
"stripeDidLoaded": [1040],
|
|
227
|
-
"progress": [32],
|
|
228
|
-
"initStripe": [64],
|
|
229
|
-
"updateProgress": [64],
|
|
230
|
-
"setErrorMessage": [64],
|
|
231
|
-
"getEmail": [64]
|
|
232
|
-
}, undefined, {
|
|
233
|
-
"publishableKey": ["updatePublishableKey"],
|
|
234
|
-
"stripeAccount": ["updateStripeAccountId"]
|
|
235
|
-
}]);
|
|
236
|
-
function defineCustomElement$1() {
|
|
237
|
-
if (typeof customElements === "undefined") {
|
|
238
|
-
return;
|
|
239
|
-
}
|
|
240
|
-
const components = ["stripe-link-authentication-element"];
|
|
241
|
-
components.forEach(tagName => { switch (tagName) {
|
|
242
|
-
case "stripe-link-authentication-element":
|
|
243
|
-
if (!customElements.get(tagName)) {
|
|
244
|
-
customElements.define(tagName, StripeLinkAuthenticationElement$1);
|
|
245
|
-
}
|
|
246
|
-
break;
|
|
247
|
-
} });
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
const StripeLinkAuthenticationElement = StripeLinkAuthenticationElement$1;
|
|
251
|
-
const defineCustomElement = defineCustomElement$1;
|
|
252
|
-
|
|
253
|
-
export { StripeLinkAuthenticationElement, defineCustomElement };
|
|
254
|
-
//# sourceMappingURL=stripe-link-authentication-element.js.map
|
|
255
|
-
|
|
256
|
-
//# sourceMappingURL=stripe-link-authentication-element.js.map
|
|
1
|
+
import{transformTag as t,proxyCustomElement as i,HTMLElement as e,createEvent as n,h as s}from"@stencil/core/internal/client";import{c as a}from"./utils.js";import{s as r,i as o}from"./factory.js";const c=i(class extends e{updatePublishableKey(t){const i={};this.stripeAccount&&(i.stripeAccount=this.stripeAccount),this.initStripe(t,Object.keys(i).length?i:void 0)}updateStripeAccountId(t){const i=this.stripeService.state.publishableKey||this.publishableKey;i&&this.initStripe(i,{stripeAccount:t})}async initStripe(t,i){if(await this.stripeService.initialize(t,{stripeAccount:null==i?void 0:i.stripeAccount,applicationName:this.applicationName}),"success"===this.stripeService.state.loadStripeStatus)await this.initElement(),this.stripeLoadedEventHandler();else{const t=this.stripeService.onChange("loadStripeStatus",(async i=>{"success"===i&&(await this.initElement(),this.stripeLoadedEventHandler(),t())}))}}async updateProgress(t){return this.progress=t,this}async setErrorMessage(t){return this.linkAuthenticationElementManager.setError(t),this}async getEmail(){return this.linkAuthenticationElementManager.getState().email}stripeLoadedEventHandler(){const t=this.stripeService.getStripe();if(!t)return void console.error("Stripe instance is not available");const i={stripe:t};this.stripeDidLoaded&&this.stripeDidLoaded(i),this.stripeLoaded.emit(i)}linkAuthenticationChangeEventHandler(t){const i=this.linkAuthenticationElementManager.getElement(),e=this.stripeService.getStripe();if(!i||!e)return void console.error("Link Authentication Element not initialized");const n={stripe:e,linkAuthenticationElement:i,email:t};this.handleChange&&this.handleChange(n),this.linkAuthenticationChange.emit(n)}componentWillRender(){this.stripeService.state.publishableKey&&(["success","loading"].includes(this.stripeService.state.loadStripeStatus)||this.initStripe(this.stripeService.state.publishableKey,{stripeAccount:this.stripeService.state.stripeAccount}))}constructor(t){super(),!1!==t&&this.__registerHost(),this.stripeLoaded=n(this,"stripeLoaded",7),this.linkAuthenticationChange=n(this,"linkAuthenticationChange",7),this.applicationName="stripe-pwa-elements",this.progress="",this.stripeService=r.createStripeService(),this.linkAuthenticationElementManager=r.createLinkAuthenticationElementManager(this.stripeService)}componentWillLoad(){this.publishableKey&&this.initStripe(this.publishableKey,{stripeAccount:this.stripeAccount})}async initElement(){const t={};this.defaultEmail&&(t.defaultValues={email:this.defaultEmail}),await this.linkAuthenticationElementManager.initialize(this.el,Object.keys(t).length?t:void 0),this.linkAuthenticationElementManager.onChange("email",(t=>{this.linkAuthenticationChangeEventHandler(t)}))}componentDidLoad(){const t=a();t&&this.el.classList.add(t)}disconnectedCallback(){this.linkAuthenticationElementManager.unmount()}render(){const{loadStripeStatus:t}=this.stripeService.state,{errorMessage:i}=this.linkAuthenticationElementManager.getState();return"failure"===t?s("p",null,o.t("Failed to load Stripe")):s("div",{class:"stripe-link-authentication-wrap"},s("div",{class:"stripe-link-authentication-container"},s("div",{id:"link-authentication-element"}),s("div",{id:"link-authentication-errors",class:"stripe-element-errors"},i)))}get el(){return this}static get watchers(){return{publishableKey:[{updatePublishableKey:0}],stripeAccount:[{updateStripeAccountId:0}]}}static get style(){return':root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}.stripe-link-authentication-wrap{box-sizing:border-box}.stripe-link-authentication-wrap *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}.stripe-link-authentication-wrap button{cursor:pointer}.stripe-link-authentication-wrap{display:block;width:100%;background:#fff;padding:16px}.stripe-link-authentication-wrap .stripe-link-authentication-container #link-authentication-element .StripeElement{padding:8px 16px;min-height:64px;border-radius:6px;display:flex;justify-content:center;align-items:center}.stripe-link-authentication-wrap .stripe-link-authentication-container #link-authentication-element .StripeElement>.__PrivateStripeElement{width:100%}.stripe-link-authentication-wrap .stripe-link-authentication-container .stripe-element-errors{margin-top:8px;font-size:14px;color:var(--color-text-error)}'}},[0,"stripe-link-authentication-element",{publishableKey:[1,"publishable-key"],stripeAccount:[1,"stripe-account"],applicationName:[1,"application-name"],defaultEmail:[1,"default-email"],handleChange:[1040],stripeDidLoaded:[1040],progress:[32],initStripe:[64],updateProgress:[64],setErrorMessage:[64],getEmail:[64]},void 0,{publishableKey:[{updatePublishableKey:0}],stripeAccount:[{updateStripeAccountId:0}]}]);function l(){"undefined"!=typeof customElements&&["stripe-link-authentication-element"].forEach((i=>{"stripe-link-authentication-element"===i&&(customElements.get(t(i))||customElements.define(t(i),c))}))}l();const h=c,p=l;export{h as StripeLinkAuthenticationElement,p as defineCustomElement}
|
|
@@ -1,9 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
const StripeModal = StripeModal$1;
|
|
4
|
-
const defineCustomElement = defineCustomElement$1;
|
|
5
|
-
|
|
6
|
-
export { StripeModal, defineCustomElement };
|
|
7
|
-
//# sourceMappingURL=stripe-modal.js.map
|
|
8
|
-
|
|
9
|
-
//# sourceMappingURL=stripe-modal.js.map
|
|
1
|
+
import{S as o,d as s}from"./stripe-modal2.js";const r=o,t=s;export{r as StripeModal,t as defineCustomElement}
|
|
@@ -1,112 +1 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { c as checkPlatform } from './utils.js';
|
|
3
|
-
import { d as defineCustomElement$1 } from './icon.js';
|
|
4
|
-
|
|
5
|
-
const stripeModalCss = ":root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}:host{box-sizing:border-box}:host *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:\"Roboto\", sans-serif;box-sizing:border-box}:host button{cursor:pointer}:host{display:block}.modal-row{opacity:0;pointer-events:none;will-change:transform}.modal-row.open{opacity:1;pointer-events:auto;position:fixed;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:1ch;background:rgba(0, 0, 0, 0.3)}.modal-row .modal-child{transform:translateY(100%);transition:transform 420ms ease;position:relative}.modal-row .modal-child .modal-loading{display:none;position:absolute;top:160px;left:50%;transform:translateX(-50%);width:24px;height:24px}.modal-row .modal-child.loading .modal-loading{display:flex;justify-content:center;align-items:center}.modal-row .modal-child.loading .modal-loading svg{width:24px;height:24px}.modal-row .modal-child.loading .modal-content{visibility:hidden}.modal-row.open .modal-child{transform:translateY(0%)}.modal-child{padding:16px 8px 24px;background-color:#fff;width:100%}.modal-close-button-wrap{padding-left:8px}.modal-close-button-wrap .modal-close-button{width:32px;display:block;fill:var(--color-label);cursor:pointer}";
|
|
6
|
-
|
|
7
|
-
const StripeModal = /*@__PURE__*/ proxyCustomElement(class StripeModal extends HTMLElement {
|
|
8
|
-
constructor(registerHost) {
|
|
9
|
-
super();
|
|
10
|
-
if (registerHost !== false) {
|
|
11
|
-
this.__registerHost();
|
|
12
|
-
}
|
|
13
|
-
this.__attachShadow();
|
|
14
|
-
this.close = createEvent(this, "close", 7);
|
|
15
|
-
/**
|
|
16
|
-
* If true, the modal display close button
|
|
17
|
-
*/
|
|
18
|
-
this.showCloseButton = true;
|
|
19
|
-
/**
|
|
20
|
-
* Modal state.
|
|
21
|
-
* If true, the modal will open
|
|
22
|
-
*/
|
|
23
|
-
this.open = false;
|
|
24
|
-
/**
|
|
25
|
-
* Effect `this.open`. This is for animation.
|
|
26
|
-
* Ionic Ref: https://github.com/ionic-team/ionic-framework/blob/main/core/src/components/accordion/accordion.tsx#L83
|
|
27
|
-
*/
|
|
28
|
-
this.renderedOpen = false;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Toggle modal state
|
|
32
|
-
*/
|
|
33
|
-
async toggleModal() {
|
|
34
|
-
this.open ? await this.closeModal() : await this.openModal();
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Open the modal
|
|
38
|
-
*/
|
|
39
|
-
async openModal() {
|
|
40
|
-
this.open = true;
|
|
41
|
-
this.openModalAnimation();
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Close the modal
|
|
45
|
-
*/
|
|
46
|
-
async closeModal() {
|
|
47
|
-
this.open = false;
|
|
48
|
-
this.renderedOpen = false;
|
|
49
|
-
this.close.emit();
|
|
50
|
-
}
|
|
51
|
-
componentDidLoad() {
|
|
52
|
-
const platformName = checkPlatform();
|
|
53
|
-
if (platformName) {
|
|
54
|
-
this.el.classList.add(platformName);
|
|
55
|
-
}
|
|
56
|
-
if (this.open) {
|
|
57
|
-
this.openModalAnimation();
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
openModalAnimation() {
|
|
61
|
-
if (!this.el.shadowRoot) {
|
|
62
|
-
this.renderedOpen = true;
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
const modalChild = this.el.shadowRoot.querySelector('.modal-child');
|
|
66
|
-
modalChild.classList.add('loading');
|
|
67
|
-
modalChild.style.willChange = 'transform';
|
|
68
|
-
modalChild.addEventListener('transitionend', () => {
|
|
69
|
-
modalChild.style.willChange = 'auto';
|
|
70
|
-
modalChild.classList.remove('loading');
|
|
71
|
-
}, { once: true });
|
|
72
|
-
requestAnimationFrame(() => {
|
|
73
|
-
this.renderedOpen = true;
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
render() {
|
|
77
|
-
const { renderedOpen, showCloseButton } = this;
|
|
78
|
-
return (h(Host, { key: 'dee14229db3c17744ae5013e5f9aab813a77880b' }, h("div", { key: 'c82f4f18286a3d341932bacf09973da80ee2acdd', class: `modal-row${renderedOpen ? ' open' : ''}`, onClick: () => this.closeModal() }, h("div", { key: '20b5dc2db1509486e74ff2f6049f5c27de4d4793', class: "modal-child", onClick: e => e.stopPropagation() }, showCloseButton ? (h("div", { class: "modal-close-button-wrap" }, h("ion-icon", { name: "close", size: "large", class: "modal-close-button", onClick: () => this.closeModal() }))) : null, h("div", { key: '863c6285045ad9dcbfeb286ee8ffa8aa1581f90e', class: "modal-loading" }, h("svg", { key: 'ba5d9e80236600f4b64a7fa735d49241eb1c3f29', version: "1.1", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 2400 2400" }, h("g", { key: '290f7a2e79dc54f36603fa4a6b7d3922e4d1f432', "stroke-width": "200", "stroke-linecap": "round", stroke: "currentColor", fill: "none", id: "spinner" }, h("line", { key: '92cafdfad5a2631046bdd5f1fb6431b623808961', x1: "1200", y1: "600", x2: "1200", y2: "100" }), h("line", { key: '8b6e7260dcc41f969c7bac0fec073928e8e146a7', opacity: "0.5", x1: "1200", y1: "2300", x2: "1200", y2: "1800" }), h("line", { key: 'a5eb02131aa60cd6126a2be5f874e8f3bf3b6d5f', opacity: "0.917", x1: "900", y1: "680.4", x2: "650", y2: "247.4" }), h("line", { key: '1052903918a67fc53c0df06af43ad564fc9180f7', opacity: "0.417", x1: "1750", y1: "2152.6", x2: "1500", y2: "1719.6" }), h("line", { key: 'ac37ac0104a2738375b8f71481b826ae63730dce', opacity: "0.833", x1: "680.4", y1: "900", x2: "247.4", y2: "650" }), h("line", { key: '0623f6448f636a6f5f65cb68387ab81381a56acf', opacity: "0.333", x1: "2152.6", y1: "1750", x2: "1719.6", y2: "1500" }), h("line", { key: 'f3dbc37979ad51676728ac79eccab6d7be4d9192', opacity: "0.75", x1: "600", y1: "1200", x2: "100", y2: "1200" }), h("line", { key: 'c5d92ff42dbe24d6c2136b24cdf2d57835f11b76', opacity: "0.25", x1: "2300", y1: "1200", x2: "1800", y2: "1200" }), h("line", { key: '3339f4fefcc7222050da34aa7b8b60c9ac511aea', opacity: "0.667", x1: "680.4", y1: "1500", x2: "247.4", y2: "1750" }), h("line", { key: '7ddc8d68d7f7deb0fe377b508180bc0b1123bf7f', opacity: "0.167", x1: "2152.6", y1: "650", x2: "1719.6", y2: "900" }), h("line", { key: '8825e19d81b7ade6d1ee327ac7b8bc24607a7c47', opacity: "0.583", x1: "900", y1: "1719.6", x2: "650", y2: "2152.6" }), h("line", { key: '9562d8c1dcc59a4884cff618edc35e951b19794c', opacity: "0.083", x1: "1750", y1: "247.4", x2: "1500", y2: "680.4" }), h("animateTransform", { key: '648f2a04edef2c2908782aa2296e4dba2b27d7b1', attributeName: "transform", attributeType: "XML", type: "rotate", keyTimes: "0;0.08333;0.16667;0.25;0.33333;0.41667;0.5;0.58333;0.66667;0.75;0.83333;0.91667", values: "0 1199 1199;30 1199 1199;60 1199 1199;90 1199 1199;120 1199 1199;150 1199 1199;180 1199 1199;210 1199 1199;240 1199 1199;270 1199 1199;300 1199 1199;330 1199 1199", dur: "0.83333s", begin: "0s", repeatCount: "indefinite", calcMode: "discrete" })))), h("div", { key: 'a86fb232eb5df0737c870e0e788c0c1e230b434e', class: "modal-content" }, h("slot", { key: 'b5ee41fc9dd113c3e2716f01350641fc2adebd7b' }))))));
|
|
79
|
-
}
|
|
80
|
-
get el() { return this; }
|
|
81
|
-
static get style() { return stripeModalCss; }
|
|
82
|
-
}, [257, "stripe-modal", {
|
|
83
|
-
"showCloseButton": [4, "show-close-button"],
|
|
84
|
-
"open": [4],
|
|
85
|
-
"renderedOpen": [32],
|
|
86
|
-
"toggleModal": [64],
|
|
87
|
-
"openModal": [64],
|
|
88
|
-
"closeModal": [64]
|
|
89
|
-
}]);
|
|
90
|
-
function defineCustomElement() {
|
|
91
|
-
if (typeof customElements === "undefined") {
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
const components = ["stripe-modal", "ion-icon"];
|
|
95
|
-
components.forEach(tagName => { switch (tagName) {
|
|
96
|
-
case "stripe-modal":
|
|
97
|
-
if (!customElements.get(tagName)) {
|
|
98
|
-
customElements.define(tagName, StripeModal);
|
|
99
|
-
}
|
|
100
|
-
break;
|
|
101
|
-
case "ion-icon":
|
|
102
|
-
if (!customElements.get(tagName)) {
|
|
103
|
-
defineCustomElement$1();
|
|
104
|
-
}
|
|
105
|
-
break;
|
|
106
|
-
} });
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export { StripeModal as S, defineCustomElement as d };
|
|
110
|
-
//# sourceMappingURL=stripe-modal2.js.map
|
|
111
|
-
|
|
112
|
-
//# sourceMappingURL=stripe-modal2.js.map
|
|
1
|
+
import{transformTag as e,proxyCustomElement as o,HTMLElement as a,createEvent as t,h as i,Host as n}from"@stencil/core/internal/client";import{c}from"./utils.js";import{d as l}from"./icon.js";const d=o(class extends a{constructor(e){super(),!1!==e&&this.__registerHost(),this.__attachShadow(),this.close=t(this,"close",7),this.showCloseButton=!0,this.open=!1,this.renderedOpen=!1}onOpenChange(e){e?this.openModalAnimation():(this.renderedOpen=!1,this.close.emit())}async toggleModal(){this.open?await this.closeModal():await this.openModal()}async openModal(){this.open=!0}async closeModal(){this.open=!1}componentDidLoad(){const e=c();e&&this.el.classList.add(e),this.open&&this.openModalAnimation()}openModalAnimation(){if(!this.el.shadowRoot)return void(this.renderedOpen=!0);const e=this.el.shadowRoot.querySelector(".modal-child");e.classList.add("loading"),e.style.willChange="transform",e.addEventListener("transitionend",(()=>{e.style.willChange="auto",e.classList.remove("loading")}),{once:!0}),requestAnimationFrame((()=>{this.renderedOpen=this.open}))}render(){const{renderedOpen:e,showCloseButton:o}=this;return i(n,{key:"38fb86acf7cf5887a426c67b1a1271f7fae7048c"},i("div",{key:"f751d92c327ee2e564edfcd4d18f4dca43c20c37",class:"modal-row"+(e?" open":""),onClick:()=>this.closeModal()},i("div",{key:"11519ccd44a5069df3247c530a2c1e114eab7aef",class:"modal-child",onClick:e=>e.stopPropagation()},o?i("div",{class:"modal-close-button-wrap"},i("ion-icon",{name:"close",size:"large",class:"modal-close-button",onClick:()=>this.closeModal()})):null,i("div",{key:"a41f7f263b488b5bbc2a999cbabf6b9e407bca85",class:"modal-loading"},i("svg",{key:"0b3b25cb2812bc4d837fb4b7e6af4a5f42f0247e",version:"1.1",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2400 2400"},i("g",{key:"10a9f9ec59699e6d2988b9c65cd02da1754fd760","stroke-width":"200","stroke-linecap":"round",stroke:"currentColor",fill:"none",id:"spinner"},i("line",{key:"ed271fa584b930ceed5397c271b31e0d48c72f72",x1:"1200",y1:"600",x2:"1200",y2:"100"}),i("line",{key:"3cf855a84f3ab58b914b7aeb784fbc5b95d8ae94",opacity:"0.5",x1:"1200",y1:"2300",x2:"1200",y2:"1800"}),i("line",{key:"2cce4b62a276399235509e94f47a63acf9c69a0f",opacity:"0.917",x1:"900",y1:"680.4",x2:"650",y2:"247.4"}),i("line",{key:"64c175ef068591417b043f7630a44d34eae7cb59",opacity:"0.417",x1:"1750",y1:"2152.6",x2:"1500",y2:"1719.6"}),i("line",{key:"0856a654e3aa756dfb1e9fc316b8b379fa9d5a4e",opacity:"0.833",x1:"680.4",y1:"900",x2:"247.4",y2:"650"}),i("line",{key:"c60f1f8495df9b8cdcc8941255d08c01a0e1c02f",opacity:"0.333",x1:"2152.6",y1:"1750",x2:"1719.6",y2:"1500"}),i("line",{key:"204bc2a7765e43b86f91c3fb9b1e72a3a39bb323",opacity:"0.75",x1:"600",y1:"1200",x2:"100",y2:"1200"}),i("line",{key:"7584b272f9efd7f746c1bcc5c8a5576098b02381",opacity:"0.25",x1:"2300",y1:"1200",x2:"1800",y2:"1200"}),i("line",{key:"7a053e9eb5f0da3fbf6fb7c9680bf73073bb126d",opacity:"0.667",x1:"680.4",y1:"1500",x2:"247.4",y2:"1750"}),i("line",{key:"f8b817095143d739589e45c99b03c7afbdfc8293",opacity:"0.167",x1:"2152.6",y1:"650",x2:"1719.6",y2:"900"}),i("line",{key:"aae0e36dbdfff44196f9758c8a5ed2337139ebe0",opacity:"0.583",x1:"900",y1:"1719.6",x2:"650",y2:"2152.6"}),i("line",{key:"3a257b30cb289f29ba386ccca7519bcdc22c3786",opacity:"0.083",x1:"1750",y1:"247.4",x2:"1500",y2:"680.4"}),i("animateTransform",{key:"c6b8e73025589403dd3d08f84b02eb824763d056",attributeName:"transform",attributeType:"XML",type:"rotate",keyTimes:"0;0.08333;0.16667;0.25;0.33333;0.41667;0.5;0.58333;0.66667;0.75;0.83333;0.91667",values:"0 1199 1199;30 1199 1199;60 1199 1199;90 1199 1199;120 1199 1199;150 1199 1199;180 1199 1199;210 1199 1199;240 1199 1199;270 1199 1199;300 1199 1199;330 1199 1199",dur:"0.83333s",begin:"0s",repeatCount:"indefinite",calcMode:"discrete"})))),i("div",{key:"da5ef8031e5b826d854a065d8172389cdd84fbf0",class:"modal-content"},i("slot",{key:"fbe97a3a4d5489de5ae6f49342c58d537b317842"})))))}get el(){return this}static get watchers(){return{open:[{onOpenChange:0}]}}static get style(){return':root{--color-label:#565656;--color-placeholder:#acacac;--color-heading-text:#333;--color-text-error:#ef4444;--color-input-border:#e4e4e6;--color-input-border-shadow:rgba(228, 228, 230, 0.6);--color-button-text:rgba(255, 255, 255, 0.95);--color-button-text-disabled:rgba(255, 255, 255, 0.4);--color-primary:#0074d4}:host{box-sizing:border-box}:host *:where(:not(iframe,canvas,img,svg,video):not(svg *)){all:unset;display:revert;background:none;border:none;font-family:"Roboto", sans-serif;box-sizing:border-box}:host button{cursor:pointer}:host{display:block}.modal-row{opacity:0;pointer-events:none;will-change:transform}.modal-row.open{opacity:1;pointer-events:auto;position:fixed;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:flex-end;gap:1ch;background:rgba(0, 0, 0, 0.3)}.modal-row .modal-child{transform:translateY(100%);transition:transform 420ms ease;position:relative}.modal-row .modal-child .modal-loading{display:none;position:absolute;top:160px;left:50%;transform:translateX(-50%);width:24px;height:24px}.modal-row .modal-child.loading .modal-loading{display:flex;justify-content:center;align-items:center}.modal-row .modal-child.loading .modal-loading svg{width:24px;height:24px}.modal-row .modal-child.loading .modal-content{visibility:hidden}.modal-row.open .modal-child{transform:translateY(0%)}.modal-child{padding:16px 8px 24px;background-color:#fff;width:100%}.modal-close-button-wrap{padding-left:8px}.modal-close-button-wrap .modal-close-button{width:32px;display:block;fill:var(--color-label);cursor:pointer}'}},[257,"stripe-modal",{showCloseButton:[4,"show-close-button"],open:[1028],renderedOpen:[32],toggleModal:[64],openModal:[64],closeModal:[64]},void 0,{open:[{onOpenChange:0}]}]);function s(){"undefined"!=typeof customElements&&["stripe-modal","ion-icon"].forEach((o=>{switch(o){case"stripe-modal":customElements.get(e(o))||customElements.define(e(o),d);break;case"ion-icon":customElements.get(e(o))||l()}}))}s();export{d as S,s as d}
|