@justifi/webcomponents 4.19.3-rc → 4.19.3-rc-2

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 (164) hide show
  1. package/dist/cjs/{Analytics-57e3b5a8.js → Analytics-adc90fc6.js} +1 -1
  2. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +2 -2
  3. package/dist/cjs/justifi-business-details.cjs.entry.js +2 -2
  4. package/dist/cjs/justifi-business-form.cjs.entry.js +2 -2
  5. package/dist/cjs/justifi-card-form.cjs.entry.js +2 -2
  6. package/dist/cjs/justifi-checkout-core.cjs.entry.js +2 -1
  7. package/dist/cjs/justifi-checkout.cjs.entry.js +2 -2
  8. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +2 -2
  9. package/dist/cjs/justifi-new-payment-method_4.cjs.entry.js +4 -1
  10. package/dist/cjs/justifi-payment-details.cjs.entry.js +2 -2
  11. package/dist/cjs/justifi-payment-form.cjs.entry.js +2 -2
  12. package/dist/cjs/justifi-payment-method-form.cjs.entry.js +1 -1
  13. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +2 -2
  14. package/dist/cjs/justifi-payments-list.cjs.entry.js +2 -2
  15. package/dist/cjs/justifi-payout-details.cjs.entry.js +2 -2
  16. package/dist/cjs/justifi-payouts-list.cjs.entry.js +2 -2
  17. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +2 -2
  18. package/dist/cjs/{package-97b9c902.js → package-22d30c5d.js} +1 -1
  19. package/dist/collection/components/checkout/checkout-core.js +2 -1
  20. package/dist/collection/components/checkout/new-payment-method.js +4 -1
  21. package/dist/docs.json +1 -1
  22. package/dist/esm/{Analytics-7cb9826b.js → Analytics-a8eb7344.js} +1 -1
  23. package/dist/esm/justifi-bank-account-form.entry.js +2 -2
  24. package/dist/esm/justifi-business-details.entry.js +2 -2
  25. package/dist/esm/justifi-business-form.entry.js +2 -2
  26. package/dist/esm/justifi-card-form.entry.js +2 -2
  27. package/dist/esm/justifi-checkout-core.entry.js +2 -1
  28. package/dist/esm/justifi-checkout.entry.js +2 -2
  29. package/dist/esm/justifi-gross-payment-chart.entry.js +2 -2
  30. package/dist/esm/justifi-new-payment-method_4.entry.js +4 -1
  31. package/dist/esm/justifi-payment-details.entry.js +2 -2
  32. package/dist/esm/justifi-payment-form.entry.js +2 -2
  33. package/dist/esm/justifi-payment-method-form.entry.js +1 -1
  34. package/dist/esm/justifi-payment-provisioning.entry.js +2 -2
  35. package/dist/esm/justifi-payments-list.entry.js +2 -2
  36. package/dist/esm/justifi-payout-details.entry.js +2 -2
  37. package/dist/esm/justifi-payouts-list.entry.js +2 -2
  38. package/dist/esm/justifi-season-interruption-insurance.entry.js +2 -2
  39. package/dist/esm/{package-93884871.js → package-ccb774a9.js} +1 -1
  40. package/dist/module/checkout-core.js +2 -1
  41. package/dist/module/new-payment-method.js +4 -1
  42. package/dist/module/package.js +1 -1
  43. package/dist/types/components/checkout/new-payment-method.d.ts +1 -0
  44. package/dist/webcomponents/index.esm.js +1 -0
  45. package/dist/webcomponents/p-01a404ca.entry.js +44 -0
  46. package/dist/webcomponents/p-03d35880.entry.js +130 -0
  47. package/dist/webcomponents/p-06ff0429.entry.js +65 -0
  48. package/dist/webcomponents/p-08b0fb31.js +41 -1
  49. package/dist/webcomponents/p-0e1bc91e.js +28 -1
  50. package/dist/webcomponents/p-10875f3d.entry.js +97 -0
  51. package/dist/webcomponents/p-14c91ffd.js +20 -1
  52. package/dist/webcomponents/p-157acba8.entry.js +98 -0
  53. package/dist/webcomponents/p-15eafa87.js +77 -0
  54. package/dist/webcomponents/p-18fa0479.entry.js +131 -0
  55. package/dist/webcomponents/p-1a5120f4.entry.js +145 -0
  56. package/dist/webcomponents/p-1ad5995e.js +3599 -1
  57. package/dist/webcomponents/p-1ff8810b.js +29 -1
  58. package/dist/webcomponents/p-2338affa.js +213 -1
  59. package/dist/webcomponents/p-24dc023a.entry.js +791 -0
  60. package/dist/webcomponents/p-25d8cd65.entry.js +102 -0
  61. package/dist/webcomponents/p-27d87fe2.entry.js +133 -0
  62. package/dist/webcomponents/p-29c0b182.js +114 -1
  63. package/dist/webcomponents/p-2b6c9c4f.js +7 -1
  64. package/dist/webcomponents/p-2e8f4937.js +79 -0
  65. package/dist/webcomponents/p-2eab3c90.js +3052 -1
  66. package/dist/webcomponents/p-3395e896.entry.js +74 -0
  67. package/dist/webcomponents/p-3fd13ca3.js +52 -1
  68. package/dist/webcomponents/p-47d79529.js +18 -1
  69. package/dist/webcomponents/p-525db3e8.js +22 -1
  70. package/dist/webcomponents/p-53ecc8b9.entry.js +261 -0
  71. package/dist/webcomponents/p-5482d030.entry.js +21 -0
  72. package/dist/webcomponents/p-56f6ce4c.js +10 -1
  73. package/dist/webcomponents/p-576826b1.entry.js +43 -0
  74. package/dist/webcomponents/p-5968ff8a.js +178 -1
  75. package/dist/webcomponents/p-5f835b89.entry.js +606 -0
  76. package/dist/webcomponents/p-6078a370.js +244 -1
  77. package/dist/webcomponents/p-6124b1b3.entry.js +80 -0
  78. package/dist/webcomponents/p-70a2aa74.entry.js +76 -0
  79. package/dist/webcomponents/p-7582b554.entry.js +18 -0
  80. package/dist/webcomponents/p-75fd6367.entry.js +149 -0
  81. package/dist/webcomponents/p-79646550.entry.js +61 -0
  82. package/dist/webcomponents/p-7d85af5c.js +16 -1
  83. package/dist/webcomponents/p-800d31fe.entry.js +162 -0
  84. package/dist/webcomponents/p-8115b2f4.js +28 -1
  85. package/dist/webcomponents/p-83125497.js +4027 -1
  86. package/dist/webcomponents/p-85fc69e5.js +90 -1
  87. package/dist/webcomponents/p-89887332.js +301 -1
  88. package/dist/webcomponents/p-8df7bde8.js +27 -1
  89. package/dist/webcomponents/p-8eb774df.entry.js +54 -0
  90. package/dist/webcomponents/p-9c9c7dac.js +24 -1
  91. package/dist/webcomponents/p-9e17630d.entry.js +1684 -0
  92. package/dist/webcomponents/p-9f94bbb6.entry.js +118 -0
  93. package/dist/webcomponents/p-a4e8573e.entry.js +94 -0
  94. package/dist/webcomponents/p-a5a225d9.entry.js +125 -0
  95. package/dist/webcomponents/p-a5fb51dc.entry.js +131 -0
  96. package/dist/webcomponents/p-ab4816e1.entry.js +117 -0
  97. package/dist/webcomponents/p-ac086069.entry.js +58 -0
  98. package/dist/webcomponents/p-af244664.js +126 -1
  99. package/dist/webcomponents/p-b4b8b531.js +44 -1
  100. package/dist/webcomponents/p-b82c146f.entry.js +111 -0
  101. package/dist/webcomponents/p-ba4bae6f.js +12 -1
  102. package/dist/webcomponents/p-ba5fae28.js +90 -1
  103. package/dist/webcomponents/p-bd66f9d2.entry.js +101 -0
  104. package/dist/webcomponents/p-cc39384f.entry.js +99 -0
  105. package/dist/webcomponents/p-d17aee2b.entry.js +26 -0
  106. package/dist/webcomponents/p-d89bad72.js +39 -1
  107. package/dist/webcomponents/p-dad3e069.entry.js +298 -0
  108. package/dist/webcomponents/p-dce846bf.js +27 -1
  109. package/dist/webcomponents/p-df21aaad.js +120 -1
  110. package/dist/webcomponents/p-e1255160.js +3 -1
  111. package/dist/webcomponents/p-e1e7525b.entry.js +73 -0
  112. package/dist/webcomponents/p-e333620e.js +34 -1
  113. package/dist/webcomponents/p-e356f280.entry.js +29 -0
  114. package/dist/webcomponents/p-e3fab0e2.js +43 -1
  115. package/dist/webcomponents/p-e9a5cb95.entry.js +94 -0
  116. package/dist/webcomponents/p-ec854a3e.entry.js +11053 -0
  117. package/dist/webcomponents/p-edc37d1f.entry.js +75 -0
  118. package/dist/webcomponents/p-f02b75dc.entry.js +96 -0
  119. package/dist/webcomponents/p-fad19d75.js +1638 -2
  120. package/dist/webcomponents/webcomponents.css +362 -4
  121. package/dist/webcomponents/webcomponents.esm.js +20 -1
  122. package/package.json +1 -1
  123. package/dist/webcomponents/p-03419b17.js +0 -1
  124. package/dist/webcomponents/p-07109641.entry.js +0 -1
  125. package/dist/webcomponents/p-0bbe1f1c.entry.js +0 -1
  126. package/dist/webcomponents/p-0cd89142.entry.js +0 -1
  127. package/dist/webcomponents/p-0f7b9555.entry.js +0 -1
  128. package/dist/webcomponents/p-16887e04.entry.js +0 -1
  129. package/dist/webcomponents/p-17baca7d.entry.js +0 -1
  130. package/dist/webcomponents/p-17e4246f.entry.js +0 -1
  131. package/dist/webcomponents/p-1a43e355.entry.js +0 -19
  132. package/dist/webcomponents/p-1f761d16.entry.js +0 -1
  133. package/dist/webcomponents/p-276cc368.entry.js +0 -1
  134. package/dist/webcomponents/p-30a493cd.entry.js +0 -1
  135. package/dist/webcomponents/p-32211b2f.entry.js +0 -1
  136. package/dist/webcomponents/p-3352353a.entry.js +0 -1
  137. package/dist/webcomponents/p-462dc522.entry.js +0 -1
  138. package/dist/webcomponents/p-487b72a8.entry.js +0 -1
  139. package/dist/webcomponents/p-4a485cce.js +0 -1
  140. package/dist/webcomponents/p-4abc17f0.entry.js +0 -1
  141. package/dist/webcomponents/p-4c849993.entry.js +0 -1
  142. package/dist/webcomponents/p-52021fa1.entry.js +0 -1
  143. package/dist/webcomponents/p-53e64f15.entry.js +0 -1
  144. package/dist/webcomponents/p-62b32c4c.entry.js +0 -1
  145. package/dist/webcomponents/p-83876625.entry.js +0 -1
  146. package/dist/webcomponents/p-8e541a32.entry.js +0 -1
  147. package/dist/webcomponents/p-97272668.entry.js +0 -1
  148. package/dist/webcomponents/p-b1257354.entry.js +0 -1
  149. package/dist/webcomponents/p-b29f5084.entry.js +0 -1
  150. package/dist/webcomponents/p-babd56c3.entry.js +0 -1
  151. package/dist/webcomponents/p-bbed6107.entry.js +0 -1
  152. package/dist/webcomponents/p-be39c802.entry.js +0 -1
  153. package/dist/webcomponents/p-c607f049.entry.js +0 -1
  154. package/dist/webcomponents/p-c9f8f7ec.entry.js +0 -1
  155. package/dist/webcomponents/p-cd37a87e.entry.js +0 -1
  156. package/dist/webcomponents/p-cff82e78.entry.js +0 -1
  157. package/dist/webcomponents/p-d8355f91.entry.js +0 -1
  158. package/dist/webcomponents/p-e2c88817.entry.js +0 -1
  159. package/dist/webcomponents/p-e31f0f3e.entry.js +0 -1
  160. package/dist/webcomponents/p-f0866375.entry.js +0 -1
  161. package/dist/webcomponents/p-f117d1d1.entry.js +0 -1
  162. package/dist/webcomponents/p-f883bf32.entry.js +0 -1
  163. package/dist/webcomponents/p-fb58feb5.entry.js +0 -1
  164. package/dist/webcomponents/p-fe33151d.entry.js +0 -1
