@justifi/webcomponents 0.0.13 → 0.0.14

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.
Files changed (30) hide show
  1. package/dist/cjs/{index-4f753ffd.js → index-e1b45289.js} +64 -1
  2. package/dist/cjs/justifi-bank-account-form_4.cjs.entry.js +48 -4
  3. package/dist/cjs/loader.cjs.js +3 -3
  4. package/dist/cjs/webcomponents.cjs.js +3 -3
  5. package/dist/collection/collection-manifest.json +1 -1
  6. package/dist/collection/components/bank-account-form/bank-account-form.js +38 -1
  7. package/dist/collection/components/card-form/card-form.js +38 -1
  8. package/dist/collection/components/payment-method-form/message-event-types.js +2 -0
  9. package/dist/collection/components/payment-method-form/payment-method-form.js +42 -1
  10. package/dist/collection/components/payment-method-form/theme.js +1 -0
  11. package/dist/components/justifi-bank-account-form.js +15 -1
  12. package/dist/components/justifi-card-form.js +15 -1
  13. package/dist/components/payment-method-form.js +22 -1
  14. package/dist/esm/{index-3d88d85c.js → index-c1f569bd.js} +64 -1
  15. package/dist/esm/justifi-bank-account-form_4.entry.js +48 -4
  16. package/dist/esm/loader.js +4 -4
  17. package/dist/esm/webcomponents.js +4 -4
  18. package/dist/types/components/bank-account-form/bank-account-form.d.ts +5 -0
  19. package/dist/types/components/card-form/card-form.d.ts +5 -0
  20. package/dist/types/components/payment-method-form/message-event-types.d.ts +2 -0
  21. package/dist/types/components/payment-method-form/payment-method-form.d.ts +5 -0
  22. package/dist/types/components/payment-method-form/theme.d.ts +43 -0
  23. package/dist/types/components.d.ts +7 -0
  24. package/dist/types/stencil-public-runtime.d.ts +11 -0
  25. package/dist/webcomponents/p-1de39730.js +2 -0
  26. package/dist/webcomponents/p-d6caba00.entry.js +1 -0
  27. package/dist/webcomponents/webcomponents.esm.js +1 -1
  28. package/package.json +2 -2
  29. package/dist/webcomponents/p-338453e1.entry.js +0 -1
  30. package/dist/webcomponents/p-de108437.js +0 -2
@@ -6,12 +6,14 @@ const MessageEventType = {
6
6
  tokenize: 'justifi.card.tokenize',
7
7
  validate: 'justifi.card.validate',
8
8
  resize: 'justifi.card.resize',
9
+ styleOverrides: 'justifi.card.styleOverrides',
9
10
  },
10
11
  bankAccount: {
11
12
  ready: 'justifi.bankAccount.ready',
12
13
  tokenize: 'justifi.bankAccount.tokenize',
13
14
  validate: 'justifi.bankAccount.validate',
14
15
  resize: 'justifi.bankAccount.resize',
16
+ styleOverrides: 'justifi.bankAccount.styleOverrides',
15
17
  }
16
18
  };
17
19
 
@@ -25,6 +27,7 @@ const PaymentMethodForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
25
27
  this.paymentMethodFormTokenize = createEvent(this, "paymentMethodFormTokenize", 7);
26
28
  this.paymentMethodFormType = undefined;
27
29
  this.paymentMethodFormValidationStrategy = undefined;
30
+ this.paymentMethodStyleOverrides = undefined;
28
31
  this.height = 55;
29
32
  }
30
33
  connectedCallback() {
@@ -33,6 +36,14 @@ const PaymentMethodForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
33
36
  disconnectedCallback() {
34
37
  window.removeEventListener('message', this.dispatchMessageEvent.bind(this));
35
38
  }
39
+ componentShouldUpdate() {
40
+ this.sendStyleOverrides();
41
+ }
42
+ sendStyleOverrides() {
43
+ if (this.paymentMethodStyleOverrides) {
44
+ this.postMessage(MessageEventType[this.paymentMethodFormType].styleOverrides, { styleOverrides: this.paymentMethodStyleOverrides });
45
+ }
46
+ }
36
47
  dispatchMessageEvent(messageEvent) {
37
48
  const messagePayload = messageEvent.data;
38
49
  const messageType = messagePayload.eventType;
@@ -44,6 +55,12 @@ const PaymentMethodForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
44
55
  this.height = messageData.height;
45
56
  }
46
57
  }
58
+ postMessage(eventType, payload) {
59
+ if (this.iframeElement) {
60
+ this.iframeElement.contentWindow.postMessage(Object.assign({ eventType: eventType }, payload), '*');
61
+ }
62
+ }
63
+ ;
47
64
  async postMessageWithResponseListener(eventType, payload) {
48
65
  return new Promise((resolve) => {
49
66
  const responseListener = (event) => {
@@ -53,7 +70,7 @@ const PaymentMethodForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
53
70
  resolve(event.data.data);
54
71
  };
55
72
  window.addEventListener('message', responseListener);
56
- this.iframeElement.contentWindow.postMessage(Object.assign({ eventType: eventType }, payload), '*');
73
+ this.postMessage(eventType, payload);
57
74
  });
58
75
  }
