@justifi/webcomponents 0.0.15 → 0.2.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/CHANGELOG.md +45 -0
- package/changelog-template.hbs +41 -0
- package/dist/cjs/{index-e1b45289.js → index-ca2cd154.js} +456 -97
- package/dist/cjs/justifi-bank-account-form.cjs.entry.js +59 -0
- package/dist/cjs/justifi-billing-form.cjs.entry.js +2150 -0
- package/dist/cjs/justifi-card-form.cjs.entry.js +59 -0
- package/dist/cjs/justifi-payment-form.cjs.entry.js +17 -0
- package/dist/cjs/{justifi-bank-account-form_3.cjs.entry.js → justifi-payment-method-form.cjs.entry.js} +86 -110
- package/dist/cjs/justifi-payments-list.cjs.entry.js +1 -1
- package/dist/cjs/loader.cjs.js +3 -4
- package/dist/cjs/select-input_2.cjs.entry.js +59 -0
- package/dist/cjs/webcomponents.cjs.js +3 -7
- package/dist/collection/collection-manifest.json +7 -3
- package/dist/collection/components/bank-account-form/bank-account-form.js +1 -1
- package/dist/collection/components/billing-form/billing-form-schema.js +14 -0
- package/dist/collection/components/billing-form/billing-form.css +11 -0
- package/dist/collection/components/billing-form/billing-form.js +92 -0
- package/dist/collection/components/billing-form/state-options.js +243 -0
- package/dist/collection/components/card-form/card-form.js +1 -1
- package/dist/collection/components/card-form/card-form.stories.js +132 -0
- package/dist/collection/components/payment-form/payment-form.js +31 -0
- package/dist/collection/components/payment-method-form/payment-method-form.js +6 -4
- package/dist/collection/components/select-input/select-input.css +7 -0
- package/dist/collection/components/select-input/select-input.js +144 -0
- package/dist/collection/components/text-input/text-input.css +7 -0
- package/dist/collection/components/text-input/text-input.js +126 -0
- package/dist/components/index.d.ts +4 -9
- package/dist/components/index.js +5 -1
- package/dist/components/justifi-billing-form.d.ts +11 -0
- package/dist/components/justifi-billing-form.js +2180 -0
- package/dist/components/justifi-payment-form.d.ts +11 -0
- package/dist/components/justifi-payment-form.js +32 -0
- package/dist/components/payment-method-form.js +85 -3
- package/dist/components/select-input.d.ts +11 -0
- package/dist/components/select-input.js +6 -0
- package/dist/components/select-input2.js +52 -0
- package/dist/components/text-input.d.ts +11 -0
- package/dist/components/text-input.js +6 -0
- package/dist/components/text-input2.js +48 -0
- package/dist/esm/{index-c1f569bd.js → index-05706eb5.js} +457 -97
- package/dist/esm/justifi-bank-account-form.entry.js +55 -0
- package/dist/esm/justifi-billing-form.entry.js +2146 -0
- package/dist/esm/justifi-card-form.entry.js +55 -0
- package/dist/esm/justifi-payment-form.entry.js +13 -0
- package/dist/esm/justifi-payment-method-form.entry.js +187 -0
- package/dist/esm/justifi-payments-list.entry.js +1 -1
- package/dist/esm/loader.js +3 -4
- package/dist/esm/polyfills/css-shim.js +1 -1
- package/dist/esm/select-input_2.entry.js +54 -0
- package/dist/esm/webcomponents.js +3 -4
- package/dist/types/api/Api.d.ts +1 -1
- package/dist/types/api/Payment.d.ts +1 -1
- package/dist/types/components/billing-form/billing-form-schema.d.ts +15 -0
- package/dist/types/components/billing-form/billing-form.d.ts +17 -0
- package/dist/types/components/billing-form/state-options.d.ts +5 -0
- package/dist/types/components/card-form/card-form.stories.d.ts +14 -0
- package/dist/types/components/payment-form/payment-form.d.ts +4 -0
- package/dist/types/components/payment-method-form/payment-method-form.d.ts +1 -1
- package/dist/types/components/payment-method-form/theme.d.ts +3 -1
- package/dist/types/components/select-input/select-input.d.ts +18 -0
- package/dist/types/components/text-input/text-input.d.ts +14 -0
- package/dist/types/components.d.ts +87 -3
- package/dist/types/stencil-public-runtime.d.ts +3 -59
- package/dist/webcomponents/p-3809130a.entry.js +1 -0
- package/dist/webcomponents/p-67be9585.entry.js +1 -0
- package/dist/webcomponents/p-787671b9.entry.js +1 -0
- package/dist/webcomponents/p-87654bf4.entry.js +1 -0
- package/dist/webcomponents/p-8ee06fd1.js +2 -0
- package/dist/webcomponents/p-94ef2d0e.entry.js +1 -0
- package/dist/webcomponents/p-c07191dc.entry.js +1 -0
- package/dist/webcomponents/p-e5b0f047.entry.js +1 -0
- package/dist/webcomponents/webcomponents.esm.js +1 -1
- package/loader/index.d.ts +0 -9
- package/package.json +23 -5
- package/LICENSE +0 -21
- package/dist/esm/justifi-bank-account-form_3.entry.js +0 -209
- package/dist/webcomponents/p-1de39730.js +0 -2
- package/dist/webcomponents/p-f0eb5ed0.entry.js +0 -1
- package/dist/webcomponents/p-f91b7b05.entry.js +0 -1
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h } from './index-05706eb5.js';
|
|
2
|
+
|
|
3
|
+
const CardForm = class {
|
|
4
|
+
constructor(hostRef) {
|
|
5
|
+
registerInstance(this, hostRef);
|
|
6
|
+
this.cardFormReady = createEvent(this, "cardFormReady", 7);
|
|
7
|
+
this.cardFormTokenize = createEvent(this, "cardFormTokenize", 7);
|
|
8
|
+
this.cardFormValidate = createEvent(this, "cardFormValidate", 7);
|
|
9
|
+
this.validationStrategy = undefined;
|
|
10
|
+
this.styleOverrides = undefined;
|
|
11
|
+
this.internalStyleOverrides = undefined;
|
|
12
|
+
}
|
|
13
|
+
readyHandler(event) {
|
|
14
|
+
this.cardFormReady.emit(event);
|
|
15
|
+
}
|
|
16
|
+
tokenizeHandler(event) {
|
|
17
|
+
this.cardFormTokenize.emit(event);
|
|
18
|
+
}
|
|
19
|
+
validateHandler(event) {
|
|
20
|
+
this.cardFormValidate.emit(event);
|
|
21
|
+
}
|
|
22
|
+
componentWillLoad() {
|
|
23
|
+
this.parseStyleOverrides();
|
|
24
|
+
}
|
|
25
|
+
parseStyleOverrides() {
|
|
26
|
+
if (this.styleOverrides) {
|
|
27
|
+
const parsedStyleOverrides = JSON.parse(this.styleOverrides);
|
|
28
|
+
this.internalStyleOverrides = parsedStyleOverrides;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
async tokenize(...args) {
|
|
32
|
+
if (!this.childRef) {
|
|
33
|
+
throw new Error('Cannot call tokenize');
|
|
34
|
+
}
|
|
35
|
+
return this.childRef.tokenize(...args);
|
|
36
|
+
}
|
|
37
|
+
async validate() {
|
|
38
|
+
if (!this.childRef) {
|
|
39
|
+
throw new Error('Cannot call validate');
|
|
40
|
+
}
|
|
41
|
+
return this.childRef.validate();
|
|
42
|
+
}
|
|
43
|
+
render() {
|
|
44
|
+
return (h("justifi-payment-method-form", { ref: el => {
|
|
45
|
+
if (el) {
|
|
46
|
+
this.childRef = el;
|
|
47
|
+
}
|
|
48
|
+
}, "payment-method-form-type": "card", "payment-method-form-ready": this.cardFormReady, "payment-method-form-tokenize": this.cardFormTokenize, "payment-method-form-validation-strategy": this.validationStrategy || 'onSubmit', paymentMethodStyleOverrides: this.internalStyleOverrides }));
|
|
49
|
+
}
|
|
50
|
+
static get watchers() { return {
|
|
51
|
+
"styleOverrides": ["parseStyleOverrides"]
|
|
52
|
+
}; }
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export { CardForm as justifi_card_form };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-05706eb5.js';
|
|
2
|
+
|
|
3
|
+
const PaymentForm = class {
|
|
4
|
+
constructor(hostRef) {
|
|
5
|
+
registerInstance(this, hostRef);
|
|
6
|
+
this.validationStrategy = undefined;
|
|
7
|
+
}
|
|
8
|
+
render() {
|
|
9
|
+
return (h(Host, null, h("form", null, h("slot", null))));
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
export { PaymentForm as justifi_payment_form };
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-05706eb5.js';
|
|
2
|
+
|
|
3
|
+
const MessageEventType = {
|
|
4
|
+
card: {
|
|
5
|
+
ready: 'justifi.card.ready',
|
|
6
|
+
tokenize: 'justifi.card.tokenize',
|
|
7
|
+
validate: 'justifi.card.validate',
|
|
8
|
+
resize: 'justifi.card.resize',
|
|
9
|
+
styleOverrides: 'justifi.card.styleOverrides',
|
|
10
|
+
},
|
|
11
|
+
bankAccount: {
|
|
12
|
+
ready: 'justifi.bankAccount.ready',
|
|
13
|
+
tokenize: 'justifi.bankAccount.tokenize',
|
|
14
|
+
validate: 'justifi.bankAccount.validate',
|
|
15
|
+
resize: 'justifi.bankAccount.resize',
|
|
16
|
+
styleOverrides: 'justifi.bankAccount.styleOverrides',
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const name = "@justifi/webcomponents";
|
|
21
|
+
const version = "0.2.1";
|
|
22
|
+
const description = "JustiFi Web Components";
|
|
23
|
+
const main = "dist/index.cjs.js";
|
|
24
|
+
const module = "dist/index.js";
|
|
25
|
+
const es2015 = "dist/esm/index.mjs";
|
|
26
|
+
const es2017 = "dist/esm/index.mjs";
|
|
27
|
+
const types = "dist/types/index.d.ts";
|
|
28
|
+
const collection = "dist/collection/collection-manifest.json";
|
|
29
|
+
const unpkg = "dist/stencil-webcomponents/stencil-webcomponents.esm.js";
|
|
30
|
+
const repository = {
|
|
31
|
+
type: "git",
|
|
32
|
+
url: "git+https://github.com/justifi-tech/web-component-library.git"
|
|
33
|
+
};
|
|
34
|
+
const publishConfig = {
|
|
35
|
+
registry: "https://registry.npmjs.org"
|
|
36
|
+
};
|
|
37
|
+
const files = [
|
|
38
|
+
"dist/",
|
|
39
|
+
"loader/"
|
|
40
|
+
];
|
|
41
|
+
const scripts = {
|
|
42
|
+
"auto-changelog": "auto-changelog",
|
|
43
|
+
release: "release-it --no-npm",
|
|
44
|
+
build: "stencil build --docs",
|
|
45
|
+
start: "concurrently -c \"bgBlue.bold,bgMagenta.bold,bgGreen.bold\" \"yarn run start-stencil\" \"yarn run storybook\"",
|
|
46
|
+
"start-stencil": "stencil build --watch --serve --no-open",
|
|
47
|
+
test: "stencil test --spec --e2e",
|
|
48
|
+
"test:watch": "stencil test --spec --e2e --watchAll",
|
|
49
|
+
generate: "stencil generate",
|
|
50
|
+
storybook: "start-storybook -p 6006",
|
|
51
|
+
"build-storybook": "build-storybook"
|
|
52
|
+
};
|
|
53
|
+
const dependencies = {
|
|
54
|
+
"@stencil/core": "^2.13.0",
|
|
55
|
+
"@stencil/react-output-target": "^0.3.1",
|
|
56
|
+
"date-fns": "^2.29.3",
|
|
57
|
+
"dinero.js": "^1.9.1",
|
|
58
|
+
uuid: "^9.0.0",
|
|
59
|
+
yup: "^1.0.0"
|
|
60
|
+
};
|
|
61
|
+
const devDependencies = {
|
|
62
|
+
"@pxtrn/storybook-addon-docs-stencil": "^6.4.1",
|
|
63
|
+
"@storybook/addon-actions": "^6.5.16",
|
|
64
|
+
"@storybook/addon-essentials": "^6.5.16",
|
|
65
|
+
"@storybook/addon-interactions": "^6.5.16",
|
|
66
|
+
"@storybook/addon-links": "^6.5.16",
|
|
67
|
+
"@storybook/builder-webpack4": "^6.5.16",
|
|
68
|
+
"@storybook/html": "^6.5.16",
|
|
69
|
+
"@storybook/manager-webpack4": "^6.5.16",
|
|
70
|
+
"@storybook/testing-library": "^0.0.13",
|
|
71
|
+
"@types/jest": "^27.0.3",
|
|
72
|
+
"auto-changelog": "^2.4.0",
|
|
73
|
+
concurrently: "^7.6.0",
|
|
74
|
+
jest: "^27.4.5",
|
|
75
|
+
"jest-cli": "^27.4.5",
|
|
76
|
+
puppeteer: "^10.0.0",
|
|
77
|
+
"release-it": "^15.6.0"
|
|
78
|
+
};
|
|
79
|
+
const license = "MIT";
|
|
80
|
+
const packageJson = {
|
|
81
|
+
name: name,
|
|
82
|
+
version: version,
|
|
83
|
+
description: description,
|
|
84
|
+
main: main,
|
|
85
|
+
module: module,
|
|
86
|
+
es2015: es2015,
|
|
87
|
+
es2017: es2017,
|
|
88
|
+
types: types,
|
|
89
|
+
collection: collection,
|
|
90
|
+
"collection:main": "dist/collection/index.js",
|
|
91
|
+
unpkg: unpkg,
|
|
92
|
+
repository: repository,
|
|
93
|
+
publishConfig: publishConfig,
|
|
94
|
+
files: files,
|
|
95
|
+
scripts: scripts,
|
|
96
|
+
dependencies: dependencies,
|
|
97
|
+
devDependencies: devDependencies,
|
|
98
|
+
license: license
|
|
99
|
+
};
|
|
100
|
+
|
|
101
|
+
const paymentMethodFormCss = ":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}";
|
|
102
|
+
|
|
103
|
+
const PaymentMethodForm = class {
|
|
104
|
+
constructor(hostRef) {
|
|
105
|
+
registerInstance(this, hostRef);
|
|
106
|
+
this.paymentMethodFormReady = createEvent(this, "paymentMethodFormReady", 7);
|
|
107
|
+
this.paymentMethodFormTokenize = createEvent(this, "paymentMethodFormTokenize", 7);
|
|
108
|
+
this.paymentMethodFormType = undefined;
|
|
109
|
+
this.paymentMethodFormValidationStrategy = undefined;
|
|
110
|
+
this.paymentMethodStyleOverrides = undefined;
|
|
111
|
+
this.height = 55;
|
|
112
|
+
}
|
|
113
|
+
connectedCallback() {
|
|
114
|
+
window.addEventListener('message', this.dispatchMessageEvent.bind(this));
|
|
115
|
+
}
|
|
116
|
+
disconnectedCallback() {
|
|
117
|
+
window.removeEventListener('message', this.dispatchMessageEvent.bind(this));
|
|
118
|
+
}
|
|
119
|
+
componentShouldUpdate() {
|
|
120
|
+
this.sendStyleOverrides();
|
|
121
|
+
}
|
|
122
|
+
sendStyleOverrides() {
|
|
123
|
+
if (this.paymentMethodStyleOverrides) {
|
|
124
|
+
this.postMessage(MessageEventType[this.paymentMethodFormType].styleOverrides, { styleOverrides: this.paymentMethodStyleOverrides });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
dispatchMessageEvent(messageEvent) {
|
|
128
|
+
const messagePayload = messageEvent.data;
|
|
129
|
+
const messageType = messagePayload.eventType;
|
|
130
|
+
const messageData = messagePayload.data;
|
|
131
|
+
if (messageType === MessageEventType[this.paymentMethodFormType].ready) {
|
|
132
|
+
this.paymentMethodFormReady.emit(messageData);
|
|
133
|
+
}
|
|
134
|
+
if (messageType === MessageEventType[this.paymentMethodFormType].resize) {
|
|
135
|
+
this.height = messageData.height;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
postMessage(eventType, payload) {
|
|
139
|
+
if (this.iframeElement) {
|
|
140
|
+
this.iframeElement.contentWindow.postMessage(Object.assign({ eventType: eventType }, payload), '*');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
;
|
|
144
|
+
async postMessageWithResponseListener(eventType, payload) {
|
|
145
|
+
return new Promise((resolve) => {
|
|
146
|
+
const responseListener = (event) => {
|
|
147
|
+
if (event.data.eventType !== eventType)
|
|
148
|
+
return;
|
|
149
|
+
window.removeEventListener('message', responseListener);
|
|
150
|
+
resolve(event.data.data);
|
|
151
|
+
};
|
|
152
|
+
window.addEventListener('message', responseListener);
|
|
153
|
+
this.postMessage(eventType, payload);
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
async tokenize(clientId, paymentMethodMetadata, account) {
|
|
157
|
+
const eventType = MessageEventType[this.paymentMethodFormType].tokenize;
|
|
158
|
+
const payload = {
|
|
159
|
+
clientId: clientId,
|
|
160
|
+
componentVersion: packageJson.version,
|
|
161
|
+
paymentMethodMetadata: paymentMethodMetadata,
|
|
162
|
+
account: account,
|
|
163
|
+
};
|
|
164
|
+
return this.postMessageWithResponseListener(eventType, payload);
|
|
165
|
+
}
|
|
166
|
+
;
|
|
167
|
+
async validate() {
|
|
168
|
+
return this.postMessageWithResponseListener(MessageEventType[this.paymentMethodFormType].validate);
|
|
169
|
+
}
|
|
170
|
+
;
|
|
171
|
+
getIframeSrc() {
|
|
172
|
+
let iframeSrc = `https://js.justifi.ai/v2/${this.paymentMethodFormType}`;
|
|
173
|
+
if (this.paymentMethodFormValidationStrategy) {
|
|
174
|
+
iframeSrc += `?validationStrategy=${this.paymentMethodFormValidationStrategy}`;
|
|
175
|
+
}
|
|
176
|
+
return iframeSrc;
|
|
177
|
+
}
|
|
178
|
+
render() {
|
|
179
|
+
return (h(Host, null, h("iframe", { id: `justifi-payment-method-form-${this.paymentMethodFormType}`, src: this.getIframeSrc(), ref: (el) => this.iframeElement = el, height: this.height })));
|
|
180
|
+
}
|
|
181
|
+
static get watchers() { return {
|
|
182
|
+
"paymentMethodStyleOverrides": ["sendStyleOverrides"]
|
|
183
|
+
}; }
|
|
184
|
+
};
|
|
185
|
+
PaymentMethodForm.style = paymentMethodFormCss;
|
|
186
|
+
|
|
187
|
+
export { PaymentMethodForm as justifi_payment_method_form };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as registerInstance, h, H as Host } from './index-
|
|
1
|
+
import { r as registerInstance, h, H as Host } from './index-05706eb5.js';
|
|
2
2
|
|
|
3
3
|
// Unique ID creation requires a high quality random # generator. In the browser we therefore
|
|
4
4
|
// require the crypto API and do not support built-in fallback to lower quality random number
|
package/dist/esm/loader.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-c1f569bd.js';
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-05706eb5.js';
|
|
3
2
|
|
|
4
3
|
/*
|
|
5
|
-
Stencil Client Patch Esm v2.
|
|
4
|
+
Stencil Client Patch Esm v2.20.0 | MIT Licensed | https://stenciljs.com
|
|
6
5
|
*/
|
|
7
6
|
const patchEsm = () => {
|
|
8
7
|
return promiseResolve();
|
|
@@ -11,7 +10,7 @@ const patchEsm = () => {
|
|
|
11
10
|
const defineCustomElements = (win, options) => {
|
|
12
11
|
if (typeof window === 'undefined') return Promise.resolve();
|
|
13
12
|
return patchEsm().then(() => {
|
|
14
|
-
return bootstrapLazy([["justifi-
|
|
13
|
+
return bootstrapLazy([["justifi-billing-form",[[1,"justifi-billing-form",{"billingFields":[32],"billingFieldsErrors":[32],"validate":[64]},[[0,"fieldReceivedInput","setFormValue"]]]]],["justifi-bank-account-form",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-card-form",[[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-payment-form",[[4,"justifi-payment-form",{"validationStrategy":[1,"validation-strategy"]}]]],["justifi-payments-list",[[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]],["select-input_2",[[1,"select-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"options":[16],"internalValue":[32]}],[1,"text-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"internalValue":[32]}]]],["justifi-payment-method-form",[[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"paymentMethodStyleOverrides":[16],"height":[32],"tokenize":[64],"validate":[64]}]]]], options);
|
|
15
14
|
});
|
|
16
15
|
};
|
|
17
16
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var __assign=this&&this.__assign||function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e},__assign.apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
|
|
1
|
+
var __assign=this&&this.__assign||function(){return(__assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var s in t=arguments[r])Object.prototype.hasOwnProperty.call(t,s)&&(e[s]=t[s]);return e}).apply(this,arguments)},StyleNode=function(){this.start=0,this.end=0,this.previous=null,this.parent=null,this.rules=null,this.parsedCssText="",this.cssText="",this.atRule=!1,this.type=0,this.keyframesName="",this.selector="",this.parsedSelector=""};function parse(e){return parseCss(lex(e=clean(e)),e)}function clean(e){return e.replace(RX.comments,"").replace(RX.port,"")}function lex(e){var t=new StyleNode;t.start=0,t.end=e.length;for(var r=t,n=0,s=e.length;n<s;n++)if(e[n]===OPEN_BRACE){r.rules||(r.rules=[]);var o=r,a=o.rules[o.rules.length-1]||null;(r=new StyleNode).start=n+1,r.parent=o,r.previous=a,o.rules.push(r)}else e[n]===CLOSE_BRACE&&(r.end=n+1,r=r.parent||t);return t}function parseCss(e,t){var r=t.substring(e.start,e.end-1);if(e.parsedCssText=e.cssText=r.trim(),e.parent){var n=e.previous?e.previous.end:e.parent.start;r=(r=(r=_expandUnicodeEscapes(r=t.substring(n,e.start-1))).replace(RX.multipleSpaces," ")).substring(r.lastIndexOf(";")+1);var s=e.parsedSelector=e.selector=r.trim();e.atRule=0===s.indexOf(AT_START),e.atRule?0===s.indexOf(MEDIA_START)?e.type=types.MEDIA_RULE:s.match(RX.keyframesRule)&&(e.type=types.KEYFRAMES_RULE,e.keyframesName=e.selector.split(RX.multipleSpaces).pop()):0===s.indexOf(VAR_START)?e.type=types.MIXIN_RULE:e.type=types.STYLE_RULE}var o=e.rules;if(o)for(var a=0,i=o.length,l=void 0;a<i&&(l=o[a]);a++)parseCss(l,t);return e}function _expandUnicodeEscapes(e){return e.replace(/\\([0-9a-f]{1,6})\s/gi,(function(){for(var e=arguments[1],t=6-e.length;t--;)e="0"+e;return"\\"+e}))}var types={STYLE_RULE:1,KEYFRAMES_RULE:7,MEDIA_RULE:4,MIXIN_RULE:1e3},OPEN_BRACE="{",CLOSE_BRACE="}",RX={comments:/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,port:/@import[^;]*;/gim,customProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?(?:[;\n]|$)/gim,mixinProp:/(?:^[^;\-\s}]+)?--[^;{}]*?:[^{};]*?{[^}]*?}(?:[;\n]|$)?/gim,mixinApply:/@apply\s*\(?[^);]*\)?\s*(?:[;\n]|$)?/gim,varApply:/[^;:]*?:[^;]*?var\([^;]*\)(?:[;\n]|$)?/gim,keyframesRule:/^@[^\s]*keyframes/,multipleSpaces:/\s+/g},VAR_START="--",MEDIA_START="@media",AT_START="@",VAR_USAGE_START=/\bvar\(/,VAR_ASSIGN_START=/\B--[\w-]+\s*:/,COMMENTS=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//gim,TRAILING_LINES=/^[\t ]+\n/gm;function findRegex(e,t,r){e.lastIndex=0;var n=t.substring(r).match(e);if(n){var s=r+n.index;return{start:s,end:s+n[0].length}}return null}function resolveVar(e,t,r){return e[t]?e[t]:r?executeTemplate(r,e):""}function findVarEndIndex(e,t){for(var r=0,n=t;n<e.length;n++){var s=e[n];if("("===s)r++;else if(")"===s&&--r<=0)return n+1}return n}function parseVar(e,t){var r=findRegex(VAR_USAGE_START,e,t);if(!r)return null;var n=findVarEndIndex(e,r.start),s=e.substring(r.end,n-1).split(","),o=s[0],a=s.slice(1);return{start:r.start,end:n,propName:o.trim(),fallback:a.length>0?a.join(",").trim():void 0}}function compileVar(e,t,r){var n=parseVar(e,r);if(!n)return t.push(e.substring(r,e.length)),e.length;var s=n.propName,o=null!=n.fallback?compileTemplate(n.fallback):void 0;return t.push(e.substring(r,n.start),(function(e){return resolveVar(e,s,o)})),n.end}function executeTemplate(e,t){for(var r="",n=0;n<e.length;n++){var s=e[n];r+="string"==typeof s?s:s(t)}return r}function findEndValue(e,t){for(var r=!1,n=!1,s=t;s<e.length;s++){var o=e[s];if(r)n&&'"'===o&&(r=!1),n||"'"!==o||(r=!1);else if('"'===o)r=!0,n=!0;else if("'"===o)r=!0,n=!1;else{if(";"===o)return s+1;if("}"===o)return s}}return s}function removeCustomAssigns(e){for(var t="",r=0;;){var n=findRegex(VAR_ASSIGN_START,e,r),s=n?n.start:e.length;if(t+=e.substring(r,s),!n)break;r=findEndValue(e,s)}return t}function compileTemplate(e){var t=0;e=removeCustomAssigns(e=e.replace(COMMENTS,"")).replace(TRAILING_LINES,"");for(var r=[];t<e.length;)t=compileVar(e,r,t);return r}function resolveValues(e){var t={};e.forEach((function(e){e.declarations.forEach((function(e){t[e.prop]=e.value}))}));for(var r={},n=Object.entries(t),s=function(e){var t=!1;if(n.forEach((function(e){var n=e[0],s=executeTemplate(e[1],r);s!==r[n]&&(r[n]=s,t=!0)})),!t)return"break"},o=0;o<10;o++){if("break"===s())break}return r}function getSelectors(e,t){if(void 0===t&&(t=0),!e.rules)return[];var r=[];return e.rules.filter((function(e){return e.type===types.STYLE_RULE})).forEach((function(e){var n=getDeclarations(e.cssText);n.length>0&&e.parsedSelector.split(",").forEach((function(e){e=e.trim(),r.push({selector:e,declarations:n,specificity:computeSpecificity(),nu:t})})),t++})),r}function computeSpecificity(e){return 1}var IMPORTANT="!important",FIND_DECLARATIONS=/(?:^|[;\s{]\s*)(--[\w-]*?)\s*:\s*(?:((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};{])+)|\{([^}]*)\}(?:(?=[;\s}])|$))/gm;function getDeclarations(e){for(var t,r=[];t=FIND_DECLARATIONS.exec(e.trim());){var n=normalizeValue(t[2]),s=n.value,o=n.important;r.push({prop:t[1].trim(),value:compileTemplate(s),important:o})}return r}function normalizeValue(e){var t=(e=e.replace(/\s+/gim," ").trim()).endsWith(IMPORTANT);return t&&(e=e.slice(0,e.length-IMPORTANT.length).trim()),{value:e,important:t}}function getActiveSelectors(e,t,r){var n=[],s=getScopesForElement(t,e);return r.forEach((function(e){return n.push(e)})),s.forEach((function(e){return n.push(e)})),sortSelectors(getSelectorsForScopes(n).filter((function(t){return matches(e,t.selector)})))}function getScopesForElement(e,t){for(var r=[];t;){var n=e.get(t);n&&r.push(n),t=t.parentElement}return r}function getSelectorsForScopes(e){var t=[];return e.forEach((function(e){t.push.apply(t,e.selectors)})),t}function sortSelectors(e){return e.sort((function(e,t){return e.specificity===t.specificity?e.nu-t.nu:e.specificity-t.specificity})),e}function matches(e,t){return":root"===t||"html"===t||e.matches(t)}function parseCSS(e){var t=parse(e),r=compileTemplate(e);return{original:e,template:r,selectors:getSelectors(t),usesCssVars:r.length>1}}function addGlobalStyle(e,t){if(e.some((function(e){return e.styleEl===t})))return!1;var r=parseCSS(t.textContent);return r.styleEl=t,e.push(r),!0}function updateGlobalScopes(e){var t=resolveValues(getSelectorsForScopes(e));e.forEach((function(e){e.usesCssVars&&(e.styleEl.textContent=executeTemplate(e.template,t))}))}function reScope(e,t){var r=e.template.map((function(r){return"string"==typeof r?replaceScope(r,e.scopeId,t):r})),n=e.selectors.map((function(r){return __assign(__assign({},r),{selector:replaceScope(r.selector,e.scopeId,t)})}));return __assign(__assign({},e),{template:r,selectors:n,scopeId:t})}function replaceScope(e,t,r){return e=replaceAll(e,"\\.".concat(t),".".concat(r))}function replaceAll(e,t,r){return e.replace(new RegExp(t,"g"),r)}function loadDocument(e,t){return loadDocumentStyles(e,t),loadDocumentLinks(e,t).then((function(){updateGlobalScopes(t)}))}function startWatcher(e,t){"undefined"!=typeof MutationObserver&&new MutationObserver((function(){loadDocumentStyles(e,t)&&updateGlobalScopes(t)})).observe(document.head,{childList:!0})}function loadDocumentLinks(e,t){for(var r=[],n=e.querySelectorAll('link[rel="stylesheet"][href]:not([data-no-shim])'),s=0;s<n.length;s++)r.push(addGlobalLink(e,t,n[s]));return Promise.all(r)}function loadDocumentStyles(e,t){return Array.from(e.querySelectorAll("style:not([data-styles]):not([data-no-shim])")).map((function(e){return addGlobalStyle(t,e)})).some(Boolean)}function addGlobalLink(e,t,r){var n=r.href;return fetch(n).then((function(e){return e.text()})).then((function(s){if(hasCssVariables(s)&&r.parentNode){hasRelativeUrls(s)&&(s=fixRelativeUrls(s,n));var o=e.createElement("style");o.setAttribute("data-styles",""),o.textContent=s,addGlobalStyle(t,o),r.parentNode.insertBefore(o,r),r.remove()}})).catch((function(e){console.error(e)}))}var CSS_VARIABLE_REGEXP=/[\s;{]--[-a-zA-Z0-9]+\s*:/m;function hasCssVariables(e){return e.indexOf("var(")>-1||CSS_VARIABLE_REGEXP.test(e)}var CSS_URL_REGEXP=/url[\s]*\([\s]*['"]?(?!(?:https?|data)\:|\/)([^\'\"\)]*)[\s]*['"]?\)[\s]*/gim;function hasRelativeUrls(e){return CSS_URL_REGEXP.lastIndex=0,CSS_URL_REGEXP.test(e)}function fixRelativeUrls(e,t){var r=t.replace(/[^/]*$/,"");return e.replace(CSS_URL_REGEXP,(function(e,t){var n=r+t;return e.replace(t,n)}))}var CustomStyle=function(){function e(e,t){this.win=e,this.doc=t,this.count=0,this.hostStyleMap=new WeakMap,this.hostScopeMap=new WeakMap,this.globalScopes=[],this.scopesMap=new Map,this.didInit=!1}return e.prototype.i=function(){var e=this;return this.didInit||!this.win.requestAnimationFrame?Promise.resolve():(this.didInit=!0,new Promise((function(t){e.win.requestAnimationFrame((function(){startWatcher(e.doc,e.globalScopes),loadDocument(e.doc,e.globalScopes).then((function(){return t()}))}))})))},e.prototype.addLink=function(e){var t=this;return addGlobalLink(this.doc,this.globalScopes,e).then((function(){t.updateGlobal()}))},e.prototype.addGlobalStyle=function(e){addGlobalStyle(this.globalScopes,e)&&this.updateGlobal()},e.prototype.createHostStyle=function(e,t,r,n){if(this.hostScopeMap.has(e))throw new Error("host style already created");var s=this.registerHostTemplate(r,t,n),o=this.doc.createElement("style");return o.setAttribute("data-no-shim",""),s.usesCssVars?n?(o["s-sc"]=t="".concat(s.scopeId,"-").concat(this.count),o.textContent="/*needs update*/",this.hostStyleMap.set(e,o),this.hostScopeMap.set(e,reScope(s,t)),this.count++):(s.styleEl=o,s.usesCssVars||(o.textContent=executeTemplate(s.template,{})),this.globalScopes.push(s),this.updateGlobal(),this.hostScopeMap.set(e,s)):o.textContent=r,o},e.prototype.removeHost=function(e){var t=this.hostStyleMap.get(e);t&&t.remove(),this.hostStyleMap.delete(e),this.hostScopeMap.delete(e)},e.prototype.updateHost=function(e){var t=this.hostScopeMap.get(e);if(t&&t.usesCssVars&&t.isScoped){var r=this.hostStyleMap.get(e);if(r){var n=resolveValues(getActiveSelectors(e,this.hostScopeMap,this.globalScopes));r.textContent=executeTemplate(t.template,n)}}},e.prototype.updateGlobal=function(){updateGlobalScopes(this.globalScopes)},e.prototype.registerHostTemplate=function(e,t,r){var n=this.scopesMap.get(t);return n||((n=parseCSS(e)).scopeId=t,n.isScoped=r,this.scopesMap.set(t,n)),n},e}();!function(e){!e||e.__cssshim||e.CSS&&e.CSS.supports&&e.CSS.supports("color","var(--c)")||(e.__cssshim=new CustomStyle(e,e.document))}("undefined"!=typeof window&&window);
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { r as registerInstance, c as createEvent, h, H as Host } from './index-05706eb5.js';
|
|
2
|
+
|
|
3
|
+
const selectInputCss = ":host{display:block}label{display:block}";
|
|
4
|
+
|
|
5
|
+
const SelectInput = class {
|
|
6
|
+
constructor(hostRef) {
|
|
7
|
+
registerInstance(this, hostRef);
|
|
8
|
+
this.fieldReceivedInput = createEvent(this, "fieldReceivedInput", 7);
|
|
9
|
+
this.name = undefined;
|
|
10
|
+
this.label = undefined;
|
|
11
|
+
this.defaultValue = undefined;
|
|
12
|
+
this.error = undefined;
|
|
13
|
+
this.options = undefined;
|
|
14
|
+
this.internalValue = '';
|
|
15
|
+
}
|
|
16
|
+
onInput(event) {
|
|
17
|
+
const target = event.target;
|
|
18
|
+
const name = target.getAttribute('name');
|
|
19
|
+
this.fieldReceivedInput.emit({ name: name, value: target.value });
|
|
20
|
+
}
|
|
21
|
+
;
|
|
22
|
+
render() {
|
|
23
|
+
return (h(Host, null, h("label", null, this.label), h("select", { name: this.name, onInput: (event) => this.onInput(event) }, this.options.map((option) => {
|
|
24
|
+
return (h("option", { value: option.value }, option.label));
|
|
25
|
+
})), this.error && h("div", { style: { color: 'red' } }, this.error)));
|
|
26
|
+
}
|
|
27
|
+
};
|
|
28
|
+
SelectInput.style = selectInputCss;
|
|
29
|
+
|
|
30
|
+
const textInputCss = ":host{display:block}label{display:block}";
|
|
31
|
+
|
|
32
|
+
const TextInput = class {
|
|
33
|
+
constructor(hostRef) {
|
|
34
|
+
registerInstance(this, hostRef);
|
|
35
|
+
this.fieldReceivedInput = createEvent(this, "fieldReceivedInput", 7);
|
|
36
|
+
this.name = undefined;
|
|
37
|
+
this.label = undefined;
|
|
38
|
+
this.defaultValue = undefined;
|
|
39
|
+
this.error = undefined;
|
|
40
|
+
this.internalValue = '';
|
|
41
|
+
}
|
|
42
|
+
onInput(event) {
|
|
43
|
+
const target = event.target;
|
|
44
|
+
const name = target.getAttribute('name');
|
|
45
|
+
this.fieldReceivedInput.emit({ name: name, value: target.value });
|
|
46
|
+
}
|
|
47
|
+
;
|
|
48
|
+
render() {
|
|
49
|
+
return (h(Host, null, h("label", null, this.label), h("input", { name: this.name, type: "text", onInput: (event) => this.onInput(event), value: this.internalValue || this.defaultValue }), this.error && h("div", { style: { color: 'red' } }, this.error)));
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
TextInput.style = textInputCss;
|
|
53
|
+
|
|
54
|
+
export { SelectInput as select_input, TextInput as text_input };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import { p as promiseResolve, b as bootstrapLazy } from './index-
|
|
2
|
-
export { s as setNonce } from './index-c1f569bd.js';
|
|
1
|
+
import { p as promiseResolve, b as bootstrapLazy } from './index-05706eb5.js';
|
|
3
2
|
|
|
4
3
|
/*
|
|
5
|
-
Stencil Client Patch Browser v2.
|
|
4
|
+
Stencil Client Patch Browser v2.20.0 | MIT Licensed | https://stenciljs.com
|
|
6
5
|
*/
|
|
7
6
|
const patchBrowser = () => {
|
|
8
7
|
const importMeta = import.meta.url;
|
|
@@ -14,5 +13,5 @@ const patchBrowser = () => {
|
|
|
14
13
|
};
|
|
15
14
|
|
|
16
15
|
patchBrowser().then(options => {
|
|
17
|
-
return bootstrapLazy([["justifi-
|
|
16
|
+
return bootstrapLazy([["justifi-billing-form",[[1,"justifi-billing-form",{"billingFields":[32],"billingFieldsErrors":[32],"validate":[64]},[[0,"fieldReceivedInput","setFormValue"]]]]],["justifi-bank-account-form",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-card-form",[[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"styleOverrides":[1,"style-overrides"],"internalStyleOverrides":[32],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]]]],["justifi-payment-form",[[4,"justifi-payment-form",{"validationStrategy":[1,"validation-strategy"]}]]],["justifi-payments-list",[[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}]]],["select-input_2",[[1,"select-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"options":[16],"internalValue":[32]}],[1,"text-input",{"name":[1],"label":[1],"defaultValue":[1,"default-value"],"error":[1],"internalValue":[32]}]]],["justifi-payment-method-form",[[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"paymentMethodStyleOverrides":[16],"height":[32],"tokenize":[64],"validate":[64]}]]]], options);
|
|
18
17
|
});
|
package/dist/types/api/Api.d.ts
CHANGED
|
@@ -22,7 +22,7 @@ export declare enum PaymentDisputedStatuses {
|
|
|
22
22
|
export interface IPaymentMethod {
|
|
23
23
|
card?: ICard;
|
|
24
24
|
}
|
|
25
|
-
export type CardBrand = 'american_express' | 'diners_club' | 'discover' | 'jcb' | 'mastercard' | 'china_unionpay' | 'visa' | 'unknown';
|
|
25
|
+
export declare type CardBrand = 'american_express' | 'diners_club' | 'discover' | 'jcb' | 'mastercard' | 'china_unionpay' | 'visa' | 'unknown';
|
|
26
26
|
export interface ICard {
|
|
27
27
|
id: string;
|
|
28
28
|
acct_last_four: string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const RegExZip: RegExp;
|
|
2
|
+
declare const BillingFormSchema: import("yup").ObjectSchema<{
|
|
3
|
+
address_line1: string;
|
|
4
|
+
address_line2: string;
|
|
5
|
+
address_city: string;
|
|
6
|
+
address_state: string;
|
|
7
|
+
address_postal_code: string;
|
|
8
|
+
}, import("yup").AnyObject, {
|
|
9
|
+
address_line1: undefined;
|
|
10
|
+
address_line2: undefined;
|
|
11
|
+
address_city: undefined;
|
|
12
|
+
address_state: undefined;
|
|
13
|
+
address_postal_code: undefined;
|
|
14
|
+
}, "">;
|
|
15
|
+
export default BillingFormSchema;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
interface BillingFormFields {
|
|
2
|
+
address_line1: string;
|
|
3
|
+
address_line2?: string;
|
|
4
|
+
address_city: string;
|
|
5
|
+
address_state: string;
|
|
6
|
+
address_postal_code: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class BillingForm {
|
|
9
|
+
billingFields: BillingFormFields;
|
|
10
|
+
billingFieldsErrors: any;
|
|
11
|
+
setFormValue(event: any): void;
|
|
12
|
+
validate(): Promise<{
|
|
13
|
+
isValid: boolean;
|
|
14
|
+
}>;
|
|
15
|
+
render(): any;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
title: string;
|
|
3
|
+
component: string;
|
|
4
|
+
parameters: {
|
|
5
|
+
actions: {
|
|
6
|
+
handles: string[];
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
decorators: ((story: any) => string)[];
|
|
10
|
+
};
|
|
11
|
+
export default _default;
|
|
12
|
+
export declare const Basic: any;
|
|
13
|
+
export declare const Embedded: any;
|
|
14
|
+
export declare const Styled: any;
|
|
@@ -17,7 +17,7 @@ export declare class PaymentMethodForm {
|
|
|
17
17
|
private dispatchMessageEvent;
|
|
18
18
|
private postMessage;
|
|
19
19
|
private postMessageWithResponseListener;
|
|
20
|
-
tokenize(
|
|
20
|
+
tokenize(clientId: string, paymentMethodMetadata: any, account?: string): Promise<any>;
|
|
21
21
|
validate(): Promise<any>;
|
|
22
22
|
private getIframeSrc;
|
|
23
23
|
render(): any;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class SelectInput {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
defaultValue: string;
|
|
6
|
+
error: string;
|
|
7
|
+
options: {
|
|
8
|
+
label: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}[];
|
|
11
|
+
fieldReceivedInput: EventEmitter<{
|
|
12
|
+
name: string;
|
|
13
|
+
value: string;
|
|
14
|
+
}>;
|
|
15
|
+
internalValue: string;
|
|
16
|
+
onInput(event: any): void;
|
|
17
|
+
render(): any;
|
|
18
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EventEmitter } from '../../stencil-public-runtime';
|
|
2
|
+
export declare class TextInput {
|
|
3
|
+
name: string;
|
|
4
|
+
label: string;
|
|
5
|
+
defaultValue: string;
|
|
6
|
+
error: string;
|
|
7
|
+
fieldReceivedInput: EventEmitter<{
|
|
8
|
+
name: string;
|
|
9
|
+
value: string;
|
|
10
|
+
}>;
|
|
11
|
+
internalValue: string;
|
|
12
|
+
onInput(event: any): void;
|
|
13
|
+
render(): any;
|
|
14
|
+
}
|