@saasquatch/mint-components 1.10.3 → 1.11.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/{ShadowViewAddon-c3e91cee.js → ShadowViewAddon-21aa34f8.js} +32 -57
- package/dist/cjs/{email-registration-view-248652bb.js → email-registration-view-5170d9f1.js} +1 -1
- package/dist/cjs/{global-02e50f09.js → global-4a59a374.js} +1 -1
- package/dist/cjs/loader.cjs.js +2 -2
- package/dist/cjs/mint-components.cjs.js +2 -2
- package/dist/cjs/sqm-banking-info-form_16.cjs.entry.js +115 -142
- package/dist/cjs/sqm-big-stat_38.cjs.entry.js +24 -65
- package/dist/cjs/sqm-empty_4.cjs.entry.js +2 -9
- package/dist/cjs/sqm-instant-access-registration.cjs.entry.js +1 -1
- package/dist/cjs/{sqm-invoice-table-view-28b14d28.js → sqm-invoice-table-view-c26fb670.js} +6 -8
- package/dist/cjs/sqm-leaderboard-rank.cjs.entry.js +1 -1
- package/dist/cjs/sqm-logout-current-user.cjs.entry.js +10 -9
- package/dist/cjs/{sqm-portal-container-view-990a85a3.js → sqm-portal-container-view-5fb2ad49.js} +1 -1
- package/dist/cjs/{sqm-portal-email-verification-view-292b5bf4.js → sqm-portal-email-verification-view-07161940.js} +1 -1
- package/dist/cjs/sqm-portal-email-verification.cjs.entry.js +2 -2
- package/dist/cjs/{sqm-portal-profile-view-fde54e35.js → sqm-portal-profile-view-07b99f80.js} +1 -1
- package/dist/cjs/sqm-portal-profile.cjs.entry.js +2 -2
- package/dist/cjs/sqm-referral-table_11.cjs.entry.js +1 -1
- package/dist/cjs/sqm-referred-registration.cjs.entry.js +1 -1
- package/dist/cjs/sqm-rewards-table_9.cjs.entry.js +1 -1
- package/dist/cjs/sqm-stencilbook.cjs.entry.js +57 -180
- package/dist/collection/components/sqm-card-feed/sqm-card-feed.js +1 -1
- package/dist/collection/components/sqm-empty/EmptyState.stories.js +1 -1
- package/dist/collection/components/sqm-image/sqm-image-view.js +1 -1
- package/dist/collection/components/sqm-image/sqm-image.js +0 -20
- package/dist/collection/components/sqm-leaderboard/Leaderboard.stories.js +24 -130
- package/dist/collection/components/sqm-leaderboard/sqm-leaderboard-view.js +29 -55
- package/dist/collection/components/sqm-leaderboard/sqm-leaderboard.js +29 -93
- package/dist/collection/components/sqm-leaderboard/useLeaderboard.js +4 -40
- package/dist/collection/components/sqm-logout-current-user/useLogoutCurrentUser.js +10 -9
- package/dist/collection/components/sqm-portal-container/PortalContainer.stories.js +7 -19
- package/dist/collection/components/sqm-portal-container/sqm-portal-container-view.js +1 -1
- package/dist/collection/components/sqm-portal-container/sqm-portal-container.js +0 -37
- package/dist/collection/components/sqm-referral-card/ReferralCard.stories.js +1 -1
- package/dist/collection/components/sqm-share-button/ShareButton.stories.js +1 -1
- package/dist/collection/components/sqm-share-button/sqm-share-button-view.js +1 -1
- package/dist/collection/components/sqm-share-button/sqm-share-button.js +2 -2
- package/dist/collection/components/sqm-task-card/UseTaskCard.stories.js +1 -1
- package/dist/collection/components/sqm-task-card/sqm-task-card.js +1 -1
- package/dist/collection/components/tax-and-cash/TaxForm.stories.js +1 -0
- package/dist/collection/components/tax-and-cash/sqm-banking-info-form/sqm-banking-info-form-view.js +1 -2
- package/dist/collection/components/tax-and-cash/sqm-docusign-form/docusign-iframe/DocusignIframe.js +18 -11
- package/dist/collection/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form-view.js +3 -19
- package/dist/collection/components/tax-and-cash/sqm-docusign-form/sqm-docusign-form.js +3 -2
- package/dist/collection/components/tax-and-cash/sqm-docusign-form/useDocusignForm.js +43 -36
- package/dist/collection/components/tax-and-cash/sqm-indirect-tax-form/useIndirectTaxForm.js +2 -2
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash/useTaxAndCash.js +2 -3
- package/dist/collection/components/tax-and-cash/sqm-tax-and-cash-dashboard/useTaxAndCashDashboard.js +12 -12
- package/dist/collection/components/tax-and-cash/sqm-user-info-form/sqm-user-info-form-view.js +32 -55
- package/dist/collection/components/tax-and-cash/utils.js +4 -7
- package/dist/collection/components/views/email-registration-view.js +1 -1
- package/dist/collection/global/global.js +1 -1
- package/dist/collection/stories/NewPortal.stories.js +1 -1
- package/dist/esm/{ShadowViewAddon-e012b2aa.js → ShadowViewAddon-90897c22.js} +32 -57
- package/dist/esm/{email-registration-view-a89a88bf.js → email-registration-view-07d80492.js} +1 -1
- package/dist/esm/{global-04c7d3b5.js → global-e7bb0343.js} +1 -1
- package/dist/esm/loader.js +2 -2
- package/dist/esm/mint-components.js +2 -2
- package/dist/esm/sqm-banking-info-form_16.entry.js +115 -142
- package/dist/esm/sqm-big-stat_38.entry.js +24 -65
- package/dist/esm/sqm-empty_4.entry.js +2 -9
- package/dist/esm/sqm-instant-access-registration.entry.js +1 -1
- package/dist/esm/{sqm-invoice-table-view-34ac7513.js → sqm-invoice-table-view-2175569f.js} +6 -8
- package/dist/esm/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm/sqm-logout-current-user.entry.js +10 -9
- package/dist/esm/{sqm-portal-container-view-6c582684.js → sqm-portal-container-view-ab89c6cc.js} +1 -1
- package/dist/esm/{sqm-portal-email-verification-view-4307c992.js → sqm-portal-email-verification-view-0b32261f.js} +1 -1
- package/dist/esm/sqm-portal-email-verification.entry.js +2 -2
- package/dist/esm/{sqm-portal-profile-view-ffe955c8.js → sqm-portal-profile-view-03026a5e.js} +1 -1
- package/dist/esm/sqm-portal-profile.entry.js +2 -2
- package/dist/esm/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm/sqm-referred-registration.entry.js +1 -1
- package/dist/esm/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm/sqm-stencilbook.entry.js +57 -180
- package/dist/esm-es5/ShadowViewAddon-90897c22.js +1 -0
- package/dist/esm-es5/email-registration-view-07d80492.js +1 -0
- package/dist/esm-es5/{global-04c7d3b5.js → global-e7bb0343.js} +1 -1
- package/dist/esm-es5/loader.js +1 -1
- package/dist/esm-es5/mint-components.js +1 -1
- package/dist/esm-es5/sqm-banking-info-form_16.entry.js +1 -1
- package/dist/esm-es5/sqm-big-stat_38.entry.js +1 -1
- package/dist/esm-es5/sqm-empty_4.entry.js +1 -1
- package/dist/esm-es5/sqm-instant-access-registration.entry.js +1 -1
- package/dist/esm-es5/sqm-invoice-table-view-2175569f.js +1 -0
- package/dist/esm-es5/sqm-leaderboard-rank.entry.js +1 -1
- package/dist/esm-es5/sqm-logout-current-user.entry.js +1 -1
- package/dist/esm-es5/sqm-portal-container-view-ab89c6cc.js +1 -0
- package/dist/esm-es5/{sqm-portal-email-verification-view-4307c992.js → sqm-portal-email-verification-view-0b32261f.js} +1 -1
- package/dist/esm-es5/sqm-portal-email-verification.entry.js +1 -1
- package/dist/esm-es5/{sqm-portal-profile-view-ffe955c8.js → sqm-portal-profile-view-03026a5e.js} +1 -1
- package/dist/esm-es5/sqm-portal-profile.entry.js +1 -1
- package/dist/esm-es5/sqm-referral-table_11.entry.js +1 -1
- package/dist/esm-es5/sqm-referred-registration.entry.js +1 -1
- package/dist/esm-es5/sqm-rewards-table_9.entry.js +1 -1
- package/dist/esm-es5/sqm-stencilbook.entry.js +1 -1
- package/dist/mint-components/mint-components.esm.js +1 -1
- package/dist/mint-components/mint-components.js +1 -1
- package/dist/mint-components/p-007383e1.entry.js +9 -0
- package/dist/mint-components/{p-10685090.js → p-05948592.js} +23 -23
- package/dist/mint-components/p-05a9bc83.entry.js +9 -0
- package/dist/mint-components/{p-4d233cd4.js → p-0e556260.js} +1 -1
- package/dist/mint-components/p-10036f16.js +1 -0
- package/dist/mint-components/p-227dec48.js +1 -0
- package/dist/mint-components/p-3dbf752a.system.entry.js +1 -0
- package/dist/mint-components/p-445ffcfd.system.entry.js +1 -0
- package/dist/mint-components/p-482bf487.system.js +1 -0
- package/dist/mint-components/{p-b6fc1227.system.entry.js → p-4864ed8a.system.entry.js} +1 -1
- package/dist/mint-components/p-5301a2da.system.entry.js +1 -0
- package/dist/mint-components/{p-01cfff8a.system.entry.js → p-55a782cf.system.entry.js} +1 -1
- package/dist/mint-components/{p-59fe4ad1.system.js → p-573fab0f.system.js} +1 -1
- package/dist/mint-components/{p-56f14840.entry.js → p-57e4ef5f.entry.js} +1 -1
- package/dist/mint-components/p-5956a47e.entry.js +1 -0
- package/dist/mint-components/{p-7049e9b0.entry.js → p-5d485450.entry.js} +1 -1
- package/dist/mint-components/p-64491c96.system.entry.js +1 -0
- package/dist/mint-components/{p-ce621bcc.js → p-66172a05.js} +1 -1
- package/dist/mint-components/p-6bf41e0d.system.js +1 -0
- package/dist/mint-components/p-76b69493.entry.js +174 -0
- package/dist/mint-components/{p-b4c52c5a.entry.js → p-7a572b34.entry.js} +1 -1
- package/dist/mint-components/{p-be4b748a.system.entry.js → p-8fe21979.system.entry.js} +1 -1
- package/dist/mint-components/p-922578e4.system.js +1 -0
- package/dist/mint-components/{p-3ec16698.entry.js → p-956ed10a.entry.js} +1 -1
- package/dist/mint-components/p-97198e2c.system.js +1 -0
- package/dist/mint-components/{p-4ea58025.system.entry.js → p-973f6501.system.entry.js} +1 -1
- package/dist/mint-components/{p-8704937c.js → p-9774fbc5.js} +1 -1
- package/dist/mint-components/{p-35d84041.system.entry.js → p-a61e6394.system.entry.js} +1 -1
- package/dist/mint-components/{p-1dd69917.system.entry.js → p-b8dbb809.system.entry.js} +1 -1
- package/dist/mint-components/p-be38de26.system.js +1 -0
- package/dist/mint-components/{p-ed095674.system.js → p-c7a3fd1b.system.js} +1 -1
- package/dist/mint-components/p-cf158064.entry.js +33 -0
- package/dist/mint-components/p-d51eb656.entry.js +187 -0
- package/dist/mint-components/{p-4df8f1d2.system.js → p-d7df3dfd.system.js} +1 -1
- package/dist/mint-components/{p-32d1d162.entry.js → p-dab544d9.entry.js} +1 -1
- package/dist/mint-components/{p-c7fd9e16.js → p-e704842c.js} +1 -1
- package/dist/mint-components/{p-8679ed9f.system.entry.js → p-e84a74fe.system.entry.js} +1 -1
- package/dist/mint-components/{p-7f088154.entry.js → p-ebcec043.entry.js} +1 -1
- package/dist/mint-components/p-f8f6c99d.system.entry.js +1 -0
- package/dist/types/components/sqm-card-feed/sqm-card-feed.d.ts +1 -1
- package/dist/types/components/sqm-image/sqm-image-view.d.ts +0 -1
- package/dist/types/components/sqm-image/sqm-image.d.ts +0 -5
- package/dist/types/components/sqm-leaderboard/Leaderboard.stories.d.ts +1 -5
- package/dist/types/components/sqm-leaderboard/sqm-leaderboard-view.d.ts +4 -6
- package/dist/types/components/sqm-leaderboard/sqm-leaderboard.d.ts +6 -23
- package/dist/types/components/sqm-leaderboard/useLeaderboard.d.ts +2 -4
- package/dist/types/components/sqm-portal-container/PortalContainer.stories.d.ts +0 -1
- package/dist/types/components/sqm-portal-container/sqm-portal-container-view.d.ts +0 -1
- package/dist/types/components/sqm-portal-container/sqm-portal-container.d.ts +0 -7
- package/dist/types/components/sqm-share-button/sqm-share-button.d.ts +2 -2
- package/dist/types/components/sqm-task-card/sqm-task-card.d.ts +1 -1
- package/dist/types/components/tax-and-cash/sqm-docusign-form/docusign-iframe/DocusignIframe.d.ts +5 -3
- package/dist/types/components/tax-and-cash/sqm-docusign-form/useDocusignForm.d.ts +2 -1
- package/dist/types/components/tax-and-cash/utils.d.ts +2 -2
- package/dist/types/components.d.ts +14 -66
- package/docs/docs.docx +0 -0
- package/docs/raisins.json +1 -1
- package/grapesjs/grapesjs.js +1 -1
- package/package.json +2 -2
- package/dist/esm-es5/ShadowViewAddon-e012b2aa.js +0 -1
- package/dist/esm-es5/email-registration-view-a89a88bf.js +0 -1
- package/dist/esm-es5/sqm-invoice-table-view-34ac7513.js +0 -1
- package/dist/esm-es5/sqm-portal-container-view-6c582684.js +0 -1
- package/dist/mint-components/p-1c857edb.entry.js +0 -33
- package/dist/mint-components/p-2ffefa3b.entry.js +0 -223
- package/dist/mint-components/p-31e810e9.entry.js +0 -168
- package/dist/mint-components/p-509e29e6.js +0 -1
- package/dist/mint-components/p-5de21018.system.entry.js +0 -1
- package/dist/mint-components/p-7497a4f6.system.entry.js +0 -1
- package/dist/mint-components/p-81689347.entry.js +0 -9
- package/dist/mint-components/p-84361da0.system.entry.js +0 -1
- package/dist/mint-components/p-95771f79.system.js +0 -1
- package/dist/mint-components/p-9f0629ba.system.entry.js +0 -1
- package/dist/mint-components/p-a1dba9a1.system.entry.js +0 -1
- package/dist/mint-components/p-a51533cb.system.js +0 -1
- package/dist/mint-components/p-b23d5520.js +0 -1
- package/dist/mint-components/p-bc51264d.system.js +0 -1
- package/dist/mint-components/p-d8d2de11.entry.js +0 -1
- package/dist/mint-components/p-e3735866.entry.js +0 -11
- package/dist/mint-components/p-ed17e637.system.js +0 -1
- package/dist/mint-components/p-ed6ebd60.system.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { h, r as registerInstance, c as Host, g as getElement } from './index-17b4da69.js';
|
|
2
2
|
import { m as useRef, k as useState, f as useEffect, n as h$1, u as useMemo, b as browser, j as useReducer } from './stencil-hooks.module-ac12ca1c.js';
|
|
3
|
-
import { i as intl } from './global-
|
|
3
|
+
import { i as intl } from './global-e7bb0343.js';
|
|
4
4
|
import { d as dist, L, Q, t as bn, I as In, M as Mn, f as $e, i as isDemo, w as wn, u as useCallback, k as kn, v as Pn, _, C as Cn, F as Fn } from './index.module-def4aec5.js';
|
|
5
5
|
import { j as jsonpointer } from './jsonpointer-388a7082.js';
|
|
6
6
|
import { c as cjs } from './cjs-bdfb4486.js';
|
|
@@ -12,7 +12,7 @@ import { u as useChildElements } from './useChildElements-32e1bda1.js';
|
|
|
12
12
|
import { l as luxon } from './luxon-7600be8d.js';
|
|
13
13
|
import { g as generateUserError } from './useReferralTable-f4de0650.js';
|
|
14
14
|
import { g as getProps, l as luxonLocale } from './utils-334c1e34.js';
|
|
15
|
-
import { t as taxTypeToName, v as validTaxDocument, a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, g as getCountryObj, O as OtherRegionSlotView, I as InvoiceTableView, E as ErrorView, L as LoadingView, c as vatLabels, G as GeneralLoadingView, f as formatErrorMessage, d as validateBillingField, o as objectIsFull, A as ADDRESS_REGIONS } from './sqm-invoice-table-view-
|
|
15
|
+
import { t as taxTypeToName, v as validTaxDocument, a as INDIRECT_TAX_SPAIN_REGIONS, b as INDIRECT_TAX_PROVINCES, g as getCountryObj, O as OtherRegionSlotView, I as InvoiceTableView, E as ErrorView, L as LoadingView, c as vatLabels, G as GeneralLoadingView, f as formatErrorMessage, d as validateBillingField, o as objectIsFull, A as ADDRESS_REGIONS } from './sqm-invoice-table-view-2175569f.js';
|
|
16
16
|
|
|
17
17
|
const TAX_CONTEXT_NAMESPACE = "sq:tax-and-cash";
|
|
18
18
|
const TAX_FORM_CONTEXT_NAMESPACE = "sq:tax-form-context";
|
|
@@ -745,8 +745,7 @@ const style = {
|
|
|
745
745
|
background: "var(--sl-color-gray-200)",
|
|
746
746
|
},
|
|
747
747
|
LargeSkeleton: {
|
|
748
|
-
width: "
|
|
749
|
-
maxWidth: "320px",
|
|
748
|
+
width: "320px",
|
|
750
749
|
height: "40px",
|
|
751
750
|
borderRadius: "50px",
|
|
752
751
|
background: "var(--sl-color-gray-200)",
|
|
@@ -1635,6 +1634,13 @@ const GET_TAX_DOCUMENT = dist.gql `
|
|
|
1635
1634
|
}
|
|
1636
1635
|
}
|
|
1637
1636
|
`;
|
|
1637
|
+
const COMPLETE_TAX_DOCUMENT = dist.gql `
|
|
1638
|
+
mutation completeImpactPublisherTaxDocument($vars: UserIdInput!) {
|
|
1639
|
+
completeImpactPublisherTaxDocument(user: $vars) {
|
|
1640
|
+
success
|
|
1641
|
+
}
|
|
1642
|
+
}
|
|
1643
|
+
`;
|
|
1638
1644
|
const DOCUSIGN_ERROR_STATES = [
|
|
1639
1645
|
"exception",
|
|
1640
1646
|
"decline",
|
|
@@ -1642,22 +1648,22 @@ const DOCUSIGN_ERROR_STATES = [
|
|
|
1642
1648
|
"fax_pending",
|
|
1643
1649
|
];
|
|
1644
1650
|
const DOCUSIGN_EXPIRED_STATES = ["ttl_expired", "session_timeout"];
|
|
1645
|
-
const DOCUSIGN_SUCCESS_STATES = ["signing_complete", "viewing_complete"];
|
|
1646
1651
|
function useDocusignForm(props) {
|
|
1647
|
-
var _a, _b, _c
|
|
1652
|
+
var _a, _b, _c;
|
|
1648
1653
|
const user = Q();
|
|
1649
1654
|
const context = In(TAX_FORM_CONTEXT_NAMESPACE);
|
|
1650
1655
|
const [step, setStep] = bn(TAX_CONTEXT_NAMESPACE);
|
|
1651
1656
|
const { data, loading: userLoading, refetch, } = Mn(USER_QUERY_NAMESPACE);
|
|
1652
1657
|
const publisher = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher;
|
|
1653
1658
|
const [createTaxDocument, { loading: documentLoading, data: document, errors: documentErrors },] = $e(GET_TAX_DOCUMENT);
|
|
1659
|
+
const [completeTaxDocument, { loading: completeDocumentLoading, data: completeData, errors: completeErrors, },] = $e(COMPLETE_TAX_DOCUMENT);
|
|
1654
1660
|
const [docusignStatus, setDocusignStatus] = useState(undefined);
|
|
1655
1661
|
const [participantType, setParticipantType] = useState(undefined);
|
|
1656
1662
|
const [errors, setErrors] = useState({});
|
|
1657
1663
|
const [loading, setLoading] = useState(false);
|
|
1658
1664
|
// Only look at current document if it's valid (same as required type)
|
|
1659
|
-
const existingDocumentType = validTaxDocument(publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType
|
|
1660
|
-
?
|
|
1665
|
+
const existingDocumentType = validTaxDocument(publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType) && (publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument)
|
|
1666
|
+
? publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType : undefined;
|
|
1661
1667
|
const actualDocumentType = existingDocumentType ||
|
|
1662
1668
|
getDocumentType(participantType) || (publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType);
|
|
1663
1669
|
useEffect(() => {
|
|
@@ -1671,19 +1677,14 @@ function useDocusignForm(props) {
|
|
|
1671
1677
|
}
|
|
1672
1678
|
}, [existingDocumentType]);
|
|
1673
1679
|
useEffect(() => {
|
|
1674
|
-
var _a;
|
|
1675
1680
|
// Skip if no publisher info
|
|
1676
1681
|
if (!user || !publisher)
|
|
1677
1682
|
return;
|
|
1678
|
-
// Skip on initial load of W8 case
|
|
1679
|
-
if (((_a = publisher.requiredTaxDocumentType) === null || _a === void 0 ? void 0 : _a.startsWith("W8")) &&
|
|
1680
|
-
!publisher.currentTaxDocument &&
|
|
1681
|
-
!participantType)
|
|
1682
|
-
return;
|
|
1683
1683
|
const fetchDocument = async () => {
|
|
1684
1684
|
try {
|
|
1685
1685
|
const result = await createTaxDocument({
|
|
1686
1686
|
vars: {
|
|
1687
|
+
provider: "COMPLY_EXCHANGE",
|
|
1687
1688
|
user: {
|
|
1688
1689
|
id: user.id,
|
|
1689
1690
|
accountId: user.accountId,
|
|
@@ -1702,33 +1703,36 @@ function useDocusignForm(props) {
|
|
|
1702
1703
|
};
|
|
1703
1704
|
fetchDocument();
|
|
1704
1705
|
}, [user, publisher, participantType]);
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
try {
|
|
1708
|
-
setLoading(true);
|
|
1709
|
-
await refetch();
|
|
1710
|
-
// Skip banking info form if it already is saved
|
|
1711
|
-
// or if brandedSignup is false
|
|
1712
|
-
setStep(context.overrideNextStep ||
|
|
1713
|
-
!!(publisher === null || publisher === void 0 ? void 0 : publisher.withdrawalSettings) ||
|
|
1714
|
-
!(publisher === null || publisher === void 0 ? void 0 : publisher.brandedSignup)
|
|
1715
|
-
? "/dashboard"
|
|
1716
|
-
: "/4");
|
|
1717
|
-
}
|
|
1718
|
-
catch (e) {
|
|
1719
|
-
setErrors({ general: true });
|
|
1720
|
-
}
|
|
1721
|
-
finally {
|
|
1722
|
-
setLoading(false);
|
|
1723
|
-
}
|
|
1724
|
-
};
|
|
1725
|
-
// Handled in view
|
|
1726
|
-
if (DOCUSIGN_ERROR_STATES.includes(docusignStatus))
|
|
1706
|
+
const completeDocument = async () => {
|
|
1707
|
+
if (!user)
|
|
1727
1708
|
return;
|
|
1728
|
-
|
|
1729
|
-
|
|
1709
|
+
try {
|
|
1710
|
+
setLoading(true);
|
|
1711
|
+
const result = await completeTaxDocument({
|
|
1712
|
+
vars: {
|
|
1713
|
+
id: user.id,
|
|
1714
|
+
accountId: user.accountId,
|
|
1715
|
+
},
|
|
1716
|
+
});
|
|
1717
|
+
console.log({ result });
|
|
1718
|
+
if (!result || result.message)
|
|
1719
|
+
throw new Error();
|
|
1720
|
+
// @ts-expect-error: no data type for result
|
|
1721
|
+
if (!result.completeImpactPublisherTaxDocument.success)
|
|
1722
|
+
throw new Error();
|
|
1723
|
+
setStep(context.overrideNextStep ||
|
|
1724
|
+
!!(publisher === null || publisher === void 0 ? void 0 : publisher.withdrawalSettings) ||
|
|
1725
|
+
!(publisher === null || publisher === void 0 ? void 0 : publisher.brandedSignup)
|
|
1726
|
+
? "/dashboard"
|
|
1727
|
+
: "/4");
|
|
1728
|
+
}
|
|
1729
|
+
catch (e) {
|
|
1730
|
+
setErrors({ general: true });
|
|
1731
|
+
}
|
|
1732
|
+
finally {
|
|
1733
|
+
setLoading(false);
|
|
1730
1734
|
}
|
|
1731
|
-
}
|
|
1735
|
+
};
|
|
1732
1736
|
const allLoading = userLoading || documentLoading || loading;
|
|
1733
1737
|
return {
|
|
1734
1738
|
states: {
|
|
@@ -1736,7 +1740,7 @@ function useDocusignForm(props) {
|
|
|
1736
1740
|
hideSteps: context.hideSteps,
|
|
1737
1741
|
disabled: allLoading,
|
|
1738
1742
|
participantTypeDisabled: allLoading || !!existingDocumentType,
|
|
1739
|
-
loading: userLoading || loading,
|
|
1743
|
+
loading: userLoading || loading || completeDocumentLoading,
|
|
1740
1744
|
urlLoading: documentLoading,
|
|
1741
1745
|
loadingError: !!(documentErrors === null || documentErrors === void 0 ? void 0 : documentErrors.message),
|
|
1742
1746
|
formState: {
|
|
@@ -1750,10 +1754,11 @@ function useDocusignForm(props) {
|
|
|
1750
1754
|
},
|
|
1751
1755
|
data: {
|
|
1752
1756
|
taxForm: actualDocumentType,
|
|
1753
|
-
documentUrl: (
|
|
1757
|
+
documentUrl: (_c = document === null || document === void 0 ? void 0 : document.createImpactPublisherTaxDocument) === null || _c === void 0 ? void 0 : _c.documentUrl,
|
|
1754
1758
|
},
|
|
1755
1759
|
callbacks: {
|
|
1756
1760
|
setDocusignStatus,
|
|
1761
|
+
completeDocument,
|
|
1757
1762
|
setParticipantType,
|
|
1758
1763
|
},
|
|
1759
1764
|
text: props.getTextProps(),
|
|
@@ -1771,7 +1776,8 @@ function getDocumentType(p) {
|
|
|
1771
1776
|
const style$1 = {
|
|
1772
1777
|
DocusignStatusContainer: {
|
|
1773
1778
|
width: "100%",
|
|
1774
|
-
|
|
1779
|
+
minHeight: "600px",
|
|
1780
|
+
height: "900px",
|
|
1775
1781
|
display: "flex",
|
|
1776
1782
|
flexDirection: "column",
|
|
1777
1783
|
alignItems: "center",
|
|
@@ -1825,21 +1831,26 @@ const DocusignLoadingView = () => {
|
|
|
1825
1831
|
h("div", { class: classes.DocusignStatusContainer },
|
|
1826
1832
|
h("sl-spinner", { style: { fontSize: "50px", margin: "40px" } }))));
|
|
1827
1833
|
};
|
|
1828
|
-
const DocusignIframe = ({ states, callbacks, text, }) => {
|
|
1834
|
+
const DocusignIframe = ({ states, data, callbacks, text, }) => {
|
|
1829
1835
|
if (states.urlLoading)
|
|
1830
1836
|
return h(DocusignLoadingView, null);
|
|
1837
|
+
// TODO: Confirm impact domain before launch
|
|
1838
|
+
const allowedDomains = [
|
|
1839
|
+
"referralsaasquatch.com",
|
|
1840
|
+
"impacttech.complysandbox.com",
|
|
1841
|
+
];
|
|
1831
1842
|
const callback = useCallback((e) => {
|
|
1832
|
-
var _a;
|
|
1833
|
-
if (!
|
|
1843
|
+
const allowed = allowedDomains.some((d) => { var _a; return (_a = e.origin) === null || _a === void 0 ? void 0 : _a.includes(d); });
|
|
1844
|
+
if (!allowed)
|
|
1834
1845
|
return;
|
|
1835
|
-
if (
|
|
1836
|
-
|
|
1837
|
-
|
|
1846
|
+
if (e.data === "Complyexchange Thank you page Exit") {
|
|
1847
|
+
callbacks.completeDocument();
|
|
1848
|
+
}
|
|
1838
1849
|
}, []);
|
|
1839
1850
|
useEffect(() => {
|
|
1840
|
-
window.addEventListener("message", callback);
|
|
1851
|
+
window.addEventListener("message", callback, false);
|
|
1841
1852
|
return () => {
|
|
1842
|
-
window.removeEventListener("message", callback);
|
|
1853
|
+
window.removeEventListener("message", callback, false);
|
|
1843
1854
|
};
|
|
1844
1855
|
}, []);
|
|
1845
1856
|
if (DOCUSIGN_ERROR_STATES.includes(states.status)) {
|
|
@@ -1847,8 +1858,9 @@ const DocusignIframe = ({ states, callbacks, text, }) => {
|
|
|
1847
1858
|
}
|
|
1848
1859
|
if (DOCUSIGN_EXPIRED_STATES.includes(states.status))
|
|
1849
1860
|
return h(DocusignExpiredView, { text: text });
|
|
1850
|
-
return (h("iframe", { frameBorder: "0", src:
|
|
1861
|
+
return (h("iframe", { frameBorder: "0", src: data.documentUrl, width: "100%", height: "1000px" }));
|
|
1851
1862
|
};
|
|
1863
|
+
// NWH4QF
|
|
1852
1864
|
|
|
1853
1865
|
const style$2 = {
|
|
1854
1866
|
FormWrapper: {
|
|
@@ -1988,7 +2000,7 @@ const vanillaStyle$1 = `
|
|
|
1988
2000
|
|
|
1989
2001
|
`;
|
|
1990
2002
|
const DocusignFormView = (props) => {
|
|
1991
|
-
var _a
|
|
2003
|
+
var _a;
|
|
1992
2004
|
const { states, states: { formState, documentTypeString }, callbacks, text, slots, } = props;
|
|
1993
2005
|
const { classes } = sheet$2;
|
|
1994
2006
|
return (h("div", { class: classes.Container },
|
|
@@ -2014,23 +2026,7 @@ const DocusignFormView = (props) => {
|
|
|
2014
2026
|
h("strong", null, text.error.generalTitle),
|
|
2015
2027
|
h("br", null),
|
|
2016
2028
|
text.error.generalDescription)),
|
|
2017
|
-
|
|
2018
|
-
h("p", { class: classes.BoldText }, text.participantType),
|
|
2019
|
-
states.loading ? (h("sl-spinner", { style: { fontSize: "50px", margin: "40px" } })) : (h("div", { style: { display: "flex", flexDirection: "column" } },
|
|
2020
|
-
h("sl-radio", { exportparts: "base: radio-base", value: "individualParticipant", name: "/participantType", checked: formState.participantType === "individualParticipant", disabled: states.disabled || states.participantTypeDisabled, onClick: () => {
|
|
2021
|
-
if (states.disabled || states.participantTypeDisabled)
|
|
2022
|
-
return;
|
|
2023
|
-
callbacks.setParticipantType("individualParticipant");
|
|
2024
|
-
} },
|
|
2025
|
-
h("span", { class: classes.RadioText }, text.individualParticipant)),
|
|
2026
|
-
h("sl-radio", { exportparts: "base: radio-base", value: "businessEntity", name: "/participantType", checked: formState.participantType === "businessEntity", disabled: states.disabled || states.participantTypeDisabled, onClick: () => {
|
|
2027
|
-
if (states.disabled || states.participantTypeDisabled)
|
|
2028
|
-
return;
|
|
2029
|
-
callbacks.setParticipantType("businessEntity");
|
|
2030
|
-
} },
|
|
2031
|
-
h("span", { class: classes.RadioText }, text.businessEntity)))),
|
|
2032
|
-
((_b = formState.errors) === null || _b === void 0 ? void 0 : _b.participantType) && (h("p", { class: classes.ErrorText }, text.error.participantType)))),
|
|
2033
|
-
(states.documentType === "W9" || formState.participantType) && (h("div", null,
|
|
2029
|
+
h("div", null,
|
|
2034
2030
|
h("div", null,
|
|
2035
2031
|
h("h5", { class: classes.BoldText }, intl.formatMessage({ id: "tax-form-label", defaultMessage: text.taxFormLabel }, { documentType: documentTypeString })),
|
|
2036
2032
|
h("p", null, intl.formatMessage({
|
|
@@ -2045,7 +2041,7 @@ const DocusignFormView = (props) => {
|
|
|
2045
2041
|
h("sl-alert", { exportparts: "base: alert-base, icon:alert-icon", type: "primary", open: true, class: classes.InfoAlert },
|
|
2046
2042
|
h("sl-icon", { class: classes.InfoIcon, slot: "icon", name: "info-circle" }),
|
|
2047
2043
|
text.docusignSessionWarning),
|
|
2048
|
-
slots.docusignIframeSlot))))
|
|
2044
|
+
slots.docusignIframeSlot))));
|
|
2049
2045
|
};
|
|
2050
2046
|
|
|
2051
2047
|
const DocusignForm = class {
|
|
@@ -2168,12 +2164,13 @@ const DocusignForm = class {
|
|
|
2168
2164
|
const _isDemo = isDemo();
|
|
2169
2165
|
const props = _isDemo ? useDocusignFormDemo(this) : useDocusignForm(this);
|
|
2170
2166
|
const docusignIframeSlot = (h(DocusignIframe, { states: {
|
|
2171
|
-
url: props.data.documentUrl,
|
|
2172
2167
|
status: props.states.docusignStatus,
|
|
2173
2168
|
loading: props.states.loading,
|
|
2174
2169
|
urlLoading: props.states.urlLoading,
|
|
2170
|
+
}, data: {
|
|
2171
|
+
documentUrl: props.data.documentUrl,
|
|
2175
2172
|
}, callbacks: {
|
|
2176
|
-
|
|
2173
|
+
completeDocument: props.callbacks.completeDocument,
|
|
2177
2174
|
}, text: props.text }));
|
|
2178
2175
|
return (h(Host, null, h(DocusignFormView, { callbacks: props.callbacks, states: props.states, text: props.text, slots: {
|
|
2179
2176
|
docusignIframeSlot: _isDemo
|
|
@@ -2521,7 +2518,7 @@ function useIndirectTaxForm(props) {
|
|
|
2521
2518
|
setFormState((p) => ({ ...p, [field]: value }));
|
|
2522
2519
|
};
|
|
2523
2520
|
const onSubmit = async (event) => {
|
|
2524
|
-
var _a, _b, _c, _d, _e
|
|
2521
|
+
var _a, _b, _c, _d, _e;
|
|
2525
2522
|
if (!option) {
|
|
2526
2523
|
setErrors({ taxDetails: true });
|
|
2527
2524
|
return;
|
|
@@ -2582,7 +2579,7 @@ function useIndirectTaxForm(props) {
|
|
|
2582
2579
|
await refetch();
|
|
2583
2580
|
const resultPublisher = (_e = (_d = (_c = result
|
|
2584
2581
|
.createImpactConnection) === null || _c === void 0 ? void 0 : _c.user) === null || _d === void 0 ? void 0 : _d.impactConnection) === null || _e === void 0 ? void 0 : _e.publisher;
|
|
2585
|
-
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType
|
|
2582
|
+
const hasValidCurrentDocument = validTaxDocument(resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) && (resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.currentTaxDocument);
|
|
2586
2583
|
if ((resultPublisher === null || resultPublisher === void 0 ? void 0 : resultPublisher.requiredTaxDocumentType) &&
|
|
2587
2584
|
!hasValidCurrentDocument) {
|
|
2588
2585
|
// Go to docusign form
|
|
@@ -3722,8 +3719,7 @@ function getCurrentStep(user) {
|
|
|
3722
3719
|
}
|
|
3723
3720
|
const { requiredTaxDocumentType, currentTaxDocument, withdrawalSettings, brandedSignup, } = user.impactConnection.publisher;
|
|
3724
3721
|
// If they do have a required document, look at current document
|
|
3725
|
-
if (requiredTaxDocumentType &&
|
|
3726
|
-
!validTaxDocument(requiredTaxDocumentType, currentTaxDocument === null || currentTaxDocument === void 0 ? void 0 : currentTaxDocument.type))
|
|
3722
|
+
if (requiredTaxDocumentType && !currentTaxDocument)
|
|
3727
3723
|
return "/3";
|
|
3728
3724
|
if (!withdrawalSettings && brandedSignup)
|
|
3729
3725
|
return "/4";
|
|
@@ -5170,7 +5166,7 @@ function getIndirectTaxType(taxInformation) {
|
|
|
5170
5166
|
return "Indirect Tax";
|
|
5171
5167
|
}
|
|
5172
5168
|
const useTaxAndCashDashboard = (props) => {
|
|
5173
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l
|
|
5169
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
5174
5170
|
const setStep = wn(TAX_CONTEXT_NAMESPACE);
|
|
5175
5171
|
const setContext = wn(TAX_FORM_CONTEXT_NAMESPACE);
|
|
5176
5172
|
const [showDialog, setShowDialog] = useState(false);
|
|
@@ -5181,8 +5177,8 @@ const useTaxAndCashDashboard = (props) => {
|
|
|
5181
5177
|
}, []);
|
|
5182
5178
|
const { data, loading, errors: userError, } = Mn(USER_QUERY_NAMESPACE);
|
|
5183
5179
|
const publisher = (_b = (_a = data === null || data === void 0 ? void 0 : data.user) === null || _a === void 0 ? void 0 : _a.impactConnection) === null || _b === void 0 ? void 0 : _b.publisher;
|
|
5184
|
-
const documentType =
|
|
5185
|
-
const submissionDate = (
|
|
5180
|
+
const documentType = publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType;
|
|
5181
|
+
const submissionDate = (_c = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _c === void 0 ? void 0 : _c.dateCreated;
|
|
5186
5182
|
const dateSubmitted = submissionDate
|
|
5187
5183
|
? luxon.DateTime.fromMillis(submissionDate).toFormat("LLL dd, yyyy")
|
|
5188
5184
|
: undefined;
|
|
@@ -5203,23 +5199,23 @@ const useTaxAndCashDashboard = (props) => {
|
|
|
5203
5199
|
});
|
|
5204
5200
|
setStep("/3");
|
|
5205
5201
|
};
|
|
5206
|
-
const provinceName = (
|
|
5202
|
+
const provinceName = (_d = INDIRECT_TAX_PROVINCES.find((p) => { var _a; return p.regionCode === ((_a = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _a === void 0 ? void 0 : _a.indirectTaxRegion); })) === null || _d === void 0 ? void 0 : _d.displayName;
|
|
5207
5203
|
return {
|
|
5208
5204
|
states: {
|
|
5209
5205
|
dateSubmitted,
|
|
5210
5206
|
documentType,
|
|
5211
5207
|
canEditPayoutInfo: publisher === null || publisher === void 0 ? void 0 : publisher.brandedSignup,
|
|
5212
5208
|
documentTypeString: taxTypeToName(documentType),
|
|
5213
|
-
status: (
|
|
5214
|
-
subRegion: getSubRegionName((
|
|
5215
|
-
subRegionTaxNumber: (
|
|
5216
|
-
qstNumber: (
|
|
5209
|
+
status: (_e = publisher === null || publisher === void 0 ? void 0 : publisher.currentTaxDocument) === null || _e === void 0 ? void 0 : _e.status,
|
|
5210
|
+
subRegion: getSubRegionName((_f = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _f === void 0 ? void 0 : _f.indirectTaxRegion),
|
|
5211
|
+
subRegionTaxNumber: (_g = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _g === void 0 ? void 0 : _g.withholdingTaxId,
|
|
5212
|
+
qstNumber: (_h = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _h === void 0 ? void 0 : _h.additionalTaxId,
|
|
5217
5213
|
indirectTaxType: getIndirectTaxType(publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation),
|
|
5218
|
-
indirectTaxNumber: (
|
|
5214
|
+
indirectTaxNumber: (_j = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _j === void 0 ? void 0 : _j.indirectTaxId,
|
|
5219
5215
|
isBusinessEntity: (publisher === null || publisher === void 0 ? void 0 : publisher.requiredTaxDocumentType) === "W8BENE",
|
|
5220
5216
|
province: provinceName,
|
|
5221
|
-
country: getCountryName((
|
|
5222
|
-
notRegistered: !((
|
|
5217
|
+
country: getCountryName((_k = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _k === void 0 ? void 0 : _k.indirectTaxCountryCode, locale),
|
|
5218
|
+
notRegistered: !((_l = publisher === null || publisher === void 0 ? void 0 : publisher.taxInformation) === null || _l === void 0 ? void 0 : _l.indirectTaxId),
|
|
5223
5219
|
noFormNeeded: !documentType,
|
|
5224
5220
|
disabled: loading,
|
|
5225
5221
|
loading,
|
|
@@ -6596,27 +6592,6 @@ const style$6 = {
|
|
|
6596
6592
|
color: "var(--sl-color-neutral-500)",
|
|
6597
6593
|
fontSize: "var(--sl-font-size-medium)",
|
|
6598
6594
|
},
|
|
6599
|
-
PhoneInputsSection: {
|
|
6600
|
-
display: "flex",
|
|
6601
|
-
alignItems: "flex-start",
|
|
6602
|
-
flexDirection: "column",
|
|
6603
|
-
gap: "4px",
|
|
6604
|
-
"& p": {
|
|
6605
|
-
fontSize: "var(--sl-font-size-small)",
|
|
6606
|
-
color: "var(--sl-input-label-color)",
|
|
6607
|
-
fontWeight: "var(--sl-font-weight-semibold)",
|
|
6608
|
-
},
|
|
6609
|
-
},
|
|
6610
|
-
PhoneInputsContainer: {
|
|
6611
|
-
display: "flex",
|
|
6612
|
-
alignItems: "flex-start",
|
|
6613
|
-
gap: "4px",
|
|
6614
|
-
width: "100%",
|
|
6615
|
-
"& #phoneNumber": {
|
|
6616
|
-
width: "100%",
|
|
6617
|
-
minWidth: "0px",
|
|
6618
|
-
},
|
|
6619
|
-
},
|
|
6620
6595
|
};
|
|
6621
6596
|
const sheet$5 = createStyleSheet(style$6);
|
|
6622
6597
|
const styleString$5 = sheet$5.toString();
|
|
@@ -6642,7 +6617,7 @@ const vanillaStyle$3 = `
|
|
|
6642
6617
|
}
|
|
6643
6618
|
|
|
6644
6619
|
sl-select#phoneNumberCountryCode::part(menu) {
|
|
6645
|
-
|
|
6620
|
+
width: 450px;
|
|
6646
6621
|
}
|
|
6647
6622
|
`;
|
|
6648
6623
|
const UserInfoFormView = (props) => {
|
|
@@ -6725,39 +6700,37 @@ const UserInfoFormView = (props) => {
|
|
|
6725
6700
|
} }), (_e = data === null || data === void 0 ? void 0 : data.countries) === null || _e === void 0 ? void 0 :
|
|
6726
6701
|
_e.map((c) => (h("sl-menu-item", { value: c.countryCode }, c.displayName))), (_f = data === null || data === void 0 ? void 0 : data.allCountries) === null || _f === void 0 ? void 0 :
|
|
6727
6702
|
_f.map((c) => (h("sl-menu-item", { value: c.countryCode, style: { display: "none" } }, c.displayName)))),
|
|
6728
|
-
h("div", {
|
|
6729
|
-
h("
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
}
|
|
6760
|
-
: {}), { required: true })))),
|
|
6703
|
+
h("div", { style: { display: "flex", gap: "4px" } },
|
|
6704
|
+
h("sl-select", Object.assign({ id: "phoneNumberCountryCode", exportparts: "label: input-label, base: input-base", name: "/phoneNumberCountryCode", label: text.phoneNumber, style: { minWidth: "140px" }, value: formState.phoneNumberCountryCode, disabled: states.disabled || states.isPartner, ref: (el) => (refs.phoneCountryRef.current = el) }, (((_g = formState.errors) === null || _g === void 0 ? void 0 : _g.phoneNumberCountryCode) ? {
|
|
6705
|
+
class: classes.ErrorInput,
|
|
6706
|
+
}
|
|
6707
|
+
: {}), { required: true, "onSl-select": (e) => callbacks.onFormChange("phoneCountry", e) }),
|
|
6708
|
+
h("sl-input", { class: classes.SearchInput, placeholder: text.searchForCountryText, onKeyDown: (e) => {
|
|
6709
|
+
// Stop shoelace intercepting key presses
|
|
6710
|
+
e.stopPropagation();
|
|
6711
|
+
}, "onSl-input": (e) => {
|
|
6712
|
+
callbacks.setPhoneCountrySearch(e.target.value);
|
|
6713
|
+
} }), (_h = data === null || data === void 0 ? void 0 : data.phoneCountries) === null || _h === void 0 ? void 0 :
|
|
6714
|
+
_h.map((c) => {
|
|
6715
|
+
var _a, _b;
|
|
6716
|
+
return (h("sl-menu-item", { style: { width: "500px" }, value: c.countryCode },
|
|
6717
|
+
h("div", { slot: "prefix", style: { marginRight: "8px" } }, `${(_a = PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
|
|
6718
|
+
_b.dial_code));
|
|
6719
|
+
}), (_j = data === null || data === void 0 ? void 0 : data.allCountries) === null || _j === void 0 ? void 0 :
|
|
6720
|
+
_j.map((c) => {
|
|
6721
|
+
var _a, _b;
|
|
6722
|
+
return (h("sl-menu-item", { value: c.countryCode, style: { display: "none" } },
|
|
6723
|
+
h("div", { slot: "prefix", style: { marginRight: "8px" } }, `${(_a = PHONE_EXTENSIONS[c.countryCode]) === null || _a === void 0 ? void 0 : _a.name} `), (_b = PHONE_EXTENSIONS[c.countryCode]) === null || _b === void 0 ? void 0 :
|
|
6724
|
+
_b.dial_code));
|
|
6725
|
+
})),
|
|
6726
|
+
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: " ", id: "phoneNumber", name: "/phoneNumber", value: formState.phoneNumber, style: { marginTop: "2px", width: "362px" }, validationError: ({ value }) =>
|
|
6727
|
+
// Naive phone number validation
|
|
6728
|
+
validateBillingField(/[a-zA-Z]+/, value) &&
|
|
6729
|
+
formatErrorMessage(text.phoneNumber, text.error.fieldInvalidError), disabled: states.disabled || states.isPartner }, (((_k = formState.errors) === null || _k === void 0 ? void 0 : _k.phoneNumber) ? {
|
|
6730
|
+
class: classes.ErrorInput,
|
|
6731
|
+
helpText: formatErrorMessage(text.phoneNumber, formState.errors.phoneNumber),
|
|
6732
|
+
}
|
|
6733
|
+
: {}), { required: true }))),
|
|
6761
6734
|
h("sl-input", Object.assign({ exportparts: "label: input-label, base: input-base", label: text.address, id: "address", name: "/address", value: formState.address, validationError: ({ value }) =>
|
|
6762
6735
|
// Checks for non-ASCII characters
|
|
6763
6736
|
!validateBillingField(/^[\x20-\xFF]+$/, value) &&
|