59
76
  async tokenize(clientKey, paymentMethodMetadata, account) {
@@ -80,10 +97,14 @@ const PaymentMethodForm = /*@__PURE__*/ proxyCustomElement(class extends HTMLEle
80
97
  render() {
81
98
  return (h(Host, null, h("iframe", { id: `justifi-payment-method-form-${this.paymentMethodFormType}`, src: this.getIframeSrc(), ref: (el) => this.iframeElement = el, height: this.height })));
82
99
  }
100
+ static get watchers() { return {
101
+ "paymentMethodStyleOverrides": ["sendStyleOverrides"]
102
+ }; }
83
103
  static get style() { return paymentMethodFormCss; }
84
104
  }, [0, "justifi-payment-method-form", {
85
105
  "paymentMethodFormType": [1, "payment-method-form-type"],
86
106
  "paymentMethodFormValidationStrategy": [1, "payment-method-form-validation-strategy"],
107
+ "paymentMethodStyleOverrides": [16],
87
108
  "height": [32],
88
109
  "tokenize": [64],
89
110
  "validate": [64]
@@ -111,6 +111,14 @@ const h = (nodeName, vnodeData, ...children) => {
111
111
  }
112
112
  return vnode;
113
113
  };
114
+ /**
115
+ * A utility function for creating a virtual DOM node from a tag and some
116
+ * possible text content.
117
+ *
118
+ * @param tag the tag for this element
119
+ * @param text possible text content for the node
120
+ * @returns a newly-minted virtual DOM node
121
+ */
114
122
  const newVNode = (tag, text) => {
115
123
  const vnode = {
116
124
  $flags$: 0,
@@ -125,6 +133,12 @@ const newVNode = (tag, text) => {
125
133
  return vnode;
126
134
  };
127
135
  const Host = {};
136
+ /**
137
+ * Check whether a given node is a Host node or not
138
+ *
139
+ * @param node the virtual DOM node to check
140
+ * @returns whether it's a Host node or not
141
+ */
128
142
  const isHost = (node) => node && node.$tag$ === Host;
129
143
  /**
130
144
  * Parse a new property value for a given property type.
@@ -398,6 +412,21 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
398
412
  }
399
413
  return elm;
400
414
  };
415
+ /**
416
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
417
+ * add them to the DOM in the appropriate place.
418
+ *
419
+ * @param parentElm the DOM node which should be used as a parent for the new
420
+ * DOM nodes
421
+ * @param before a child of the `parentElm` which the new children should be
422
+ * inserted before (optional)
423
+ * @param parentVNode the parent virtual DOM node
424
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
425
+ * @param startIdx the index in the child virtual DOM nodes at which to start
426
+ * creating DOM nodes (inclusive)
427
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
428
+ * creating DOM nodes (inclusive)
429
+ */
401
430
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
402
431
  let containerElm = (parentElm);
403
432
  let childNode;
@@ -414,6 +443,19 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
414
443
  }
415
444
  }
416
445
  };
446
+ /**
447
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
448
+ * This can be used to, for instance, clean up after a list of children which
449
+ * should no longer be shown.
450
+ *
451
+ * This function also handles some of Stencil's slot relocation logic.
452
+ *
453
+ * @param vnodes a list of virtual DOM nodes to remove
454
+ * @param startIdx the index at which to start removing nodes (inclusive)
455
+ * @param endIdx the index at which to stop removing nodes (inclusive)
456
+ * @param vnode a VNode
457
+ * @param elm an element
458
+ */
417
459
  const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
418
460
  for (; startIdx <= endIdx; ++startIdx) {
419
461
  if ((vnode = vnodes[startIdx])) {
@@ -606,7 +648,8 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
606
648
  *
607
649
  * So, in other words, if `key` attrs are not set on VNodes which may be
608
650
  * changing order within a `children` array or something along those lines then
609
- * we could obtain a false positive and then have to do needless re-rendering.
651
+ * we could obtain a false negative and then have to do needless re-rendering
652
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
610
653
  *
611
654
  * @param leftVNode the first VNode to check
612
655
  * @param rightVNode the second VNode to check
@@ -673,6 +716,18 @@ const callNodeRefs = (vNode) => {
673
716
  vNode.$children$ && vNode.$children$.map(callNodeRefs);
674
717
  }
675
718
  };
719
+ /**
720
+ * The main entry point for Stencil's virtual DOM-based rendering engine
721
+ *
722
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
723
+ * function will handle creating a virtual DOM tree with a single root, patching
724
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
725
+ * relocation, and reflecting attributes.
726
+ *
727
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
728
+ * the DOM node into which it should be rendered.
729
+ * @param renderFnResults the virtual DOM nodes to be rendered
730
+ */
676
731
  const renderVdom = (hostRef, renderFnResults) => {
677
732
  const hostElm = hostRef.$hostElement$;
678
733
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
@@ -720,6 +775,9 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
720
775
  hostRef.$queuedListeners$ = null;
721
776
  }
722
777
  }
778
+ {
779
+ promise = safeCall(instance, 'componentWillLoad');
780
+ }
723
781
  }
724
782
  endSchedule();
725
783
  return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
@@ -883,6 +941,11 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
883
941
  }
884
942
  }
885
943
  if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
944
+ if (instance.componentShouldUpdate) {
945
+ if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
946
+ return;
947
+ }
948
+ }
886
949
  // looks like this value actually changed, so we've got work to do!
887
950
  // but only if we've already rendered, otherwise just chill out
888
951
  // queue that we need to do an update, but don't worry about queuing
@@ -1,4 +1,4 @@
1
- import { r as registerInstance, c as createEvent, h, H as Host } from './index-3d88d85c.js';
1
+ import { r as registerInstance, c as createEvent, h, H as Host } from './index-c1f569bd.js';
2
2
 