@@ -1 +1,90 @@
1
- import{c as e,a as t}from"./p-2eab3c90.js";import{l,a,c as s,s as d,p as n,i as r,b as i,e as o,d as c,f as m,g as p}from"./p-89887332.js";const u=r=>{const i=e({line1:l.required("Enter street address"),line2:a.nullable(),city:s.required("Enter city"),state:d.required("Select state"),postal_code:n.required("Enter postal code"),country:t().required("Select country")}),o=e({line1:l.nullable(),line2:a.nullable(),city:s.nullable(),state:d.nullable(),postal_code:n.nullable(),country:t().required("Select country")});return r?o:i},b=(l,a)=>{const s=e({name:r.required(`Enter ${l} name`),title:i.required(`Enter ${l} title`),email:o.required(`Enter ${l} email`),phone:c.required("Enter phone number"),dob_full:m(l).required("Enter date of birth"),ssn_last4:t().nullable(),identification_number:p,address:u(a)}),d=e({name:r.required(`Enter ${l} name`),title:i.nullable(),email:o.nullable(),phone:c.nullable(),dob_full:m(l).nullable(),ssn_last4:t().nullable(),identification_number:p.nullable(),address:u(a)});return a?d:s},E=(e,t)=>{var l;return f(e),_(e.legal_address),y(e.representative),(null===(l=t.owners)||void 0===l?void 0:l.length)&&delete e.owners,e},f=e=>(delete e.id,delete e.documents,delete e.bank_accounts,delete e.product_categories,delete e.created_at,delete e.updated_at,delete e.associated_accounts,delete e.terms_conditions_accepted,e),_=e=>(delete e.id,delete e.created_at,delete e.updated_at,e),y=e=>(delete e.id,delete e.documents,delete e.created_at,delete e.updated_at,delete e.address.id,delete e.address.created_at,delete e.address.updated_at,delete e.business_id,delete e.dob_full,delete e.ssn_last4,e);export{u as a,f as b,y as c,_ as d,b as i,E as p}
1
+ import { c as create$3, a as create$6 } from './p-2eab3c90.js';
2
+ import { l as lineOneValidation, a as lineTwoValidation, c as cityValidation, s as stateValidation, p as postalValidation, i as identityNameValidation, b as identityTitleValidation, e as emailValidation, d as phoneValidation, f as dobValidation, g as ssnValidation } from './p-89887332.js';
3
+
4
+ const addressSchema = (allowOptionalFields) => {
5
+ const schema = create$3({
6
+ line1: lineOneValidation.required('Enter street address'),
7
+ line2: lineTwoValidation.nullable(),
8
+ city: cityValidation.required('Enter city'),
9
+ state: stateValidation.required('Select state'),
10
+ postal_code: postalValidation.required('Enter postal code'),
11
+ country: create$6().required('Select country')
12
+ });
13
+ const easySchema = create$3({
14
+ line1: lineOneValidation.nullable(),
15
+ line2: lineTwoValidation.nullable(),
16
+ city: cityValidation.nullable(),
17
+ state: stateValidation.nullable(),
18
+ postal_code: postalValidation.nullable(),
19
+ country: create$6().required('Select country')
20
+ });
21
+ return allowOptionalFields ? easySchema : schema;
22
+ };
23
+
24
+ const identitySchema = (role, allowOptionalFields) => {
25
+ const schema = create$3({
26
+ name: identityNameValidation.required(`Enter ${role} name`),
27
+ title: identityTitleValidation.required(`Enter ${role} title`),
28
+ email: emailValidation.required(`Enter ${role} email`),
29
+ phone: phoneValidation.required('Enter phone number'),
30
+ dob_full: dobValidation(role).required('Enter date of birth'),
31
+ ssn_last4: create$6().nullable(),
32
+ identification_number: ssnValidation,
33
+ address: addressSchema(allowOptionalFields),
34
+ });
35
+ const easySchema = create$3({
36
+ name: identityNameValidation.required(`Enter ${role} name`),
37
+ title: identityTitleValidation.nullable(),
38
+ email: emailValidation.nullable(),
39
+ phone: phoneValidation.nullable(),
40
+ dob_full: dobValidation(role).nullable(),
41
+ ssn_last4: create$6().nullable(),
42
+ identification_number: ssnValidation.nullable(),
43
+ address: addressSchema(allowOptionalFields),
44
+ });
45
+ return allowOptionalFields ? easySchema : schema;
46
+ };
47
+
48
+ // These props should not be sent to the server
49
+ // This function is for the larger business form.
50
+ const parseBusiness = (values, initialValues) => {
51
+ var _a;
52
+ parseCoreInfo(values);
53
+ parseAddressInfo(values.legal_address);
54
+ parseIdentityInfo(values.representative);
55
+ ((_a = initialValues.owners) === null || _a === void 0 ? void 0 : _a.length) && delete values.owners;
56
+ return values;
57
+ };
58
+ // These functions are for the stepped business form.
59
+ const parseCoreInfo = (values) => {
60
+ delete values.id;
61
+ delete values.documents;
62
+ delete values.bank_accounts;
63
+ delete values.product_categories;
64
+ delete values.created_at;
65
+ delete values.updated_at;
66
+ delete values.associated_accounts;
67
+ delete values.terms_conditions_accepted;
68
+ return values;
69
+ };
70
+ const parseAddressInfo = (values) => {
71
+ delete values.id;
72
+ delete values.created_at;
73
+ delete values.updated_at;
74
+ return values;
75
+ };
76
+ const parseIdentityInfo = (values) => {
77
+ delete values.id;
78
+ delete values.documents;
79
+ delete values.created_at;
80
+ delete values.updated_at;
81
+ delete values.address.id;
82
+ delete values.address.created_at;
83
+ delete values.address.updated_at;
84
+ delete values.business_id;
85
+ delete values.dob_full;
86
+ delete values.ssn_last4;
87
+ return values;
88
+ };
89
+
90
+ export { addressSchema as a, parseCoreInfo as b, parseIdentityInfo as c, parseAddressInfo as d, identitySchema as i, parseBusiness as p };
@@ -1 +1,301 @@
1
- import{a as e,b as s}from"./p-2eab3c90.js";import{S as t}from"./p-6078a370.js";import{b as a,a as r,r as n,s as i,c as l}from"./p-ba5fae28.js";const c=e=>""===e?null:e,o=/^(?!^\s+$)[a-zA-Z0-9\s,&.-]*$/,d=/^(?!^\s+$)[a-zA-Z\s]*$/,u=/^\d+$/,m=/^(?!^\s+$)[a-zA-Z0-9\s,&.-]*$/,h=/P\.?\s?O\.?\s?Box|Postal\sBox/i;var b,v;!function(e){e.voidedCheck="voided_check",e.balanceSheet="balance_sheet",e.bankStatement="bank_statement",e.governmentId="government_id",e.profitAndLossStatement="profit_and_loss_statement",e.taxReturn="tax_return",e.other="other"}(b||(b={})),function(e){e.pending="pending",e.uploaded="uploaded",e.canceled="canceled",e.needed="needed"}(v||(v={}));class E{constructor(){this.voided_check=[],this.balance_sheet=[],this.bank_statement=[],this.government_id=[],this.profit_and_loss_statement=[],this.tax_return=[],this.other=[]}}class p{constructor(e,s){this.file=e.file,this.fileString=this.getFileString(),this.document_type=e.document_type,this.presigned_url=null,this.record_data={business_id:s,document_type:this.document_type,file_name:this.file.name,file_type:this.file.type}}getFileString(){let e=new FileReader;return e.onload=e=>{this.fileString=e.target.result},e.readAsDataURL(this.file),this.fileString}setPresignedUrl(e){this.presigned_url=e}}const S=e().email("Enter valid email").transform(c),N=e().matches(/^\d{10}$/,"Enter valid phone number").transform(c),g=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").matches(o,"Enter valid business name").transform(c),f=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").matches(o,"Enter valid doing business as").transform(c),y=e().matches(/^(?:http(s)?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/,"Enter valid website url").transform(c),_=e().oneOf(a.map((e=>e.value)),"Select business classification").transform(c),$=e().min(2,"Industry must be at least 2 characters").max(50,"Industry must be less than 50 characters").matches(d,"Enter valid industry").transform(c),w=e().matches(u,"Enter valid tax id, SSN, or EIN").test("not-repeat","Enter valid tax id, SSN, or EIN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid tax id, SSN, or EIN",(e=>"123456789"!==e)).transform(c),A=e().test("not-future","Date of incorporation cannot be in the future",(e=>new Date(e)<=new Date)).transform(c),x=e().min(2,"Name must be at least 2 characters").max(100,"Name must be less than 100 characters").matches(d,"Enter valid name").transform(c),I=e().min(2,"Title must be at least 2 characters").max(50,"Title must be less than 50 characters").matches(d,"Enter valid title").transform(c),P=s=>e().test("min","Enter a valid date",(e=>new Date(e)>=new Date("1902-01-01"))).test("age",`${s} must be at least 18 years old`,(e=>{const s=new Date(e),t=new Date;return t.setFullYear(t.getFullYear()-18),s<=t})).transform(c),D=e().matches(/^(?!000|666|9\d{2})\d{3}(?!00)\d{2}(?!0000)\d{4}$/,"Enter valid SSN").when("ssn_last4",{is:e=>!e||0===e.length,then:e=>e.required("Enter SSN"),otherwise:e=>e.nullable()}).test("not-repeat","Enter valid SSN",(e=>!/^(\d)\1+$/.test(e))).test("not-seq","Enter valid SSN",(e=>"123456789"!==e)).transform(c),z=e().min(5,"Address must be at least 5 characters").max(100,"Address must be less than 100 characters").matches(m,"Enter valid address line 1").test("not-po-box","A PO Box is not a valid address entry",(e=>!h.test(e))).transform(c),k=e().max(100,"Address must be less than 100 characters").matches(m,"Enter valid address line 2").test("not-po-box","A PO Box is not a valid address entry",(e=>!h.test(e))).transform(c),B=e().min(2,"City must be at least 2 characters").max(50,"City must be less than 50 characters").matches(d,"Enter valid city").transform(c),Z=e().oneOf(t.map((e=>e.value)),"Select state").transform(c),j=e().matches(/^[0-9]{5}$/,"Enter valid postal code").transform(c),q=e().matches(u,"Enter valid revenue").transform(c),C=e().matches(u,"Enter valid payment volume").transform(c),F=e().oneOf(r.map((e=>e.value)),"Select when service is received").transform(c),O=e().oneOf(n.map((e=>e.value)),"Select recurring payments").transform(c),R=e().when("business_recurring_payments",{is:e=>"Yes"===e,then:e=>e.required("Enter recurring payments percentage"),otherwise:e=>e.nullable()}).transform(c),T=e().oneOf(i.map((e=>e.value)),"Select seasonal business").transform(c),G=e().transform(c),H=e().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").matches(d,"Enter valid bank name").transform(c),J=e().min(2,"Name must be at least 2 characters").max(50,"Name must be less than 50 characters").matches(d,"Enter valid nickname").transform(c),K=e().oneOf(l.map((e=>e.value)),"Select account type").transform(c),L=e().min(8,"Account number must be at least 8 digits").max(17,"Account number must be less than 17 digits").matches(u,"Enter valid account number").test("not-repeat","Enter valid account number",(e=>!/^(\d)\1+$/.test(e))).transform(c),M=e().length(9,"Routing number must be 9 digits").matches(u,"Enter valid routing number").test("not-repeat","Enter valid routing number",(e=>!/^(\d)\1+$/.test(e))).test("valid","Enter valid routing number",(e=>(e=>{if(!e)return!1;const s=Array.from(String(e),Number);return 9===s.length&&0==(3*(s[0]+s[3]+s[6])+7*(s[1]+s[4]+s[7])+(s[2]+s[5]+s[8]))%10})(e))).transform(c),U=s(),Y=U,Q=U,V=U,W=(e,s)=>e.some((e=>e.document_type===b.voidedCheck))||s?U.nullable():U.required("Please select one or more files"),X=(e,s,t)=>{const a=parseInt(e);return s.some((e=>e.document_type===b.bankStatement))||t?U.nullable():a>=25e4&&!t?U.required("Please select one or more files"):void 0},ee=(e,s,t)=>{const a=parseInt(e);return s.some((e=>e.document_type===b.balanceSheet))||t?U.nullable():a>=1e6&&!t?U.required("Please select one or more files"):void 0},se=(e,s,t)=>{const a=parseInt(e);return s.some((e=>e.document_type===b.profitAndLossStatement))||t?U.nullable():a>=1e6&&!t?U.required("Please select one or more files"):void 0};export{J as A,K as B,L as C,M as D,W as E,Q as F,Y as G,V as H,ee as I,X as J,se as K,p as L,E as M,b as N,k as a,I as b,B as c,N as d,S as e,P as f,D as g,g as h,x as i,f as j,_ as k,z as l,$ as m,A as n,C as o,j as p,F as q,q as r,Z as s,w as t,O as u,R as v,y as w,T as x,G as y,H as z}
1
+ import { a as create$6, b as create$8 } from './p-2eab3c90.js';
2
+ import { S as StateOptions } from './p-6078a370.js';
3
+ import { b as businessClassificationOptions, a as businessServiceReceivedOptions, r as recurringPaymentsOptions, s as seasonalBusinessOptions, c as bankAccountTypeOptions } from './p-ba5fae28.js';
4
+
5
+ const transformEmptyString = (value) => {
6
+ return value === '' ? null : value;
7
+ };
8
+ const validateRoutingNumber = (routingNumber) => {
9
+ if (!routingNumber)
10
+ return false;
11
+ const integers = Array.from(String(routingNumber), Number);
12
+ if (integers.length === 9) {
13
+ const checksum = ((3 * (integers[0] + integers[3] + integers[6])) +
14
+ (7 * (integers[1] + integers[4] + integers[7])) +
15
+ (integers[2] + integers[5] + integers[8])) % 10;
16
+ if (checksum === 0)
17
+ return true;
18
+ }
19
+ return false;
20
+ };
21
+ const businessNameRegex = /^(?!^\s+$)[a-zA-Z0-9\s,&.-]*$/;
22
+ const phoneRegex = /^\d{10}$/;
23
+ const urlRegex = /^(?:http(s)?:\/\/)?(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)$/;
24
+ const stringLettersOnlyRegex = /^(?!^\s+$)[a-zA-Z\s]*$/;
25
+ const numbersOnlyRegex = /^\d+$/;
26
+ const ssnRegex = /^(?!000|666|9\d{2})\d{3}(?!00)\d{2}(?!0000)\d{4}$/;
27
+ const streetAddressRegex = /^(?!^\s+$)[a-zA-Z0-9\s,&.-]*$/;
28
+ const poBoxRegex = /P\.?\s?O\.?\s?Box|Postal\sBox/i;
29
+
30
+ var EntityDocumentType;
31
+ (function (EntityDocumentType) {
32
+ EntityDocumentType["voidedCheck"] = "voided_check";
33
+ EntityDocumentType["balanceSheet"] = "balance_sheet";
34
+ EntityDocumentType["bankStatement"] = "bank_statement";
35
+ EntityDocumentType["governmentId"] = "government_id";
36
+ EntityDocumentType["profitAndLossStatement"] = "profit_and_loss_statement";
37
+ EntityDocumentType["taxReturn"] = "tax_return";
38
+ EntityDocumentType["other"] = "other";
39
+ })(EntityDocumentType || (EntityDocumentType = {}));
40
+ var EntityDocumentStatus;
41
+ (function (EntityDocumentStatus) {
42
+ EntityDocumentStatus["pending"] = "pending";
43
+ EntityDocumentStatus["uploaded"] = "uploaded";
44
+ EntityDocumentStatus["canceled"] = "canceled";
45
+ EntityDocumentStatus["needed"] = "needed";
46
+ })(EntityDocumentStatus || (EntityDocumentStatus = {}));
47
+ class EntityDocumentStorage {
48
+ constructor() {
49
+ this.voided_check = [];
50
+ this.balance_sheet = [];
51
+ this.bank_statement = [];
52
+ this.government_id = [];
53
+ this.profit_and_loss_statement = [];
54
+ this.tax_return = [];
55
+ this.other = [];
56
+ }
57
+ }
58
+ class EntityDocument {
59
+ constructor(fileData, business_id) {
60
+ this.file = fileData.file;
61
+ this.fileString = this.getFileString();
62
+ this.document_type = fileData.document_type;
63
+ this.presigned_url = null;
64
+ this.record_data = {
65
+ business_id: business_id,
66
+ document_type: this.document_type,
67
+ file_name: this.file.name,
68
+ file_type: this.file.type,
69
+ };
70
+ }
71
+ getFileString() {
72
+ let reader = new FileReader();
73
+ reader.onload = (e) => {
74
+ this.fileString = e.target.result;
75
+ };
76
+ reader.readAsDataURL(this.file);
77
+ return this.fileString;
78
+ }
79
+ setPresignedUrl(url) {
80
+ this.presigned_url = url;
81
+ }
82
+ }
83
+
84
+ // Common Validations
85
+ const emailValidation = create$6()
86
+ .email('Enter valid email')
87
+ .transform(transformEmptyString);
88
+ const phoneValidation = create$6()
89
+ .matches(phoneRegex, 'Enter valid phone number')
90
+ .transform(transformEmptyString);
91
+ // Core Info Validations
92
+ const businessNameValidation = create$6()
93
+ .min(2, 'Name must be at least 2 characters')
94
+ .max(100, 'Name must be less than 100 characters')
95
+ .matches(businessNameRegex, 'Enter valid business name')
96
+ .transform(transformEmptyString);
97
+ const doingBusinessAsValidation = create$6()
98
+ .min(2, 'Name must be at least 2 characters')
99
+ .max(100, 'Name must be less than 100 characters')
100
+ .matches(businessNameRegex, 'Enter valid doing business as')
101
+ .transform(transformEmptyString);
102
+ const websiteUrlValidation = create$6()
103
+ .matches(urlRegex, 'Enter valid website url')
104
+ .transform(transformEmptyString);
105
+ const businessClassificationValidation = create$6()
106
+ .oneOf(businessClassificationOptions.map((option) => option.value), 'Select business classification')
107
+ .transform(transformEmptyString);
108
+ const industryValidation = create$6()
109
+ .min(2, 'Industry must be at least 2 characters')
110
+ .max(50, 'Industry must be less than 50 characters')
111
+ .matches(stringLettersOnlyRegex, 'Enter valid industry')
112
+ .transform(transformEmptyString);
113
+ const taxIdValidation = create$6()
114
+ .matches(numbersOnlyRegex, 'Enter valid tax id, SSN, or EIN')
115
+ .test('not-repeat', 'Enter valid tax id, SSN, or EIN', (value) => {
116
+ return !/^(\d)\1+$/.test(value);
117
+ })
118
+ .test('not-seq', 'Enter valid tax id, SSN, or EIN', (value) => {
119
+ return value !== '123456789';
120
+ })
121
+ .transform(transformEmptyString);
122
+ const dateOfIncorporationValidation = create$6()
123
+ .test('not-future', 'Date of incorporation cannot be in the future', (value) => {
124
+ const inputDate = new Date(value);
125
+ const today = new Date();
126
+ return inputDate <= today;
127
+ })
128
+ .transform(transformEmptyString);
129
+ // Identity Validations
130
+ const identityNameValidation = create$6()
131
+ .min(2, 'Name must be at least 2 characters')
132
+ .max(100, 'Name must be less than 100 characters')
133
+ .matches(stringLettersOnlyRegex, 'Enter valid name')
134
+ .transform(transformEmptyString);
135
+ const identityTitleValidation = create$6()
136
+ .min(2, 'Title must be at least 2 characters')
137
+ .max(50, 'Title must be less than 50 characters')
138
+ .matches(stringLettersOnlyRegex, 'Enter valid title')
139
+ .transform(transformEmptyString);
140
+ const dobValidation = (role) => {
141
+ return (create$6()
142
+ .test('min', 'Enter a valid date', (value) => {
143
+ const date = new Date(value);
144
+ const minDate = new Date('1902-01-01');
145
+ return date >= minDate;
146
+ })
147
+ .test('age', `${role} must be at least 18 years old`, (value) => {
148
+ const date = new Date(value);
149
+ const minAgeDate = new Date();
150
+ minAgeDate.setFullYear(minAgeDate.getFullYear() - 18);
151
+ return date <= minAgeDate;
152
+ })
153
+ .transform(transformEmptyString));
154
+ };
155
+ const ssnValidation = create$6()
156
+ .matches(ssnRegex, 'Enter valid SSN')
157
+ .when('ssn_last4', {
158
+ is: (val) => !val || val.length === 0,
159
+ then: (schema) => schema.required('Enter SSN'),
160
+ otherwise: (schema) => schema.nullable(),
161
+ })
162
+ .test('not-repeat', 'Enter valid SSN', (value) => {
163
+ return !/^(\d)\1+$/.test(value);
164
+ })
165
+ .test('not-seq', 'Enter valid SSN', (value) => {
166
+ return value !== '123456789';
167
+ })
168
+ .transform(transformEmptyString);
169
+ // Address Validations
170
+ const lineOneValidation = create$6()
171
+ .min(5, 'Address must be at least 5 characters')
172
+ .max(100, 'Address must be less than 100 characters')
173
+ .matches(streetAddressRegex, 'Enter valid address line 1')
174
+ .test('not-po-box', 'A PO Box is not a valid address entry', (value) => {
175
+ return !poBoxRegex.test(value);
176
+ })
177
+ .transform(transformEmptyString);
178
+ const lineTwoValidation = create$6()
179
+ .max(100, 'Address must be less than 100 characters')
180
+ .matches(streetAddressRegex, 'Enter valid address line 2')
181
+ .test('not-po-box', 'A PO Box is not a valid address entry', (value) => {
182
+ return !poBoxRegex.test(value);
183
+ })
184
+ .transform(transformEmptyString);
185
+ const cityValidation = create$6()
186
+ .min(2, 'City must be at least 2 characters')
187
+ .max(50, 'City must be less than 50 characters')
188
+ .matches(stringLettersOnlyRegex, 'Enter valid city')
189
+ .transform(transformEmptyString);
190
+ const stateValidation = create$6()
191
+ .oneOf(StateOptions.map((option) => option.value), 'Select state')
192
+ .transform(transformEmptyString);
193
+ const postalValidation = create$6()
194
+ .matches(/^[0-9]{5}$/, 'Enter valid postal code')
195
+ .transform(transformEmptyString);
196
+ // Additional Questions Validations
197
+ const revenueValidation = create$6()
198
+ .matches(numbersOnlyRegex, 'Enter valid revenue')
199
+ .transform(transformEmptyString);
200
+ const paymentVolumeValidation = create$6()
201
+ .matches(numbersOnlyRegex, 'Enter valid payment volume')
202
+ .transform(transformEmptyString);
203
+ const whenServiceReceivedValidation = create$6()
204
+ .oneOf(businessServiceReceivedOptions.map((option) => option.value), 'Select when service is received')
205
+ .transform(transformEmptyString);
206
+ const recurringPaymentsValidation = create$6()
207
+ .oneOf(recurringPaymentsOptions.map((option) => option.value), 'Select recurring payments')
208
+ .transform(transformEmptyString);
209
+ const recurringPaymentsPercentageValidation = create$6()
210
+ .when('business_recurring_payments', {
211
+ is: (val) => val === 'Yes',
212
+ then: (schema) => schema.required('Enter recurring payments percentage'),
213
+ otherwise: (schema) => schema.nullable(),
214
+ })
215
+ .transform(transformEmptyString);
216
+ const seasonalBusinessValidation = create$6()
217
+ .oneOf(seasonalBusinessOptions.map((option) => option.value), 'Select seasonal business')
218
+ .transform(transformEmptyString);
219
+ const otherPaymentDetailsValidation = create$6()
220
+ .transform(transformEmptyString);
221
+ // Bank Account Validations
222
+ const bankNameValidation = create$6()
223
+ .min(2, 'Name must be at least 2 characters')
224
+ .max(50, 'Name must be less than 50 characters')
225
+ .matches(stringLettersOnlyRegex, 'Enter valid bank name')
226
+ .transform(transformEmptyString);
227
+ const nicknameValidation = create$6()
228
+ .min(2, 'Name must be at least 2 characters')
229
+ .max(50, 'Name must be less than 50 characters')
230
+ .matches(stringLettersOnlyRegex, 'Enter valid nickname')
231
+ .transform(transformEmptyString);
232
+ const accountTypeValidation = create$6()
233
+ .oneOf(bankAccountTypeOptions.map((option) => option.value), 'Select account type')
234
+ .transform(transformEmptyString);
235
+ const accountNumberValidation = create$6()
236
+ .min(8, 'Account number must be at least 8 digits')
237
+ .max(17, 'Account number must be less than 17 digits')
238
+ .matches(numbersOnlyRegex, 'Enter valid account number')
239
+ .test('not-repeat', 'Enter valid account number', (value) => {
240
+ return !/^(\d)\1+$/.test(value);
241
+ })
242
+ .transform(transformEmptyString);
243
+ const routingNumberValidation = create$6()
244
+ .length(9, 'Routing number must be 9 digits')
245
+ .matches(numbersOnlyRegex, 'Enter valid routing number')
246
+ .test('not-repeat', 'Enter valid routing number', (value) => {
247
+ return !/^(\d)\1+$/.test(value);
248
+ })
249
+ .test('valid', 'Enter valid routing number', (value) => {
250
+ return validateRoutingNumber(value);
251
+ })
252
+ .transform(transformEmptyString);
253
+ // Document Upload Validations
254
+ const documentUploadValidation = create$8();
255
+ const ss4Validation = documentUploadValidation;
256
+ const governmentIdValidation = documentUploadValidation;
257
+ const otherDocumentValidation = documentUploadValidation;
258
+ const voidedCheckValidation = (documents, allowOptionalFields) => {
259
+ const existingDoc = documents.some((doc) => doc.document_type === EntityDocumentType.voidedCheck);
260
+ if (existingDoc || allowOptionalFields) {
261
+ return documentUploadValidation.nullable();
262
+ }
263
+ else {
264
+ return documentUploadValidation.required('Please select one or more files');
265
+ }
266
+ };
267
+ const bankStatementValidation = (volume, documents, allowOptionalFields) => {
268
+ const vol = parseInt(volume);
269
+ const bankStatementRequiredAmount = 250000;
270
+ const existingDoc = documents.some((doc) => doc.document_type === EntityDocumentType.bankStatement);
271
+ if (existingDoc || allowOptionalFields) {
272
+ return documentUploadValidation.nullable();
273
+ }
274
+ else if (vol >= bankStatementRequiredAmount && !allowOptionalFields) {
275
+ return documentUploadValidation.required('Please select one or more files');
276
+ }
277
+ };
278
+ const balanceSheetValidation = (volume, documents, allowOptionalFields) => {
279
+ const vol = parseInt(volume);
280
+ const balanceSheetRequiredAmount = 1000000;
281
+ const existingDoc = documents.some((doc) => doc.document_type === EntityDocumentType.balanceSheet);
282
+ if (existingDoc || allowOptionalFields) {
283
+ return documentUploadValidation.nullable();
284
+ }
285
+ else if (vol >= balanceSheetRequiredAmount && !allowOptionalFields) {
286
+ return documentUploadValidation.required('Please select one or more files');
287
+ }
288
+ };
289
+ const profitAndLossStatementValidation = (volume, documents, allowOptionalFields) => {
290
+ const vol = parseInt(volume);
291
+ const profitLossRequiredAmount = 1000000;
292
+ const existingDoc = documents.some((doc) => doc.document_type === EntityDocumentType.profitAndLossStatement);
293
+ if (existingDoc || allowOptionalFields) {
294
+ return documentUploadValidation.nullable();
295
+ }
296
+ else if (vol >= profitLossRequiredAmount && !allowOptionalFields) {
297
+ return documentUploadValidation.required('Please select one or more files');
298
+ }
299
+ };
300
+
301
+ export { nicknameValidation as A, accountTypeValidation as B, accountNumberValidation as C, routingNumberValidation as D, voidedCheckValidation as E, governmentIdValidation as F, ss4Validation as G, otherDocumentValidation as H, balanceSheetValidation as I, bankStatementValidation as J, profitAndLossStatementValidation as K, EntityDocument as L, EntityDocumentStorage as M, EntityDocumentType as N, lineTwoValidation as a, identityTitleValidation as b, cityValidation as c, phoneValidation as d, emailValidation as e, dobValidation as f, ssnValidation as g, businessNameValidation as h, identityNameValidation as i, doingBusinessAsValidation as j, businessClassificationValidation as k, lineOneValidation as l, industryValidation as m, dateOfIncorporationValidation as n, paymentVolumeValidation as o, postalValidation as p, whenServiceReceivedValidation as q, revenueValidation as r, stateValidation as s, taxIdValidation as t, recurringPaymentsValidation as u, recurringPaymentsPercentageValidation as v, websiteUrlValidation as w, seasonalBusinessValidation as x, otherPaymentDetailsValidation as y, bankNameValidation as z };
@@ -1 +1,27 @@
1
- const e=e=>{var n;if(!(e instanceof KeyboardEvent&&["Backspace","Tab","Enter","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Delete"].includes(e.key)||e instanceof KeyboardEvent&&(e.ctrlKey||e.metaKey)&&"v"===e.key.toLowerCase()))if(e instanceof ClipboardEvent){const o=null===(n=e.clipboardData)||void 0===n?void 0:n.getData("text");o&&!/^\d+$/.test(o)&&e.preventDefault()}else e instanceof KeyboardEvent&&!/^\d$/.test(e.key)&&e.preventDefault()};export{e as n}
1
+ const numberOnlyHandler = (e) => {
2
+ var _a;
3
+ const specialKeys = ['Backspace', 'Tab', 'Enter', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight', 'Delete'];
4
+ // Check if the key is a special key
5
+ if (e instanceof KeyboardEvent && specialKeys.includes(e.key)) {
6
+ return;
7
+ }
8
+ // Allow Ctrl+V / Command+V for pasting
9
+ const isPaste = e instanceof KeyboardEvent && (e.ctrlKey || e.metaKey) && e.key.toLowerCase() === 'v';
10
+ if (isPaste) {
11
+ return;
12
+ }
13
+ // Handle paste event
14
+ if (e instanceof ClipboardEvent) {
15
+ const clipboardData = (_a = e.clipboardData) === null || _a === void 0 ? void 0 : _a.getData('text');
16
+ if (clipboardData && !/^\d+$/.test(clipboardData)) {
17
+ e.preventDefault();
18
+ }
19
+ return;
20
+ }
21
+ // Prevent default action if the key is not a digit
22
+ if (e instanceof KeyboardEvent && !/^\d$/.test(e.key)) {
23
+ e.preventDefault();
24
+ }
25
+ };
26
+
27
+ export { numberOnlyHandler as n };
@@ -0,0 +1,54 @@
1
+ import { r as registerInstance, c as createEvent, h } from './p-fad19d75.js';
2
+ import { L as LoadingState, E as ErrorState } from './p-dce846bf.js';
3
+ import { S as StyledHost } from './p-ba4bae6f.js';
4
+
5
+ var RENDER_STATES;
6
+ (function (RENDER_STATES) {
7
+ RENDER_STATES["LOADING"] = "loading";
8
+ RENDER_STATES["READY"] = "ready";
9
+ RENDER_STATES["ERROR"] = "error";
10
+ })(RENDER_STATES || (RENDER_STATES = {}));
11
+ const BusinessDetailsCore = class {
12
+ constructor(hostRef) {
13
+ registerInstance(this, hostRef);
14
+ this.errorEvent = createEvent(this, "error-event", 7);
15
+ this.getBusiness = undefined;
16
+ this.business = undefined;
17
+ this.renderState = RENDER_STATES.LOADING;
18
+ this.errorMessage = 'An error ocurred.';
19
+ }
20
+ async componentWillLoad() {
21
+ if (this.getBusiness) {
22
+ this.fetchData();
23
+ }
24
+ }
25
+ fetchData() {
26
+ this.renderState = RENDER_STATES.LOADING;
27
+ this.getBusiness({
28
+ onSuccess: ({ business }) => {
29
+ this.business = business;
30
+ this.renderState = RENDER_STATES.READY;
31
+ },
32
+ onError: ({ error, code, severity }) => {
33
+ this.errorMessage = error;
34
+ this.renderState = RENDER_STATES.ERROR;
35
+ this.errorEvent.emit({
36
+ errorCode: code,
37
+ message: error,
38
+ severity,
39
+ });
40
+ }
41
+ });
42
+ }
43
+ render() {
44
+ if (this.renderState === RENDER_STATES.LOADING) {
45
+ return h(StyledHost, null, LoadingState());
46
+ }
47
+ if (this.renderState === RENDER_STATES.ERROR) {
48
+ return h(StyledHost, null, ErrorState(this.errorMessage));
49
+ }
50
+ return (h(StyledHost, null, h("generic-info-details", { business: this.business }), h("legal-address-details", { legalAddress: this.business.legal_address }), h("representative-details", { representative: this.business.representative }), h("owner-details", { owners: this.business.owners }), h("additional-questions-details", { additionalQuestions: this.business.additional_questions })));
51
+ }
52
+ };
53
+
54
+ export { BusinessDetailsCore as business_details_core };
@@ -1 +1,24 @@
1
- import{h as n}from"./p-fad19d75.js";const t=(t,r)=>{const o={primary:["button","button-primary"],secondary:["button","button-secondary"]};return n("button",Object.assign({class:{primary:"btn btn-primary",secondary:"btn btn-secondary"}[t.variant],onClick:t.clickHandler,part:(()=>{const n=o[t.variant];return t.isLoading&&n.push("button-loading"),n.join(" ")})()},t),t.isLoading?n("div",{class:"spinner-border spinner-border-sm",role:"status",part:"button-spinner"},n("span",{class:"visually-hidden"},"Loading...")):r)};export{t as B}
1
+ import { h } from './p-fad19d75.js';
2
+
3
+ const ButtonSpinner = () => (h("div", { class: "spinner-border spinner-border-sm", role: "status", part: "button-spinner" },
4
+ h("span", { class: "visually-hidden" }, "Loading...")));
5
+
6
+ const Button = (props, children) => {
7
+ const classMap = {
8
+ primary: 'btn btn-primary',
9
+ secondary: 'btn btn-secondary',
10
+ };
11
+ const exportPartMapping = {
12
+ primary: ['button', 'button-primary'],
13
+ secondary: ['button', 'button-secondary'],
14
+ };
15
+ const getCSSParts = () => {
16
+ const baseCSSParts = exportPartMapping[props.variant];
17
+ if (props.isLoading)
18
+ baseCSSParts.push('button-loading');
19
+ return baseCSSParts.join(' ');
20
+ };
21
+ return (h("button", Object.assign({ class: classMap[props.variant], onClick: props.clickHandler, part: getCSSParts() }, props), props.isLoading ? ButtonSpinner() : children));
22
+ };
23
+
24
+ export { Button as B };