3
3
  const BankAccountForm = class {
4
4
  constructor(hostRef) {
@@ -7,6 +7,8 @@ const BankAccountForm = class {
7
7
  this.bankAccountFormTokenize = createEvent(this, "bankAccountFormTokenize", 7);
8
8
  this.bankAccountFormValidate = createEvent(this, "bankAccountFormValidate", 7);
9
9
  this.validationStrategy = undefined;
10
+ this.styleOverrides = undefined;
11
+ this.internalStyleOverrides = undefined;
10
12
  }
11
13
  readyHandler(event) {
12
14
  this.bankAccountFormReady.emit(event);
@@ -17,6 +19,13 @@ const BankAccountForm = class {
17
19
  validateHandler(event) {
18
20
  this.bankAccountFormValidate.emit(event);
19
21
  }
22
+ componentWillLoad() {
23
+ this.parseStyleOverrides();
24
+ }
25
+ parseStyleOverrides() {
26
+ const parsedStyleOverrides = JSON.parse(this.styleOverrides);
27
+ this.internalStyleOverrides = parsedStyleOverrides;
28
+ }
20
29
  async tokenize(...args) {
21
30
  if (!this.childRef) {
22
31
  throw new Error('Cannot call tokenize');
@@ -34,8 +43,11 @@ const BankAccountForm = class {
34
43
  if (el) {
35
44
  this.childRef = el;
36
45
  }
37
- }, "payment-method-form-type": "bankAccount", "payment-method-form-ready": this.bankAccountFormReady, "payment-method-form-tokenize": this.bankAccountFormTokenize, "payment-method-form-validation-strategy": this.validationStrategy || 'onSubmit' }));
46
+ }, "payment-method-form-type": "bankAccount", "payment-method-form-ready": this.bankAccountFormReady, "payment-method-form-tokenize": this.bankAccountFormTokenize, "payment-method-form-validation-strategy": this.validationStrategy || 'onSubmit', paymentMethodStyleOverrides: this.internalStyleOverrides }));
38
47
  }
48
+ static get watchers() { return {
49
+ "styleOverrides": ["parseStyleOverrides"]
50
+ }; }
39
51
  };
40
52
 
41
53
  const CardForm = class {
@@ -45,6 +57,8 @@ const CardForm = class {
45
57
  this.cardFormTokenize = createEvent(this, "cardFormTokenize", 7);
46
58
  this.cardFormValidate = createEvent(this, "cardFormValidate", 7);
47
59
  this.validationStrategy = undefined;
60
+ this.styleOverrides = undefined;
61
+ this.internalStyleOverrides = undefined;
48
62
  }
49
63
  readyHandler(event) {
50
64
  this.cardFormReady.emit(event);
@@ -55,6 +69,13 @@ const CardForm = class {
55
69
  validateHandler(event) {
56
70
  this.cardFormValidate.emit(event);
57
71
  }
72
+ componentWillLoad() {
73
+ this.parseStyleOverrides();
74
+ }
75
+ parseStyleOverrides() {
76
+ const parsedStyleOverrides = JSON.parse(this.styleOverrides);
77
+ this.internalStyleOverrides = parsedStyleOverrides;
78
+ }
58
79
  async tokenize(...args) {
59
80
  if (!this.childRef) {
60
81
  throw new Error('Cannot call tokenize');
@@ -72,8 +93,11 @@ const CardForm = class {
72
93
  if (el) {
73
94
  this.childRef = el;
74
95
  }
75
- }, "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' }));
96
+ }, "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 }));
76
97
  }
98
+ static get watchers() { return {
99
+ "styleOverrides": ["parseStyleOverrides"]
100
+ }; }
77
101
  };
78
102
 
79
103
  const MessageEventType = {
@@ -82,12 +106,14 @@ const MessageEventType = {
82
106
  tokenize: 'justifi.card.tokenize',
83
107
  validate: 'justifi.card.validate',
84
108
  resize: 'justifi.card.resize',
109
+ styleOverrides: 'justifi.card.styleOverrides',
85
110
  },
86
111
  bankAccount: {
87
112
  ready: 'justifi.bankAccount.ready',
88
113
  tokenize: 'justifi.bankAccount.tokenize',
89
114
  validate: 'justifi.bankAccount.validate',
90
115
  resize: 'justifi.bankAccount.resize',
116
+ styleOverrides: 'justifi.bankAccount.styleOverrides',
91
117
  }
92
118
  };
93
119
 
@@ -100,6 +126,7 @@ const PaymentMethodForm = class {
100
126
  this.paymentMethodFormTokenize = createEvent(this, "paymentMethodFormTokenize", 7);
101
127
  this.paymentMethodFormType = undefined;
102
128
  this.paymentMethodFormValidationStrategy = undefined;
129
+ this.paymentMethodStyleOverrides = undefined;
103
130
  this.height = 55;
104
131
  }
105
132
  connectedCallback() {
@@ -108,6 +135,14 @@ const PaymentMethodForm = class {
108
135
  disconnectedCallback() {
109
136
  window.removeEventListener('message', this.dispatchMessageEvent.bind(this));
110
137
  }
138
+ componentShouldUpdate() {
139
+ this.sendStyleOverrides();
140
+ }
141
+ sendStyleOverrides() {
142
+ if (this.paymentMethodStyleOverrides) {
143
+ this.postMessage(MessageEventType[this.paymentMethodFormType].styleOverrides, { styleOverrides: this.paymentMethodStyleOverrides });
144
+ }
145
+ }
111
146
  dispatchMessageEvent(messageEvent) {
112
147
  const messagePayload = messageEvent.data;
113
148
  const messageType = messagePayload.eventType;
@@ -119,6 +154,12 @@ const PaymentMethodForm = class {
119
154
  this.height = messageData.height;
120
155
  }
121
156
  }
157
+ postMessage(eventType, payload) {
158
+ if (this.iframeElement) {
159
+ this.iframeElement.contentWindow.postMessage(Object.assign({ eventType: eventType }, payload), '*');
160
+ }
161
+ }
162
+ ;
122
163
  async postMessageWithResponseListener(eventType, payload) {
123
164
  return new Promise((resolve) => {
124
165
  const responseListener = (event) => {
@@ -128,7 +169,7 @@ const PaymentMethodForm = class {
128
169
  resolve(event.data.data);
129
170
  };
130
171
  window.addEventListener('message', responseListener);
131
- this.iframeElement.contentWindow.postMessage(Object.assign({ eventType: eventType }, payload), '*');
172
+ this.postMessage(eventType, payload);
132
173
  });
133
174
  }
134
175
  async tokenize(clientKey, paymentMethodMetadata, account) {
@@ -155,6 +196,9 @@ const PaymentMethodForm = class {
155
196
  render() {
156
197
  return (h(Host, null, h("iframe", { id: `justifi-payment-method-form-${this.paymentMethodFormType}`, src: this.getIframeSrc(), ref: (el) => this.iframeElement = el, height: this.height })));
157
198
  }
199
+ static get watchers() { return {
200
+ "paymentMethodStyleOverrides": ["sendStyleOverrides"]
201
+ }; }
158
202
  };
159
203
  PaymentMethodForm.style = paymentMethodFormCss;
160
204
 
@@ -1,8 +1,8 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-3d88d85c.js';
2
- export { s as setNonce } from './index-3d88d85c.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-c1f569bd.js';
2
+ export { s as setNonce } from './index-c1f569bd.js';
3
3
 
4
4
  /*
5
- Stencil Client Patch Esm v2.22.1 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Patch Esm v2.22.2 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  const patchEsm = () => {
8
8
  return promiseResolve();
@@ -11,7 +11,7 @@ const patchEsm = () => {
11
11
  const defineCustomElements = (win, options) => {
12
12
  if (typeof window === 'undefined') return Promise.resolve();
13
13
  return patchEsm().then(() => {
14
- return bootstrapLazy([["justifi-bank-account-form_4",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]],[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]],[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}],[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"height":[32],"tokenize":[64],"validate":[64]}]]]], options);
14
+ return bootstrapLazy([["justifi-bank-account-form_4",[[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"]]],[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"]]],[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}],[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
15
  });
16
16
  };
17
17
 
@@ -1,8 +1,8 @@
1
- import { p as promiseResolve, b as bootstrapLazy } from './index-3d88d85c.js';
2
- export { s as setNonce } from './index-3d88d85c.js';
1
+ import { p as promiseResolve, b as bootstrapLazy } from './index-c1f569bd.js';
2
+ export { s as setNonce } from './index-c1f569bd.js';
3
3
 
4
4
  /*
5
- Stencil Client Patch Browser v2.22.1 | MIT Licensed | https://stenciljs.com
5
+ Stencil Client Patch Browser v2.22.2 | MIT Licensed | https://stenciljs.com
6
6
  */
7
7
  const patchBrowser = () => {
8
8
  const importMeta = import.meta.url;
@@ -14,5 +14,5 @@ const patchBrowser = () => {
14
14
  };
15
15
 
16
16
  patchBrowser().then(options => {
17
- return bootstrapLazy([["justifi-bank-account-form_4",[[0,"justifi-bank-account-form",{"validationStrategy":[1,"validation-strategy"],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]],[0,"justifi-card-form",{"validationStrategy":[1,"validation-strategy"],"tokenize":[64],"validate":[64]},[[0,"paymentMethodFormReady","readyHandler"],[0,"paymentMethodFormTokenize","tokenizeHandler"],[0,"paymentMethodFormValidate","validateHandler"]]],[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}],[0,"justifi-payment-method-form",{"paymentMethodFormType":[1,"payment-method-form-type"],"paymentMethodFormValidationStrategy":[1,"payment-method-form-validation-strategy"],"height":[32],"tokenize":[64],"validate":[64]}]]]], options);
17
+ return bootstrapLazy([["justifi-bank-account-form_4",[[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"]]],[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"]]],[1,"justifi-payments-list",{"accountId":[1,"account-id"],"auth":[16],"payments":[32]}],[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
18
  });
@@ -1,6 +1,9 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { Theme } from '../payment-method-form/theme';
2
3
  export declare class BankAccountForm {
3
4
  validationStrategy: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
5
+ styleOverrides?: string;
6
+ internalStyleOverrides: Theme;
4
7
  bankAccountFormReady: EventEmitter;
5
8
  bankAccountFormTokenize: EventEmitter<{
6
9
  data: any;
@@ -17,6 +20,8 @@ export declare class BankAccountForm {
17
20
  validateHandler(event: {
18
21
  data: any;
19
22
  }): void;
23
+ componentWillLoad(): void;
24
+ parseStyleOverrides(): void;
20
25
  private childRef?;
21
26
  tokenize(...args: Parameters<HTMLJustifiPaymentMethodFormElement['tokenize']>): Promise<any>;
22
27
  validate(): Promise<any>;
@@ -1,6 +1,9 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { Theme } from '../payment-method-form/theme';
2
3
  export declare class CardForm {
3
4
  validationStrategy: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
5
+ styleOverrides?: string;
6
+ internalStyleOverrides: Theme;
4
7
  cardFormReady: EventEmitter;
5
8
  cardFormTokenize: EventEmitter<{
6
9
  data: any;
@@ -17,6 +20,8 @@ export declare class CardForm {
17
20
  validateHandler(event: {
18
21
  data: any;
19
22
  }): void;
23
+ componentWillLoad(): void;
24
+ parseStyleOverrides(): void;
20
25
  private childRef?;
21
26
  tokenize(...args: Parameters<HTMLJustifiPaymentMethodFormElement['tokenize']>): Promise<any>;
22
27
  validate(): Promise<any>;
@@ -4,11 +4,13 @@ export declare const MessageEventType: {
4
4
  tokenize: string;
5
5
  validate: string;
6
6
  resize: string;
7
+ styleOverrides: string;
7
8
  };
8
9
  bankAccount: {
9
10
  ready: string;
10
11
  tokenize: string;
11
12
  validate: string;
12
13
  resize: string;
14
+ styleOverrides: string;
13
15
  };
14
16
  };
@@ -1,7 +1,9 @@
1
1
  import { EventEmitter } from '../../stencil-public-runtime';
2
+ import { Theme } from './theme';
2
3
  export declare class PaymentMethodForm {
3
4
  paymentMethodFormType: 'card' | 'bankAccount';
4
5
  paymentMethodFormValidationStrategy: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
6
+ paymentMethodStyleOverrides: Theme;
5
7
  paymentMethodFormReady: EventEmitter;
6
8
  paymentMethodFormTokenize: EventEmitter<{
7
9
  data: any;
@@ -10,7 +12,10 @@ export declare class PaymentMethodForm {
10
12
  iframeElement: HTMLIFrameElement;
11
13
  connectedCallback(): void;
12
14
  disconnectedCallback(): void;
15
+ componentShouldUpdate(): void;
16
+ sendStyleOverrides(): void;
13
17
  private dispatchMessageEvent;
18
+ private postMessage;
14
19
  private postMessageWithResponseListener;
15
20
  tokenize(clientKey: string, paymentMethodMetadata: any, account?: string): Promise<any>;
16
21
  validate(): Promise<any>;
@@ -0,0 +1,43 @@
1
+ export interface Theme {
2
+ layout?: {
3
+ padding?: string;
4
+ formControlSpacingHorizontal?: string;
5
+ formControlSpacingVertical?: string;
6
+ };
7
+ formLabel?: {
8
+ fontWeight?: string;
9
+ fontFamily?: string;
10
+ margin?: string;
11
+ };
12
+ formControl?: {
13
+ backgroundColor?: string;
14
+ backgroundColorHover?: string;
15
+ borderColor?: string;
16
+ borderColorHover?: string;
17
+ borderColorFocus?: string;
18
+ borderColorError?: string;
19
+ borderWidth?: string;
20
+ borderBottomWidth?: string;
21
+ borderLeftWidth?: string;
22
+ borderRightWidth?: string;
23
+ borderTopWidth?: string;
24
+ borderRadius?: string;
25
+ borderStyle?: string;
26
+ boxShadow?: string;
27
+ boxShadowError?: string;
28
+ boxShadowErrorFocus?: string;
29
+ boxShadowFocus?: string;
30
+ color?: string;
31
+ colorFocus?: string;
32
+ fontSize?: string;
33
+ fontWeight?: string;
34
+ lineHeight?: string;
35
+ margin?: string;
36
+ padding?: string;
37
+ };
38
+ errorMessage?: {
39
+ color?: string;
40
+ margin?: string;
41
+ fontSize?: string;
42
+ };
43
+ }
@@ -5,13 +5,16 @@
5
5
  * It contains typing information for all components that exist in this project.
6
6
  */
7
7
  import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
+ import { Theme } from "./components/payment-method-form/theme";
8
9
  export namespace Components {
9
10
  interface JustifiBankAccountForm {
11
+ "styleOverrides"?: string;
10
12
  "tokenize": (clientKey: string, paymentMethodMetadata: any, account?: string) => Promise<any>;
11
13
  "validate": () => Promise<any>;
12
14
  "validationStrategy": 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
13
15
  }
14
16
  interface JustifiCardForm {
17
+ "styleOverrides"?: string;
15
18
  "tokenize": (clientKey: string, paymentMethodMetadata: any, account?: string) => Promise<any>;
16
19
  "validate": () => Promise<any>;
17
20
  "validationStrategy": 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
@@ -19,6 +22,7 @@ export namespace Components {
19
22
  interface JustifiPaymentMethodForm {
20
23
  "paymentMethodFormType": 'card' | 'bankAccount';
21
24
  "paymentMethodFormValidationStrategy": 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
25
+ "paymentMethodStyleOverrides": Theme;
22
26
  "tokenize": (clientKey: string, paymentMethodMetadata: any, account?: string) => Promise<any>;
23
27
  "validate": () => Promise<any>;
24
28
  }
@@ -76,12 +80,14 @@ declare namespace LocalJSX {
76
80
  "onBankAccountFormReady"?: (event: JustifiBankAccountFormCustomEvent<any>) => void;
77
81
  "onBankAccountFormTokenize"?: (event: JustifiBankAccountFormCustomEvent<{ data: any }>) => void;
78
82
  "onBankAccountFormValidate"?: (event: JustifiBankAccountFormCustomEvent<{ data: { isValid: boolean } }>) => void;
83
+ "styleOverrides"?: string;
79
84
  "validationStrategy"?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
80
85
  }
81
86
  interface JustifiCardForm {
82
87
  "onCardFormReady"?: (event: JustifiCardFormCustomEvent<any>) => void;
83
88
  "onCardFormTokenize"?: (event: JustifiCardFormCustomEvent<{ data: any }>) => void;
84
89
  "onCardFormValidate"?: (event: JustifiCardFormCustomEvent<{ data: { isValid: boolean } }>) => void;
90
+ "styleOverrides"?: string;
85
91
  "validationStrategy"?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
86
92
  }
87
93
  interface JustifiPaymentMethodForm {
@@ -89,6 +95,7 @@ declare namespace LocalJSX {
89
95
  "onPaymentMethodFormTokenize"?: (event: JustifiPaymentMethodFormCustomEvent<{ data: any }>) => void;
90
96
  "paymentMethodFormType"?: 'card' | 'bankAccount';
91
97
  "paymentMethodFormValidationStrategy"?: 'onChange' | 'onBlur' | 'onSubmit' | 'onTouched' | 'all';
98
+ "paymentMethodStyleOverrides"?: Theme;
92
99
  }
93
100
  interface JustifiPaymentsList {
94
101
  "accountId"?: string;
@@ -485,6 +485,14 @@ export interface FunctionalUtilities {
485
485
  export interface FunctionalComponent<T = {}> {
486
486
  (props: T, children: VNode[], utils: FunctionalUtilities): VNode | VNode[];
487
487
  }
488
+ /**
489
+ * A Child VDOM node
490
+ *
491
+ * This has most of the same properties as {@link VNode} but friendlier names
492
+ * (i.e. `vtag` instead of `$tag$`, `vchildren` instead of `$children$`) in
493
+ * order to provide a friendlier public interface for users of the
494
+ * {@link FunctionalUtilities}).
495
+ */
488
496
  export interface ChildNode {
489
497
  vtag?: string | number | Function;
490
498
  vkey?: string | number;
@@ -531,6 +539,9 @@ export declare function h(sel: any, children: Array<VNode | undefined | null>):
531
539
  export declare function h(sel: any, data: VNodeData | null, text: string): VNode;
532
540
  export declare function h(sel: any, data: VNodeData | null, children: Array<VNode | undefined | null>): VNode;
533
541
  export declare function h(sel: any, data: VNodeData | null, children: VNode): VNode;
542
+ /**
543
+ * A virtual DOM node
544
+ */
534
545
  export interface VNode {
535
546
  $flags$: number;
536
547
  $tag$: string | number | Function;
@@ -0,0 +1,2 @@
1
+ let e,n,t=!1;const l={},o=e=>"object"==(e=typeof e)||"function"===e;function s(e){var n,t,l;return null!==(l=null===(t=null===(n=e.head)||void 0===n?void 0:n.querySelector('meta[name="csp-nonce"]'))||void 0===t?void 0:t.getAttribute("content"))&&void 0!==l?l:void 0}const c=(e,n,...t)=>{let l=null,s=!1,c=!1;const r=[],u=n=>{for(let t=0;t<n.length;t++)l=n[t],Array.isArray(l)?u(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof e&&!o(l))&&(l+=""),s&&c?r[r.length-1].t+=l:r.push(s?i(null,l):l),c=s)};if(u(t),n){const e=n.className||n.class;e&&(n.class="object"!=typeof e?e:Object.keys(e).filter((n=>e[n])).join(" "))}const a=i(e,null);return a.l=n,r.length>0&&(a.o=r),a},i=(e,n)=>({i:0,u:e,t:n,h:null,o:null,l:null}),r={},u=(e,n,t)=>{const l=(e=>V(e).m)(e);return{emit:e=>a(l,n,{bubbles:!!(4&t),composed:!!(2&t),cancelable:!!(1&t),detail:e})}},a=(e,n,t)=>{const l=X.ce(n,t);return e.dispatchEvent(l),l},f=new WeakMap,d=e=>"sc-"+e.$,h=(e,n,t,l,s,c)=>{if(t!==l){let i=B(e,n);if(n.toLowerCase(),"class"===n){const n=e.classList,o=y(t),s=y(l);n.remove(...o.filter((e=>e&&!s.includes(e)))),n.add(...s.filter((e=>e&&!o.includes(e))))}else if("ref"===n)l&&l(e);else{const r=o(l);if((i||r&&null!==l)&&!s)try{if(e.tagName.includes("-"))e[n]=l;else{const o=null==l?"":l;"list"===n?i=!1:null!=t&&e[n]==o||(e[n]=o)}}catch(e){}null==l||!1===l?!1===l&&""!==e.getAttribute(n)||e.removeAttribute(n):(!i||4&c||s)&&!r&&e.setAttribute(n,l=!0===l?"":l)}}},m=/\s/,y=e=>e?e.split(m):[],$=(e,n,t,o)=>{const s=11===n.h.nodeType&&n.h.host?n.h.host:n.h,c=e&&e.l||l,i=n.l||l;for(o in c)o in i||h(s,o,c[o],void 0,t,n.i);for(o in i)h(s,o,c[o],i[o],t,n.i)},p=(n,t,l)=>{const o=t.o[l];let s,c,i=0;if(null!==o.t)s=o.h=Q.createTextNode(o.t);else if(s=o.h=Q.createElement(o.u),$(null,o,!1),null!=e&&s["s-si"]!==e&&s.classList.add(s["s-si"]=e),o.o)for(i=0;i<o.o.length;++i)c=p(n,o,i),c&&s.appendChild(c);return s},b=(e,t,l,o,s,c)=>{let i,r=e;for(r.shadowRoot&&r.tagName===n&&(r=r.shadowRoot);s<=c;++s)o[s]&&(i=p(null,l,s),i&&(o[s].h=i,r.insertBefore(i,t)))},w=(e,n,t,l,o)=>{for(;n<=t;++n)(l=e[n])&&(o=l.h,g(l),o.remove())},v=(e,n)=>e.u===n.u,S=(e,n)=>{const t=n.h=e.h,l=e.o,o=n.o,s=n.t;null===s?($(e,n,!1),null!==l&&null!==o?((e,n,t,l)=>{let o,s=0,c=0,i=n.length-1,r=n[0],u=n[i],a=l.length-1,f=l[0],d=l[a];for(;s<=i&&c<=a;)null==r?r=n[++s]:null==u?u=n[--i]:null==f?f=l[++c]:null==d?d=l[--a]:v(r,f)?(S(r,f),r=n[++s],f=l[++c]):v(u,d)?(S(u,d),u=n[--i],d=l[--a]):v(r,d)?(S(r,d),e.insertBefore(r.h,u.h.nextSibling),r=n[++s],d=l[--a]):v(u,f)?(S(u,f),e.insertBefore(u.h,r.h),u=n[--i],f=l[++c]):(o=p(n&&n[c],t,c),f=l[++c],o&&r.h.parentNode.insertBefore(o,r.h));s>i?b(e,null==l[a+1]?null:l[a+1].h,t,l,c,a):c>a&&w(n,s,i)})(t,l,n,o):null!==o?(null!==e.t&&(t.textContent=""),b(t,null,n,o,0,o.length-1)):null!==l&&w(l,0,l.length-1)):e.t!==s&&(t.data=s)},g=e=>{e.l&&e.l.ref&&e.l.ref(null),e.o&&e.o.map(g)},j=(e,n)=>{n&&!e.p&&n["s-p"]&&n["s-p"].push(new Promise((n=>e.p=n)))},k=(e,n)=>{if(e.i|=16,!(4&e.i))return j(e,e.v),ce((()=>C(e,n)));e.i|=512},C=(e,n)=>{const t=e.S;let l;return n&&(e.i|=256,e.g&&(e.g.map((([e,n])=>E(t,e,n))),e.g=null),l=E(t,"componentWillLoad")),L(l,(()=>M(e,t,n)))},M=async(e,n,t)=>{const l=e.m,o=l["s-rc"];t&&(e=>{const n=e.j,t=e.m,l=n.i,o=((e,n)=>{var t;let l=d(n);const o=J.get(l);if(e=11===e.nodeType?e:Q,o)if("string"==typeof o){let n,c=f.get(e=e.head||e);if(c||f.set(e,c=new Set),!c.has(l)){{n=Q.createElement("style"),n.innerHTML=o;const l=null!==(t=X.k)&&void 0!==t?t:s(Q);null!=l&&n.setAttribute("nonce",l),e.insertBefore(n,e.querySelector("link"))}c&&c.add(l)}}else e.adoptedStyleSheets.includes(o)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,o]);return l})(t.shadowRoot?t.shadowRoot:t.getRootNode(),n);10&l&&(t["s-sc"]=o,t.classList.add(o+"-h"))})(e);O(e,n),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const n=l["s-p"],t=()=>P(e);0===n.length?t():(Promise.all(n).then(t),e.i|=4,n.length=0)}},O=(t,l)=>{try{l=l.render(),t.i&=-17,t.i|=2,((t,l)=>{const o=t.m,s=t.C||i(null,null),u=(e=>e&&e.u===r)(l)?l:c(null,null,l);n=o.tagName,u.u=null,u.i|=4,t.C=u,u.h=s.h=o.shadowRoot||o,e=o["s-sc"],S(s,u)})(t,l)}catch(e){D(e,t.m)}return null},P=e=>{const n=e.m,t=e.v;64&e.i||(e.i|=64,N(n),e.M(n),t||x()),e.O(n),e.p&&(e.p(),e.p=void 0),512&e.i&&se((()=>k(e,!1))),e.i&=-517},x=()=>{N(Q.documentElement),se((()=>a(K,"appload",{detail:{namespace:"webcomponents"}})))},E=(e,n,t)=>{if(e&&e[n])try{return e[n](t)}catch(e){D(e)}},L=(e,n)=>e&&e.then?e.then(n):n(),N=e=>e.classList.add("hydrated"),T=(e,n,t)=>{if(n.P){e.watchers&&(n.L=e.watchers);const l=Object.entries(n.P),s=e.prototype;if(l.map((([e,[l]])=>{31&l||2&t&&32&l?Object.defineProperty(s,e,{get(){return((e,n)=>V(this).N.get(n))(0,e)},set(t){((e,n,t,l)=>{const s=V(e),c=s.m,i=s.N.get(n),r=s.i,u=s.S;if(t=((e,n)=>null==e||o(e)?e:1&n?e+"":e)(t,l.P[n][0]),(!(8&r)||void 0===i)&&t!==i&&(!Number.isNaN(i)||!Number.isNaN(t))&&(s.N.set(n,t),u)){if(l.L&&128&r){const e=l.L[n];e&&e.map((e=>{try{u[e](t,i,n)}catch(e){D(e,c)}}))}if(2==(18&r)){if(u.componentShouldUpdate&&!1===u.componentShouldUpdate(t,i,n))return;k(s,!1)}}})(this,e,t,n)},configurable:!0,enumerable:!0}):1&t&&64&l&&Object.defineProperty(s,e,{value(...n){const t=V(this);return t.T.then((()=>t.S[e](...n)))}})})),1&t){const n=new Map;s.attributeChangedCallback=function(e,t,l){X.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(s.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,n])=>15&n[0])).map((([e,t])=>{const l=t[1]||e;return n.set(l,e),l}))}}return e},W=e=>{E(e,"connectedCallback")},A=(e,n={})=>{var t;const l=[],o=n.exclude||[],c=K.customElements,i=Q.head,r=i.querySelector("meta[charset]"),u=Q.createElement("style"),a=[];let f,h=!0;Object.assign(X,n),X.W=new URL(n.resourcesUrl||"./",Q.baseURI).href,e.map((e=>{e[1].map((n=>{const t={i:n[0],$:n[1],P:n[2],A:n[3]};t.P=n[2],t.A=n[3],t.L={};const s=t.$,i=class extends HTMLElement{constructor(e){super(e),z(e=this,t),1&t.i&&e.attachShadow({mode:"open"})}connectedCallback(){f&&(clearTimeout(f),f=null),h?a.push(this):X.jmp((()=>(e=>{if(0==(1&X.i)){const n=V(e),t=n.j,l=()=>{};if(1&n.i)H(e,n,t.A),W(n.S);else{n.i|=1;{let t=e;for(;t=t.parentNode||t.host;)if(t["s-p"]){j(n,n.v=t);break}}t.P&&Object.entries(t.P).map((([n,[t]])=>{if(31&t&&e.hasOwnProperty(n)){const t=e[n];delete e[n],e[n]=t}})),(async(e,n,t,l,o)=>{if(0==(32&n.i)){{if(n.i|=32,(o=I(t)).then){const e=()=>{};o=await o,e()}o.isProxied||(t.L=o.watchers,T(o,t,2),o.isProxied=!0);const e=()=>{};n.i|=8;try{new o(n)}catch(e){D(e)}n.i&=-9,n.i|=128,e(),W(n.S)}if(o.style){let e=o.style;const n=d(t);if(!J.has(n)){const l=()=>{};((e,n,t)=>{let l=J.get(e);Z&&t?(l=l||new CSSStyleSheet,"string"==typeof l?l=n:l.replaceSync(n)):l=n,J.set(e,l)})(n,e,!!(1&t.i)),l()}}}const s=n.v,c=()=>k(n,!0);s&&s["s-rc"]?s["s-rc"].push(c):c()})(0,n,t)}l()}})(this)))}disconnectedCallback(){X.jmp((()=>(()=>{if(0==(1&X.i)){const e=V(this),n=e.S;e.H&&(e.H.map((e=>e())),e.H=void 0),E(n,"disconnectedCallback")}})()))}componentOnReady(){return V(this).R}};t.U=e[0],o.includes(s)||c.get(s)||(l.push(s),c.define(s,T(i,t,1)))}))}));{u.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",u.setAttribute("data-styles","");const e=null!==(t=X.k)&&void 0!==t?t:s(Q);null!=e&&u.setAttribute("nonce",e),i.insertBefore(u,r?r.nextSibling:i.firstChild)}h=!1,a.length?a.map((e=>e.connectedCallback())):X.jmp((()=>f=setTimeout(x,30)))},H=(e,n,t)=>{t&&t.map((([t,l,o])=>{const s=e,c=R(n,o),i=U(t);X.ael(s,l,c,i),(n.H=n.H||[]).push((()=>X.rel(s,l,c,i)))}))},R=(e,n)=>t=>{try{256&e.i?e.S[n](t):(e.g=e.g||[]).push([n,t])}catch(e){D(e)}},U=e=>0!=(2&e),q=e=>X.k=e,F=new WeakMap,V=e=>F.get(e),_=(e,n)=>F.set(n.S=e,n),z=(e,n)=>{const t={i:0,m:e,j:n,N:new Map};return t.T=new Promise((e=>t.O=e)),t.R=new Promise((e=>t.M=e)),e["s-p"]=[],e["s-rc"]=[],H(e,t,n.A),F.set(e,t)},B=(e,n)=>n in e,D=(e,n)=>(0,console.error)(e,n),G=new Map,I=e=>{const n=e.$.replace(/-/g,"_"),t=e.U,l=G.get(t);return l?l[n]:import(`./${t}.entry.js`).then((e=>(G.set(t,e),e[n])),D)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},J=new Map,K="undefined"!=typeof window?window:{},Q=K.document||{head:{}},X={i:0,W:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,n,t,l)=>e.addEventListener(n,t,l),rel:(e,n,t,l)=>e.removeEventListener(n,t,l),ce:(e,n)=>new CustomEvent(e,n)},Y=e=>Promise.resolve(e),Z=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),ee=[],ne=[],te=(e,n)=>l=>{e.push(l),t||(t=!0,n&&4&X.i?se(oe):X.raf(oe))},le=e=>{for(let n=0;n<e.length;n++)try{e[n](performance.now())}catch(e){D(e)}e.length=0},oe=()=>{le(ee),le(ne),(t=ee.length>0)&&X.raf(oe)},se=e=>Y().then(e),ce=te(ne,!0);export{r as H,A as b,u as c,c as h,Y as p,_ as r,q as s}