@justifi/webcomponents 4.22.0 → 4.22.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 (118) hide show
  1. package/dist/cjs/{Analytics-9db96975.js → Analytics-99a3c7f8.js} +1 -1
  2. package/dist/cjs/{business-additional-questions-schema-19f08938.js → business-additional-questions-schema-d82355b0.js} +1 -1
  3. package/dist/cjs/{business-identity-schema-a8bb2276.js → business-identity-schema-3d241053.js} +1 -1
  4. package/dist/cjs/{check-pkg-version-23a1cabd.js → check-pkg-version-9bd49ad6.js} +1 -1
  5. package/dist/cjs/checkouts-list-core.cjs.entry.js +10 -47
  6. package/dist/cjs/checkouts-table-24c065ff.js +47 -0
  7. package/dist/cjs/form-control-checkbox_9.cjs.entry.js +3 -3
  8. package/dist/cjs/justifi-additional-questions-form-step_10.cjs.entry.js +1 -1
  9. package/dist/cjs/justifi-bank-account-form.cjs.entry.js +2 -2
  10. package/dist/cjs/justifi-billing-form_2.cjs.entry.js +2 -2
  11. package/dist/cjs/justifi-business-details.cjs.entry.js +3 -3
  12. package/dist/cjs/justifi-business-form.cjs.entry.js +6 -6
  13. package/dist/cjs/justifi-card-form.cjs.entry.js +2 -2
  14. package/dist/cjs/justifi-checkout.cjs.entry.js +3 -3
  15. package/dist/cjs/justifi-checkouts-list.cjs.entry.js +7 -5
  16. package/dist/cjs/justifi-gross-payment-chart.cjs.entry.js +3 -3
  17. package/dist/cjs/justifi-owner-form_3.cjs.entry.js +2 -2
  18. package/dist/cjs/justifi-payment-details.cjs.entry.js +3 -3
  19. package/dist/cjs/justifi-payment-form.cjs.entry.js +3 -3
  20. package/dist/cjs/justifi-payment-provisioning.cjs.entry.js +3 -3
  21. package/dist/cjs/justifi-payments-list.cjs.entry.js +3 -3
  22. package/dist/cjs/justifi-payout-details.cjs.entry.js +3 -3
  23. package/dist/cjs/justifi-payouts-list.cjs.entry.js +3 -3
  24. package/dist/cjs/justifi-season-interruption-insurance.cjs.entry.js +3 -3
  25. package/dist/cjs/justifi-terminals-list.cjs.entry.js +6 -5
  26. package/dist/cjs/justifi-tokenize-payment-method.cjs.entry.js +3 -3
  27. package/dist/cjs/{package-41c8f38c.js → package-e25f61a8.js} +1 -1
  28. package/dist/cjs/{schema-validations-184a4356.js → schema-validations-7a9afa7c.js} +0 -1
  29. package/dist/cjs/{table-bb114e2f.js → table-20e9a053.js} +3 -0
  30. package/dist/cjs/terminals-list-core.cjs.entry.js +7 -30
  31. package/dist/cjs/terminals-table-99a7b87b.js +32 -0
  32. package/dist/collection/components/business-forms/schemas/schema-validations.js +0 -1
  33. package/dist/collection/components/checkouts-list/checkouts-list-core.js +7 -7
  34. package/dist/collection/components/checkouts-list/checkouts-list.js +5 -3
  35. package/dist/collection/components/terminals-list/terminals-list-core.js +7 -7
  36. package/dist/collection/components/terminals-list/terminals-list.js +5 -3
  37. package/dist/collection/utils/table.js +3 -0
  38. package/dist/docs.json +3 -3
  39. package/dist/esm/{Analytics-777962a4.js → Analytics-f4e959b2.js} +1 -1
  40. package/dist/esm/{business-additional-questions-schema-97f52255.js → business-additional-questions-schema-a5072d2b.js} +1 -1
  41. package/dist/esm/{business-identity-schema-434e16bc.js → business-identity-schema-b31178a1.js} +1 -1
  42. package/dist/esm/{check-pkg-version-bac8fac0.js → check-pkg-version-5e658940.js} +1 -1
  43. package/dist/esm/checkouts-list-core.entry.js +9 -46
  44. package/dist/esm/checkouts-table-62c44909.js +43 -0
  45. package/dist/esm/form-control-checkbox_9.entry.js +3 -3
  46. package/dist/esm/justifi-additional-questions-form-step_10.entry.js +1 -1
  47. package/dist/esm/justifi-bank-account-form.entry.js +2 -2
  48. package/dist/esm/justifi-billing-form_2.entry.js +2 -2
  49. package/dist/esm/justifi-business-details.entry.js +3 -3
  50. package/dist/esm/justifi-business-form.entry.js +6 -6
  51. package/dist/esm/justifi-card-form.entry.js +2 -2
  52. package/dist/esm/justifi-checkout.entry.js +3 -3
  53. package/dist/esm/justifi-checkouts-list.entry.js +7 -5
  54. package/dist/esm/justifi-gross-payment-chart.entry.js +3 -3
  55. package/dist/esm/justifi-owner-form_3.entry.js +2 -2
  56. package/dist/esm/justifi-payment-details.entry.js +3 -3
  57. package/dist/esm/justifi-payment-form.entry.js +3 -3
  58. package/dist/esm/justifi-payment-provisioning.entry.js +3 -3
  59. package/dist/esm/justifi-payments-list.entry.js +3 -3
  60. package/dist/esm/justifi-payout-details.entry.js +3 -3
  61. package/dist/esm/justifi-payouts-list.entry.js +3 -3
  62. package/dist/esm/justifi-season-interruption-insurance.entry.js +3 -3
  63. package/dist/esm/justifi-terminals-list.entry.js +6 -5
  64. package/dist/esm/justifi-tokenize-payment-method.entry.js +3 -3
  65. package/dist/esm/{package-5144835c.js → package-95aca142.js} +1 -1
  66. package/dist/esm/{schema-validations-c1728516.js → schema-validations-cd8c5f69.js} +0 -1
  67. package/dist/esm/{table-75364107.js → table-5da154e7.js} +3 -0
  68. package/dist/esm/terminals-list-core.entry.js +8 -31
  69. package/dist/esm/terminals-table-059c473e.js +28 -0
  70. package/dist/module/checkouts-list-core2.js +6 -5
  71. package/dist/module/justifi-checkouts-list.js +3 -3
  72. package/dist/module/justifi-terminals-list.js +3 -3
  73. package/dist/module/package.js +1 -1
  74. package/dist/module/schema-validations.js +0 -1
  75. package/dist/module/table.js +3 -0
  76. package/dist/module/terminals-list-core2.js +6 -5
  77. package/dist/types/utils/table.d.ts +1 -0
  78. package/dist/webcomponents/p-02cf5e6f.js +1 -0
  79. package/dist/webcomponents/{p-dae9b10e.entry.js → p-09fb7dd6.entry.js} +1 -1
  80. package/dist/webcomponents/p-0c03a971.entry.js +1 -0
  81. package/dist/webcomponents/{p-037e3545.entry.js → p-0ec27543.entry.js} +1 -1
  82. package/dist/webcomponents/{p-b0686897.entry.js → p-1251a3f5.entry.js} +1 -1
  83. package/dist/webcomponents/p-1ab798f4.entry.js +1 -0
  84. package/dist/webcomponents/{p-c1cf7d5b.js → p-22e38d5b.js} +1 -1
  85. package/dist/webcomponents/{p-52ca72cd.entry.js → p-2a9f48f0.entry.js} +1 -1
  86. package/dist/webcomponents/{p-f4a8215b.entry.js → p-2dc7751f.entry.js} +1 -1
  87. package/dist/webcomponents/p-3f82f724.entry.js +1 -0
  88. package/dist/webcomponents/p-44f7f729.entry.js +1 -0
  89. package/dist/webcomponents/{p-69ea7334.entry.js → p-55f78fcc.entry.js} +1 -1
  90. package/dist/webcomponents/{p-b4a7307b.entry.js → p-5fd72c29.entry.js} +1 -1
  91. package/dist/webcomponents/{p-3d3468a8.js → p-7285c687.js} +1 -1
  92. package/dist/webcomponents/{p-11ff46df.entry.js → p-7a8c13ba.entry.js} +1 -1
  93. package/dist/webcomponents/{p-d1248039.entry.js → p-83b01812.entry.js} +1 -1
  94. package/dist/webcomponents/p-88efdd31.js +1 -0
  95. package/dist/webcomponents/p-8e228e5a.js +1 -0
  96. package/dist/webcomponents/{p-0b686ada.entry.js → p-8e2e24d8.entry.js} +1 -1
  97. package/dist/webcomponents/p-90b8acc6.js +1 -0
  98. package/dist/webcomponents/{p-4c0c88e4.entry.js → p-91711083.entry.js} +1 -1
  99. package/dist/webcomponents/{p-2de65000.entry.js → p-92a766d8.entry.js} +1 -1
  100. package/dist/webcomponents/{p-56bda985.js → p-9e7204b5.js} +1 -1
  101. package/dist/webcomponents/{p-04d12939.entry.js → p-9ef4d294.entry.js} +1 -1
  102. package/dist/webcomponents/{p-c63825d8.entry.js → p-a91a2152.entry.js} +1 -1
  103. package/dist/webcomponents/p-b16269d7.js +1 -0
  104. package/dist/webcomponents/{p-e7d6609d.js → p-b459d0b0.js} +1 -1
  105. package/dist/webcomponents/p-bba131f9.entry.js +1 -0
  106. package/dist/webcomponents/{p-f7077f93.entry.js → p-c458fc48.entry.js} +1 -1
  107. package/dist/webcomponents/{p-cb79f06c.entry.js → p-eed325b7.entry.js} +1 -1
  108. package/dist/webcomponents/{p-0c79e368.entry.js → p-f45197b9.entry.js} +1 -1
  109. package/dist/webcomponents/webcomponents.esm.js +1 -1
  110. package/package.json +1 -1
  111. package/dist/webcomponents/p-0ac35b39.entry.js +0 -1
  112. package/dist/webcomponents/p-24392a86.entry.js +0 -1
  113. package/dist/webcomponents/p-907ba963.js +0 -1
  114. package/dist/webcomponents/p-9bd13e22.js +0 -1
  115. package/dist/webcomponents/p-a2be972d.entry.js +0 -1
  116. package/dist/webcomponents/p-b1aacd6b.entry.js +0 -1
  117. package/dist/webcomponents/p-c65b78cf.js +0 -1
  118. package/dist/webcomponents/p-ec7e69eb.entry.js +0 -1
@@ -1 +1 @@
1
- import{r as e,h as o,c as t,H as i}from"./p-fad19d75.js";import{c as r,F as n}from"./p-3c654c07.js";import{u as a,l as s,k as d,m as f,n as c,q as l}from"./p-c65b78cf.js";import{S as u}from"./p-6078a370.js";import{n as m}from"./p-e3c22aa9.js";import{S as h}from"./p-74da98da.js";import{p as b}from"./p-c1cf7d5b.js";import{j as w}from"./p-a8f22d4d.js";import"./p-1815a43b.js";import"./p-5e7c60d8.js";import"./p-1ff8810b.js";const g=r({name:a.required("Enter full name"),address_line1:s.required("Enter street address"),address_line2:d.nullable(),address_city:f.required("Enter city"),address_state:c.required("Select state"),address_postal_code:l.required("Enter postal code")}),p=class{constructor(o){e(this,o),this.inputHandler=(e,o)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:o}))},this.legend=void 0,this.formController=void 0,this.billingInfo=void 0,this.errors={}}componentWillLoad(){this.formController=new n(g)}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate()}}render(){const e=this.formController.getInitialValues();return o(h,{key:"221838c3ba8255b62db0f2feee7b227b0d240627",exportparts:"label,input,input-invalid"},o("form",{key:"87377d7776c3fdf7ffa351f25522921b233dd16f"},o("fieldset",{key:"821487e408ec634dd23417604f02f1aa212dcb2a"},this.legend&&o("legend",{key:"c042f51480e23ad455a6d3fc420f494c33d93f2c"},this.legend),o("div",{key:"6a9f2c0fd10c7786b132f7208036cf878e3fe8c1",class:"row gy-3"},o("div",{key:"b375c19faeb23927e290c4a60b4347dc64868840",class:"col-12"},o("form-control-text",{key:"be3b78234607f996efe8971082ff457e63767e22",name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),o("div",{key:"95d3f3bb6ff7df39deb2967db11017e8f80ca5a9",class:"col-12"},o("form-control-text",{key:"9e719038219bf7b7651679b617b2131ab5336289",name:"address_line1",label:"Street Address",defaultValue:e.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),o("div",{key:"0945bca70a70abfdce40c8d52537eb06479aface",class:"col-12"},o("form-control-text",{key:"59b9b87c005609daf501b0d7d6a8d640297c75c4",name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:e.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),o("div",{key:"f3e9d8297e9e4009a0b16f331eeffb1316a92030",class:"col-12"},o("form-control-text",{key:"158a4d2e3e85700a5c80304e0316391090b52f74",name:"address_city",label:"City",defaultValue:e.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),o("div",{key:"67110a816d76d4c98062859733def72e88f1a3d9",class:"col-12"},o("form-control-select",{key:"d26b22251d6da9d8f7b8bb109126e804cdfbccb0",name:"address_state",label:"State",options:u,defaultValue:e.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),o("div",{key:"a248ef0a4860d9d634f46e96cc953c8ca0ee64f1",class:"col-12"},o("form-control-text",{key:"36f96a7e94088dd140ca9774903387ae2be3cad8",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:m}))))))}};p.style=":host{display:block}justifi-billing-form{margin-left:calc(var(--jfi-layout-padding) * -1);margin-right:calc(var(--jfi-layout-padding) * -1)}*::part(label){color:var(--jfi-form-label-color);font-family:var(--jfi-form-label-font-family);font-weight:var(--jfi-form-label-font-weight);font-size:var(--jfi-form-label-font-size);margin:var(--jfi-form-label-margin)}*::part(input){background-color:var(--jfi-form-control-background-color);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-radius:var(--jfi-form-control-border-radius);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);font-size:var(--jfi-form-control-font-size);font-weight:var(--jfi-form-control-font-weight);line-height:var(--jfi-form-control-line-height);margin:var(--jfi-form-control-margin);padding:var(--jfi-form-control-padding)}*::part(input):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}*::part(input-invalid){border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error)}*::part(input-invalid):focus{border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error-focus)}";var v,y={exports:{}};v=y,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var o,t,i=0,r=!1,n=!1,a=7,s="[iFrameSizer]",d=s.length,f=null,c=window.requestAnimationFrame,l=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},m=null,h=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){x("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),b={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(o,t){N(t,e)})).end()}):k("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof e&&e.amd?e([],P):v.exports=P(),window.iFrameResize=window.iFrameResize||P()}function w(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function g(e,o,t){e.addEventListener(o,t,!1)}function p(e,o,t){e.removeEventListener(o,t,!1)}function y(e){return u[e]?u[e].log:r}function j(e,o){z("log",e,o,y(e))}function k(e,o){z("info",e,o,y(e))}function x(e,o){z("warn",e,o,!0)}function z(e,o,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var o="Host page: "+e;return window.top!==window.self&&(o=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),o}(e)+"]"}(o),t)}function F(e){function o(){t("Height"),t("Width"),W((function(){E(V),T(L),h("onResized",V)}),V,"init")}function t(e){var o=Number(u[L]["max"+e]),t=Number(u[L]["min"+e]),i=e.toLowerCase(),r=Number(V[i]);j(L,"Checking "+i+" is in range "+t+"-"+o),r<t&&(r=t,j(L,"Set "+i+" to min value")),r>o&&(r=o,j(L,"Set "+i+" to max value")),V[i]=""+r}function i(e){return N.slice(N.indexOf(":")+a+e)}function r(e,o){var t,i;t=function(){var t,i;H("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=V.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,o)},b[i=o]||(b[i]=setTimeout((function(){b[i]=null,t()}),32))}function n(e){var o=e.getBoundingClientRect();return O(L),{x:Math.floor(Number(o.left)+Number(f.x)),y:Math.floor(Number(o.top)+Number(f.y))}}function c(e){var o=e?n(V.iframe):{x:0,y:0},t={x:Number(V.width)+o.x,y:Number(V.height)+o.y};j(L,"Reposition requested from iFrame (offset x:"+o.x+" y:"+o.y+")"),window.top===window.self?(f=t,l(),j(L,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):x(L,"Unable to scroll to requested position, window.parentIFrame not found")}function l(){!1===h("onScroll",f)?R():T(L)}function m(e){var o={};if(0===Number(V.width)&&0===Number(V.height)){var t=i(9).split(":");o={x:t[1],y:t[0]}}else o={x:V.width,y:V.height};h(e,{iframe:V.iframe,screenX:Number(o.x),screenY:Number(o.y),type:V.type})}function h(e,o){return S(L,e,o)}var w,v,y,z,F,M,N=e.data,V={},L=null;"[iFrameResizerChild]Ready"===N?function(){for(var e in u)H("iFrame requested init",A(e),u[e].iframe,e)}():s===(""+N).slice(0,d)&&N.slice(d).split(":")[0]in u?(z=(y=N.slice(d).split(":"))[1]?parseInt(y[1],10):0,F=u[y[0]]&&u[y[0]].iframe,M=getComputedStyle(F),V={iframe:F,id:y[0],height:z+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(M)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(M),width:y[2],type:y[3]},u[L=V.id]&&(u[L].loaded=!0),(v=V.type in{true:1,false:1,undefined:1})&&j(L,"Ignoring init message from meta parent page"),!v&&function(e){var o=!0;return u[e]||(o=!1,x(V.type+" No settings for "+e+". Message was: "+N)),o}(L)&&(j(L,"Received: "+N),w=!0,null===V.iframe&&(x(L,"IFrame ("+V.id+") not found"),w=!1),w&&function(){var o,t=e.origin,i=u[L]&&u[L].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,o=!1;for(j(L,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){o=!0;break}return o}():(j(L,"Checking connection is from: "+(o=u[L]&&u[L].remoteHost)),t===o)))throw new Error("Unexpected message received from: "+t+" for "+V.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[L]&&u[L].firstRun&&u[L]&&(u[L].firstRun=!1),V.type){case"close":I(V.iframe);break;case"message":d=i(6),j(L,"onMessage passed: {iframe: "+V.iframe.id+", message: "+d+"}"),h("onMessage",{iframe:V.iframe,message:JSON.parse(d)}),j(L,"--");break;case"mouseenter":m("onMouseEnter");break;case"mouseleave":m("onMouseLeave");break;case"autoResize":u[L].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":r(u[L]&&u[L].iframe,L),function(){function e(e,i){function n(){u[t]?r(u[t].iframe,t):o()}["scroll","resize"].forEach((function(o){j(t,e+o+" listener for sendPageInfo"),i(window,o,n)}))}function o(){e("Remove ",p)}var t=L;e("Add ",g),u[t]&&(u[t].stopPageInfo=o)}();break;case"pageInfoStop":u[L]&&u[L].stopPageInfo&&(u[L].stopPageInfo(),delete u[L].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",a=decodeURIComponent(t),(s=document.getElementById(a)||document.getElementsByName(a)[0])?(e=n(s),j(L,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),f={x:e.x,y:e.y},l(),j(L,"--")):window.top===window.self?j(L,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):j(L,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":C(V);break;case"init":o(),h("onInit",V.iframe);break;default:0===Number(V.width)&&0===Number(V.height)?x("Unsupported message received ("+V.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):o()}var e,t,a,s,d}())):k(L,"Ignored: "+N)}function S(e,o,t){var i=null,r=null;if(u[e]){if("function"!=typeof(i=u[e][o]))throw new TypeError(o+" on iFrame["+e+"] is not a function");r=i(t)}return r}function M(e){delete u[e.id]}function I(e){var t=e.id;if(!1!==S(t,"onClose",t)){j(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){x(e)}S(t,"onClosed",t),j(t,"--"),M(e),o&&(o.disconnect(),o=null)}else j(t,"Close iframe cancelled by onClose event")}function O(o){null===f&&j(o,"Get page position: "+(f={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+f.y)}function T(e){null!==f&&(window.scrollTo(f.x,f.y),j(e,"Set page position: "+f.x+","+f.y),R())}function R(){f=null}function C(e){j(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),O(e.id),W((function(){E(e),H("reset","reset",e.iframe,e.id)}),e,"reset")}function E(e){function o(o){n||"0"!==e[o]||(n=!0,j(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function o(o){return"0px"===(u[e]&&u[e].iframe.style[o])}u[e]&&null!==u[e].iframe.offsetParent&&(o("height")||o("width"))&&H("Visibility change","resize",u[e].iframe,e)}(e)}))}function o(o){j("window","Mutation observed: "+o[0].target+" "+o[0].type),V(e,16)}var t,i=w();i&&(t=document.querySelector("body"),new i(o).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(o){e.id?(e.iframe.style[o]=e[o]+"px",j(e.id,"IFrame ("+i+") "+o+" set to "+e[o]+"px")):j("undefined","messageData id not set")}(t),o(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function W(e,o,t){t!==o.type&&c&&!window.jasmine?(j(o.id,"Requesting animation frame"),c(e)):e()}function H(e,o,t,i,r){var n,a=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(j(i,"["+e+"] Sending msg to iframe["+i+"] ("+o+") targetOrigin: "+(n=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+o,n)):x(i,"["+e+"] IFrame("+i+") not found"),r&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||a||(a=!0,x(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function A(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function N(t,n){function a(e){var o=e.split("Callback");if(2===o.length){var t="on"+o[0].charAt(0).toUpperCase()+o[0].slice(1);this[t]=this[e],delete this[e],x(f,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var s,d,f=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var o;return""===e&&(t.id=(o=n&&n.id||h.id+i++,null!==document.getElementById(o)&&(o+=i++),e=o),r=(n||{}).log,j(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);f in u&&"iFrameResizer"in t?x(f,"Ignored iFrame, already setup."):(function(e){var o;e=e||{},u[f]=Object.create(null),u[f].iframe=t,u[f].firstRun=!0,u[f].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(a,e),function(e){for(var o in h)Object.prototype.hasOwnProperty.call(h,o)&&(u[f][o]=Object.prototype.hasOwnProperty.call(e,o)?e[o]:h[o])}(e),u[f]&&(u[f].targetOrigin=!0===u[f].checkOrigin?""===(o=u[f].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*")}(n),function(){switch(j(f,"IFrame scrolling "+(u[f]&&u[f].scrolling?"enabled":"disabled")+" for "+f),t.style.overflow=!1===(u[f]&&u[f].scrolling)?"hidden":"auto",u[f]&&u[f].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[f]?u[f].scrolling:"no"}}(),function(){function e(e){var o=u[f][e];1/0!==o&&0!==o&&(t.style[e]="number"==typeof o?o+"px":o,j(f,"Set "+e+" = "+t.style[e]))}function o(e){if(u[f]["min"+e]>u[f]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}o("Height"),o("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[f]&&u[f].bodyMargin)&&"0"!==(u[f]&&u[f].bodyMargin)||(u[f].bodyMarginV1=u[f].bodyMargin,u[f].bodyMargin=u[f].bodyMargin+"px"),s=A(f),(d=w())&&(o=function(e){if(!t.parentNode)return null;var o=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&I(t)}))}))}));return o.observe(t.parentNode,{childList:!0}),o}(d)),g(t,"load",(function(){H("iFrame.onload",s,t,e,!0),(!u[f]||!u[f].firstRun)&&u[f]&&u[f].heightCalculationMethod in l&&C({iframe:t,height:0,width:0,type:"init"})})),H("init",s,t,e,!0),u[f]&&(u[f].iframe.iFrameResizer={close:I.bind(null,u[f].iframe),removeListeners:M.bind(null,u[f].iframe),resize:H.bind(null,"Window resize","resize",u[f].iframe),moveToAnchor:function(e){H("Move to anchor","moveToAnchor:"+e,u[f].iframe,f)},sendMessage:function(e){H("Send Message","message:"+(e=JSON.stringify(e)),u[f].iframe,f)}}))}function V(e,o){null===m&&(m=setTimeout((function(){m=null,e()}),o))}function L(){"hidden"!==document.visibilityState&&(j("document","Trigger event: Visibility change"),V((function(){_("Tab Visible","resize")}),16))}function _(e,o){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&H(e,o,u[t].iframe,t)}))}function P(){function o(e,o){o&&(function(){if(!o.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==o.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+o.tagName+">")}(),N(o,e),t.push(o))}var t;return function(){var e,o=["moz","webkit","o","ms"];for(e=0;e<o.length&&!c;e+=1)c=window[o[e]+"RequestAnimationFrame"];c?c=c.bind(window):j("setup","RequestAnimationFrame not supported")}(),g(window,"message",F),g(window,"resize",(function(){j("window","Trigger event: resize"),V((function(){_("Window resize","resize")}),16)})),g(document,"visibilitychange",L),g(document,"-webkit-visibilitychange",L),function(i,r){switch(t=[],function(e){e&&e.enablePublicMethods&&x("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof r){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(r||"iframe"),o.bind(e,i));break;case"object":o(i,r);break;default:throw new TypeError("Unexpected data type ("+typeof r+")")}return t}}}();const j=y.exports,k={card:{ready:"justifi.card.ready",tokenize:"justifi.card.tokenize",validate:"justifi.card.validate",resize:"justifi.card.resize",styleOverrides:"justifi.card.styleOverrides"},bankAccount:{ready:"justifi.bankAccount.ready",tokenize:"justifi.bankAccount.tokenize",validate:"justifi.bankAccount.validate",resize:"justifi.bankAccount.resize",styleOverrides:"justifi.bankAccount.styleOverrides"}};class x{constructor(e,o){this.iframe=e,this.iframeOrigin=o}postMessage(e,o){const t=Object.assign({eventType:e},o);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,o){return new Promise((t=>{const i=o=>{o.data.eventType===e&&(window.removeEventListener("message",i),t(o.data.data))};window.addEventListener("message",i),this.postMessage(e,o)}))}}const z=class{constructor(o){e(this,o),this.paymentMethodFormReady=t(this,"paymentMethodFormReady",7),this.paymentMethodFormValidated=t(this,"paymentMethodFormValidated",7),this.paymentMethodFormTokenized=t(this,"paymentMethodFormTokenized",7),this.computedTheme=(()=>{const e=getComputedStyle(document.body);return{loadGoogleFont:e.getPropertyValue("--jfi-load-google-font"),layout:{fontFamily:e.getPropertyValue("--jfi-layout-font-family"),padding:e.getPropertyValue("--jfi-layout-padding"),formControlSpacingHorizontal:e.getPropertyValue("--jfi-layout-form-control-spacing-x"),formControlSpacingVertical:e.getPropertyValue("--jfi-layout-form-control-spacing-y")},formControl:{backgroundColor:e.getPropertyValue("--jfi-form-control-background-color"),borderColor:e.getPropertyValue("--jfi-form-control-border-color"),borderColorFocus:e.getPropertyValue("--jfi-form-control-border-color-focus"),borderColorError:e.getPropertyValue("--jfi-form-control-border-color-error"),borderWidth:e.getPropertyValue("--jfi-form-control-border-width"),borderBottomWidth:e.getPropertyValue("--jfi-form-control-border-bottom-width"),borderLeftWidth:e.getPropertyValue("--jfi-form-control-border-left-width"),borderRightWidth:e.getPropertyValue("--jfi-form-control-border-right-width"),borderTopWidth:e.getPropertyValue("--jfi-form-control-border-top-width"),borderRadius:e.getPropertyValue("--jfi-form-control-border-radius"),borderStyle:e.getPropertyValue("--jfi-form-control-border-style"),boxShadow:e.getPropertyValue("--jfi-form-control-box-shadow"),boxShadowError:e.getPropertyValue("--jfi-form-control-box-shadow-error"),boxShadowErrorFocus:e.getPropertyValue("--jfi-form-control-box-shadow-error-focus"),boxShadowFocus:e.getPropertyValue("--jfi-form-control-box-shadow-focus"),color:e.getPropertyValue("--jfi-form-control-color"),colorFocus:e.getPropertyValue("--jfi-form-control-color-focus"),fontSize:e.getPropertyValue("--jfi-form-control-font-size"),fontWeight:e.getPropertyValue("--jfi-form-control-font-weight"),lineHeight:e.getPropertyValue("--jfi-form-control-line-height"),margin:e.getPropertyValue("--jfi-form-control-margin"),padding:e.getPropertyValue("--jfi-form-control-padding")},formLabel:{color:e.getPropertyValue("--jfi-form-label-color"),fontFamily:e.getPropertyValue("--jfi-form-label-font-family"),fontSize:e.getPropertyValue("--jfi-form-label-font-size"),fontWeight:e.getPropertyValue("--jfi-form-label-font-weight"),margin:e.getPropertyValue("--jfi-form-label-margin")},errorMessage:{color:e.getPropertyValue("--jfi-error-message-color"),margin:e.getPropertyValue("--jfi-error-message-margin"),fontSize:e.getPropertyValue("--jfi-error-message-font-size")}}})(),this.dispatchMessageEvent=e=>{const{eventType:o,data:t}=e.data,i=k[this.paymentMethodFormType];o===i.ready?(this.paymentMethodFormReady.emit(t),this.sendStyleOverrides()):o===i.tokenize?this.paymentMethodFormTokenized.emit(t):o===i.validate&&this.paymentMethodFormValidated.emit(t)},this.postMessage=(e,o)=>{this.frameService.postMessage(e,o)},this.paymentMethodFormType=void 0,this.paymentMethodFormValidationMode=void 0,this.iframeOrigin=void 0,this.singleLine=void 0}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async resize(){this.postMessage(k[this.paymentMethodFormType].resize)}async tokenize(e,o,t){return this.frameService.postMessageWithResponseListener(k[this.paymentMethodFormType].tokenize,{clientId:e,paymentMethodMetadata:o,account:t,componentVersion:b.version})}async validate(){return this.frameService.postMessageWithResponseListener(k[this.paymentMethodFormType].validate)}sendStyleOverrides(){this.computedTheme&&this.postMessage(k[this.paymentMethodFormType].styleOverrides,{styleOverrides:this.computedTheme})}getIframeSrc(){let e=[];return this.paymentMethodFormValidationMode&&e.push(`validationMode=${this.paymentMethodFormValidationMode}`),this.singleLine&&e.push(`singleLine=${this.singleLine}`),`${this.iframeOrigin}/${this.paymentMethodFormType}${w(e)}`}initializeFrameCommunicationService(){var e;this.frameService=new x(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}render(){return o(i,{key:"10987c92745fbff8bb85367db69b76e2bc786c88"},o("iframe",{key:"0622dd0201a04a3c918fd3d175d2a29f24609759",id:`justifi-payment-method-form-${this.paymentMethodFormType}`,src:this.getIframeSrc(),ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},onLoad:()=>{j({scrollbars:!1},this.iframeElement)}}))}};z.style=":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}iframe{width:1px;min-width:100%}";export{p as justifi_billing_form,z as justifi_payment_method_form}
1
+ import{r as e,h as o,c as t,H as i}from"./p-fad19d75.js";import{c as r,F as n}from"./p-3c654c07.js";import{u as a,l as s,k as d,m as f,n as c,q as l}from"./p-88efdd31.js";import{S as u}from"./p-6078a370.js";import{n as m}from"./p-e3c22aa9.js";import{S as h}from"./p-74da98da.js";import{p as b}from"./p-22e38d5b.js";import{j as w}from"./p-a8f22d4d.js";import"./p-1815a43b.js";import"./p-5e7c60d8.js";import"./p-1ff8810b.js";const g=r({name:a.required("Enter full name"),address_line1:s.required("Enter street address"),address_line2:d.nullable(),address_city:f.required("Enter city"),address_state:c.required("Select state"),address_postal_code:l.required("Enter postal code")}),p=class{constructor(o){e(this,o),this.inputHandler=(e,o)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[e]:o}))},this.legend=void 0,this.formController=void 0,this.billingInfo=void 0,this.errors={}}componentWillLoad(){this.formController=new n(g)}componentDidLoad(){this.formController.values.subscribe((e=>this.billingInfo=Object.assign({},e))),this.formController.errors.subscribe((e=>{this.errors=Object.assign({},e)}))}async getValues(){return this.formController.values.getValue()}async fill(e){this.formController.setInitialValues(e)}async validate(){return{isValid:await this.formController.validate()}}render(){const e=this.formController.getInitialValues();return o(h,{key:"221838c3ba8255b62db0f2feee7b227b0d240627",exportparts:"label,input,input-invalid"},o("form",{key:"87377d7776c3fdf7ffa351f25522921b233dd16f"},o("fieldset",{key:"821487e408ec634dd23417604f02f1aa212dcb2a"},this.legend&&o("legend",{key:"c042f51480e23ad455a6d3fc420f494c33d93f2c"},this.legend),o("div",{key:"6a9f2c0fd10c7786b132f7208036cf878e3fe8c1",class:"row gy-3"},o("div",{key:"b375c19faeb23927e290c4a60b4347dc64868840",class:"col-12"},o("form-control-text",{key:"be3b78234607f996efe8971082ff457e63767e22",name:"name",label:"Full Name",defaultValue:e.name,errorText:this.errors.name,inputHandler:this.inputHandler})),o("div",{key:"95d3f3bb6ff7df39deb2967db11017e8f80ca5a9",class:"col-12"},o("form-control-text",{key:"9e719038219bf7b7651679b617b2131ab5336289",name:"address_line1",label:"Street Address",defaultValue:e.address_line1,errorText:this.errors.address_line1,inputHandler:this.inputHandler})),o("div",{key:"0945bca70a70abfdce40c8d52537eb06479aface",class:"col-12"},o("form-control-text",{key:"59b9b87c005609daf501b0d7d6a8d640297c75c4",name:"address_line2",label:"Apartment, Suite, etc. (optional)",defaultValue:e.address_line2,errorText:this.errors.address_line2,inputHandler:this.inputHandler})),o("div",{key:"f3e9d8297e9e4009a0b16f331eeffb1316a92030",class:"col-12"},o("form-control-text",{key:"158a4d2e3e85700a5c80304e0316391090b52f74",name:"address_city",label:"City",defaultValue:e.address_city,errorText:this.errors.address_city,inputHandler:this.inputHandler})),o("div",{key:"67110a816d76d4c98062859733def72e88f1a3d9",class:"col-12"},o("form-control-select",{key:"d26b22251d6da9d8f7b8bb109126e804cdfbccb0",name:"address_state",label:"State",options:u,defaultValue:e.address_state,errorText:this.errors.address_state,inputHandler:this.inputHandler})),o("div",{key:"a248ef0a4860d9d634f46e96cc953c8ca0ee64f1",class:"col-12"},o("form-control-text",{key:"36f96a7e94088dd140ca9774903387ae2be3cad8",name:"address_postal_code",label:"ZIP",defaultValue:e.address_postal_code,errorText:this.errors.address_postal_code,inputHandler:this.inputHandler,maxLength:5,keyDownHandler:m}))))))}};p.style=":host{display:block}justifi-billing-form{margin-left:calc(var(--jfi-layout-padding) * -1);margin-right:calc(var(--jfi-layout-padding) * -1)}*::part(label){color:var(--jfi-form-label-color);font-family:var(--jfi-form-label-font-family);font-weight:var(--jfi-form-label-font-weight);font-size:var(--jfi-form-label-font-size);margin:var(--jfi-form-label-margin)}*::part(input){background-color:var(--jfi-form-control-background-color);border-color:var(--jfi-form-control-border-color);border-width:var(--jfi-form-control-border-width);border-bottom-width:var(--jfi-form-control-border-bottom-width);border-left-width:var(--jfi-form-control-border-left-width);border-right-width:var(--jfi-form-control-border-right-width);border-top-width:var(--jfi-form-control-border-top-width);border-radius:var(--jfi-form-control-border-radius);border-style:var(--jfi-form-control-border-style);box-shadow:var(--jfi-form-control-box-shadow);color:var(--jfi-form-control-color);font-size:var(--jfi-form-control-font-size);font-weight:var(--jfi-form-control-font-weight);line-height:var(--jfi-form-control-line-height);margin:var(--jfi-form-control-margin);padding:var(--jfi-form-control-padding)}*::part(input):focus{color:var(--jfi-form-control-color-focus);border-color:var(--jfi-form-control-border-color-focus);box-shadow:var(--jfi-form-control-box-shadow-focus)}*::part(input-invalid){border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error)}*::part(input-invalid):focus{border-color:var(--jfi-form-control-border-color-error);box-shadow:var(--jfi-form-control-box-shadow-error-focus)}";var v,y={exports:{}};v=y,console.info("\nIFRAME-RESIZER\n\nIframe-Resizer 5 is now available via the following two packages:\n\n * @iframe-resizer/parent\n * @iframe-resizer/child\n\nAdditionally their are also new versions of iframe-resizer for React, Vue, and jQuery.\n\nVersion 5 of iframe-resizer has been extensively rewritten to use modern browser APIs, which has enabled significantly better performance and greater accuracy in the detection of content resizing events.\n\nPlease see https://iframe-resizer.com/upgrade for more details.\n"),function(e){if("undefined"!=typeof window){var o,t,i=0,r=!1,n=!1,a=7,s="[iFrameSizer]",d=s.length,f=null,c=window.requestAnimationFrame,l=Object.freeze({max:1,scroll:1,bodyScroll:1,documentElementScroll:1}),u={},m=null,h=Object.freeze({autoResize:!0,bodyBackground:null,bodyMargin:null,bodyMarginV1:8,bodyPadding:null,checkOrigin:!0,inPageLinks:!1,enablePublicMethods:!0,heightCalculationMethod:"bodyOffset",id:"iFrameResizer",interval:32,license:"1jqr0si6pnt",log:!1,maxHeight:1/0,maxWidth:1/0,minHeight:0,minWidth:0,mouseEvents:!0,resizeFrom:"parent",scrolling:!1,sizeHeight:!0,sizeWidth:!1,warningTimeout:5e3,tolerance:0,widthCalculationMethod:"scroll",onClose:function(){return!0},onClosed:function(){},onInit:function(){},onMessage:function(){x("onMessage function not defined")},onMouseEnter:function(){},onMouseLeave:function(){},onResized:function(){},onScroll:function(){return!0}}),b={};window.jQuery!==e&&((t=window.jQuery).fn?t.fn.iFrameResize||(t.fn.iFrameResize=function(e){return this.filter("iframe").each((function(o,t){N(t,e)})).end()}):k("","Unable to bind to jQuery, it is not fully loaded.")),"function"==typeof e&&e.amd?e([],P):v.exports=P(),window.iFrameResize=window.iFrameResize||P()}function w(){return window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver}function g(e,o,t){e.addEventListener(o,t,!1)}function p(e,o,t){e.removeEventListener(o,t,!1)}function y(e){return u[e]?u[e].log:r}function j(e,o){z("log",e,o,y(e))}function k(e,o){z("info",e,o,y(e))}function x(e,o){z("warn",e,o,!0)}function z(e,o,t,i){!0===i&&"object"==typeof window.console&&console[e](function(e){return s+"["+function(e){var o="Host page: "+e;return window.top!==window.self&&(o=window.parentIFrame&&window.parentIFrame.getId?window.parentIFrame.getId()+": "+e:"Nested host page: "+e),o}(e)+"]"}(o),t)}function F(e){function o(){t("Height"),t("Width"),W((function(){E(V),T(L),h("onResized",V)}),V,"init")}function t(e){var o=Number(u[L]["max"+e]),t=Number(u[L]["min"+e]),i=e.toLowerCase(),r=Number(V[i]);j(L,"Checking "+i+" is in range "+t+"-"+o),r<t&&(r=t,j(L,"Set "+i+" to min value")),r>o&&(r=o,j(L,"Set "+i+" to max value")),V[i]=""+r}function i(e){return N.slice(N.indexOf(":")+a+e)}function r(e,o){var t,i;t=function(){var t,i;H("Send Page Info","pageInfo:"+(t=document.body.getBoundingClientRect(),i=V.iframe.getBoundingClientRect(),JSON.stringify({iframeHeight:i.height,iframeWidth:i.width,clientHeight:Math.max(document.documentElement.clientHeight,window.innerHeight||0),clientWidth:Math.max(document.documentElement.clientWidth,window.innerWidth||0),offsetTop:parseInt(i.top-t.top,10),offsetLeft:parseInt(i.left-t.left,10),scrollTop:window.pageYOffset,scrollLeft:window.pageXOffset,documentHeight:document.documentElement.clientHeight,documentWidth:document.documentElement.clientWidth,windowHeight:window.innerHeight,windowWidth:window.innerWidth})),e,o)},b[i=o]||(b[i]=setTimeout((function(){b[i]=null,t()}),32))}function n(e){var o=e.getBoundingClientRect();return O(L),{x:Math.floor(Number(o.left)+Number(f.x)),y:Math.floor(Number(o.top)+Number(f.y))}}function c(e){var o=e?n(V.iframe):{x:0,y:0},t={x:Number(V.width)+o.x,y:Number(V.height)+o.y};j(L,"Reposition requested from iFrame (offset x:"+o.x+" y:"+o.y+")"),window.top===window.self?(f=t,l(),j(L,"--")):window.parentIFrame?window.parentIFrame["scrollTo"+(e?"Offset":"")](t.x,t.y):x(L,"Unable to scroll to requested position, window.parentIFrame not found")}function l(){!1===h("onScroll",f)?R():T(L)}function m(e){var o={};if(0===Number(V.width)&&0===Number(V.height)){var t=i(9).split(":");o={x:t[1],y:t[0]}}else o={x:V.width,y:V.height};h(e,{iframe:V.iframe,screenX:Number(o.x),screenY:Number(o.y),type:V.type})}function h(e,o){return S(L,e,o)}var w,v,y,z,F,M,N=e.data,V={},L=null;"[iFrameResizerChild]Ready"===N?function(){for(var e in u)H("iFrame requested init",A(e),u[e].iframe,e)}():s===(""+N).slice(0,d)&&N.slice(d).split(":")[0]in u?(z=(y=N.slice(d).split(":"))[1]?parseInt(y[1],10):0,F=u[y[0]]&&u[y[0]].iframe,M=getComputedStyle(F),V={iframe:F,id:y[0],height:z+function(e){return"border-box"!==e.boxSizing?0:(e.paddingTop?parseInt(e.paddingTop,10):0)+(e.paddingBottom?parseInt(e.paddingBottom,10):0)}(M)+function(e){return"border-box"!==e.boxSizing?0:(e.borderTopWidth?parseInt(e.borderTopWidth,10):0)+(e.borderBottomWidth?parseInt(e.borderBottomWidth,10):0)}(M),width:y[2],type:y[3]},u[L=V.id]&&(u[L].loaded=!0),(v=V.type in{true:1,false:1,undefined:1})&&j(L,"Ignoring init message from meta parent page"),!v&&function(e){var o=!0;return u[e]||(o=!1,x(V.type+" No settings for "+e+". Message was: "+N)),o}(L)&&(j(L,"Received: "+N),w=!0,null===V.iframe&&(x(L,"IFrame ("+V.id+") not found"),w=!1),w&&function(){var o,t=e.origin,i=u[L]&&u[L].checkOrigin;if(i&&""+t!="null"&&!(i.constructor===Array?function(){var e=0,o=!1;for(j(L,"Checking connection is from allowed list of origins: "+i);e<i.length;e++)if(i[e]===t){o=!0;break}return o}():(j(L,"Checking connection is from: "+(o=u[L]&&u[L].remoteHost)),t===o)))throw new Error("Unexpected message received from: "+t+" for "+V.iframe.id+". Message was: "+e.data+". This error can be disabled by setting the checkOrigin: false option or by providing of array of trusted domains.");return!0}()&&function(){switch(u[L]&&u[L].firstRun&&u[L]&&(u[L].firstRun=!1),V.type){case"close":I(V.iframe);break;case"message":d=i(6),j(L,"onMessage passed: {iframe: "+V.iframe.id+", message: "+d+"}"),h("onMessage",{iframe:V.iframe,message:JSON.parse(d)}),j(L,"--");break;case"mouseenter":m("onMouseEnter");break;case"mouseleave":m("onMouseLeave");break;case"autoResize":u[L].autoResize=JSON.parse(i(9));break;case"scrollTo":c(!1);break;case"scrollToOffset":c(!0);break;case"pageInfo":r(u[L]&&u[L].iframe,L),function(){function e(e,i){function n(){u[t]?r(u[t].iframe,t):o()}["scroll","resize"].forEach((function(o){j(t,e+o+" listener for sendPageInfo"),i(window,o,n)}))}function o(){e("Remove ",p)}var t=L;e("Add ",g),u[t]&&(u[t].stopPageInfo=o)}();break;case"pageInfoStop":u[L]&&u[L].stopPageInfo&&(u[L].stopPageInfo(),delete u[L].stopPageInfo);break;case"inPageLink":t=i(9).split("#")[1]||"",a=decodeURIComponent(t),(s=document.getElementById(a)||document.getElementsByName(a)[0])?(e=n(s),j(L,"Moving to in page link (#"+t+") at x: "+e.x+" y: "+e.y),f={x:e.x,y:e.y},l(),j(L,"--")):window.top===window.self?j(L,"In page link #"+t+" not found"):window.parentIFrame?window.parentIFrame.moveToAnchor(t):j(L,"In page link #"+t+" not found and window.parentIFrame not found");break;case"reset":C(V);break;case"init":o(),h("onInit",V.iframe);break;default:0===Number(V.width)&&0===Number(V.height)?x("Unsupported message received ("+V.type+"), this is likely due to the iframe containing a later version of iframe-resizer than the parent page"):o()}var e,t,a,s,d}())):k(L,"Ignored: "+N)}function S(e,o,t){var i=null,r=null;if(u[e]){if("function"!=typeof(i=u[e][o]))throw new TypeError(o+" on iFrame["+e+"] is not a function");r=i(t)}return r}function M(e){delete u[e.id]}function I(e){var t=e.id;if(!1!==S(t,"onClose",t)){j(t,"Removing iFrame: "+t);try{e.parentNode&&e.parentNode.removeChild(e)}catch(e){x(e)}S(t,"onClosed",t),j(t,"--"),M(e),o&&(o.disconnect(),o=null)}else j(t,"Close iframe cancelled by onClose event")}function O(o){null===f&&j(o,"Get page position: "+(f={x:window.pageXOffset===e?document.documentElement.scrollLeft:window.pageXOffset,y:window.pageYOffset===e?document.documentElement.scrollTop:window.pageYOffset}).x+","+f.y)}function T(e){null!==f&&(window.scrollTo(f.x,f.y),j(e,"Set page position: "+f.x+","+f.y),R())}function R(){f=null}function C(e){j(e.id,"Size reset requested by "+("init"===e.type?"host page":"iFrame")),O(e.id),W((function(){E(e),H("reset","reset",e.iframe,e.id)}),e,"reset")}function E(e){function o(o){n||"0"!==e[o]||(n=!0,j(i,"Hidden iFrame detected, creating visibility listener"),function(){function e(){Object.keys(u).forEach((function(e){!function(e){function o(o){return"0px"===(u[e]&&u[e].iframe.style[o])}u[e]&&null!==u[e].iframe.offsetParent&&(o("height")||o("width"))&&H("Visibility change","resize",u[e].iframe,e)}(e)}))}function o(o){j("window","Mutation observed: "+o[0].target+" "+o[0].type),V(e,16)}var t,i=w();i&&(t=document.querySelector("body"),new i(o).observe(t,{attributes:!0,attributeOldValue:!1,characterData:!0,characterDataOldValue:!1,childList:!0,subtree:!0}))}())}function t(t){!function(o){e.id?(e.iframe.style[o]=e[o]+"px",j(e.id,"IFrame ("+i+") "+o+" set to "+e[o]+"px")):j("undefined","messageData id not set")}(t),o(t)}var i=e.iframe.id;u[i]&&(u[i].sizeHeight&&t("height"),u[i].sizeWidth&&t("width"))}function W(e,o,t){t!==o.type&&c&&!window.jasmine?(j(o.id,"Requesting animation frame"),c(e)):e()}function H(e,o,t,i,r){var n,a=!1;u[i=i||t.id]&&(t&&"contentWindow"in t&&null!==t.contentWindow?(j(i,"["+e+"] Sending msg to iframe["+i+"] ("+o+") targetOrigin: "+(n=u[i]&&u[i].targetOrigin)),t.contentWindow.postMessage(s+o,n)):x(i,"["+e+"] IFrame("+i+") not found"),r&&u[i]&&u[i].warningTimeout&&(u[i].msgTimeout=setTimeout((function(){!u[i]||u[i].loaded||a||(a=!0,x(i,"IFrame has not responded within "+u[i].warningTimeout/1e3+" seconds. Check iFrameResizer.contentWindow.js has been loaded in iFrame. This message can be ignored if everything is working, or you can set the warningTimeout option to a higher value or zero to suppress this warning."))}),u[i].warningTimeout)))}function A(e){return e+":"+u[e].bodyMarginV1+":"+u[e].sizeWidth+":"+u[e].log+":"+u[e].interval+":"+u[e].enablePublicMethods+":"+u[e].autoResize+":"+u[e].bodyMargin+":"+u[e].heightCalculationMethod+":"+u[e].bodyBackground+":"+u[e].bodyPadding+":"+u[e].tolerance+":"+u[e].inPageLinks+":"+u[e].resizeFrom+":"+u[e].widthCalculationMethod+":"+u[e].mouseEvents}function N(t,n){function a(e){var o=e.split("Callback");if(2===o.length){var t="on"+o[0].charAt(0).toUpperCase()+o[0].slice(1);this[t]=this[e],delete this[e],x(f,"Deprecated: '"+e+"' has been renamed '"+t+"'. The old method will be removed in the next major version.")}}var s,d,f=function(e){if("string"!=typeof e)throw new TypeError("Invaild id for iFrame. Expected String");var o;return""===e&&(t.id=(o=n&&n.id||h.id+i++,null!==document.getElementById(o)&&(o+=i++),e=o),r=(n||{}).log,j(e,"Added missing iframe ID: "+e+" ("+t.src+")")),e}(t.id);f in u&&"iFrameResizer"in t?x(f,"Ignored iFrame, already setup."):(function(e){var o;e=e||{},u[f]=Object.create(null),u[f].iframe=t,u[f].firstRun=!0,u[f].remoteHost=t.src&&t.src.split("/").slice(0,3).join("/"),function(e){if("object"!=typeof e)throw new TypeError("Options is not an object")}(e),Object.keys(e).forEach(a,e),function(e){for(var o in h)Object.prototype.hasOwnProperty.call(h,o)&&(u[f][o]=Object.prototype.hasOwnProperty.call(e,o)?e[o]:h[o])}(e),u[f]&&(u[f].targetOrigin=!0===u[f].checkOrigin?""===(o=u[f].remoteHost)||null!==o.match(/^(about:blank|javascript:|file:\/\/)/)?"*":o:"*")}(n),function(){switch(j(f,"IFrame scrolling "+(u[f]&&u[f].scrolling?"enabled":"disabled")+" for "+f),t.style.overflow=!1===(u[f]&&u[f].scrolling)?"hidden":"auto",u[f]&&u[f].scrolling){case"omit":break;case!0:t.scrolling="yes";break;case!1:t.scrolling="no";break;default:t.scrolling=u[f]?u[f].scrolling:"no"}}(),function(){function e(e){var o=u[f][e];1/0!==o&&0!==o&&(t.style[e]="number"==typeof o?o+"px":o,j(f,"Set "+e+" = "+t.style[e]))}function o(e){if(u[f]["min"+e]>u[f]["max"+e])throw new Error("Value for min"+e+" can not be greater than max"+e)}o("Height"),o("Width"),e("maxHeight"),e("minHeight"),e("maxWidth"),e("minWidth")}(),"number"!=typeof(u[f]&&u[f].bodyMargin)&&"0"!==(u[f]&&u[f].bodyMargin)||(u[f].bodyMarginV1=u[f].bodyMargin,u[f].bodyMargin=u[f].bodyMargin+"px"),s=A(f),(d=w())&&(o=function(e){if(!t.parentNode)return null;var o=new e((function(e){e.forEach((function(e){Array.prototype.slice.call(e.removedNodes).forEach((function(e){e===t&&I(t)}))}))}));return o.observe(t.parentNode,{childList:!0}),o}(d)),g(t,"load",(function(){H("iFrame.onload",s,t,e,!0),(!u[f]||!u[f].firstRun)&&u[f]&&u[f].heightCalculationMethod in l&&C({iframe:t,height:0,width:0,type:"init"})})),H("init",s,t,e,!0),u[f]&&(u[f].iframe.iFrameResizer={close:I.bind(null,u[f].iframe),removeListeners:M.bind(null,u[f].iframe),resize:H.bind(null,"Window resize","resize",u[f].iframe),moveToAnchor:function(e){H("Move to anchor","moveToAnchor:"+e,u[f].iframe,f)},sendMessage:function(e){H("Send Message","message:"+(e=JSON.stringify(e)),u[f].iframe,f)}}))}function V(e,o){null===m&&(m=setTimeout((function(){m=null,e()}),o))}function L(){"hidden"!==document.visibilityState&&(j("document","Trigger event: Visibility change"),V((function(){_("Tab Visible","resize")}),16))}function _(e,o){Object.keys(u).forEach((function(t){(function(e){return u[e]&&"parent"===u[e].resizeFrom&&u[e].autoResize&&!u[e].firstRun})(t)&&H(e,o,u[t].iframe,t)}))}function P(){function o(e,o){o&&(function(){if(!o.tagName)throw new TypeError("Object is not a valid DOM element");if("IFRAME"!==o.tagName.toUpperCase())throw new TypeError("Expected <IFRAME> tag, found <"+o.tagName+">")}(),N(o,e),t.push(o))}var t;return function(){var e,o=["moz","webkit","o","ms"];for(e=0;e<o.length&&!c;e+=1)c=window[o[e]+"RequestAnimationFrame"];c?c=c.bind(window):j("setup","RequestAnimationFrame not supported")}(),g(window,"message",F),g(window,"resize",(function(){j("window","Trigger event: resize"),V((function(){_("Window resize","resize")}),16)})),g(document,"visibilitychange",L),g(document,"-webkit-visibilitychange",L),function(i,r){switch(t=[],function(e){e&&e.enablePublicMethods&&x("enablePublicMethods option has been removed, public methods are now always available in the iFrame")}(i),typeof r){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(r||"iframe"),o.bind(e,i));break;case"object":o(i,r);break;default:throw new TypeError("Unexpected data type ("+typeof r+")")}return t}}}();const j=y.exports,k={card:{ready:"justifi.card.ready",tokenize:"justifi.card.tokenize",validate:"justifi.card.validate",resize:"justifi.card.resize",styleOverrides:"justifi.card.styleOverrides"},bankAccount:{ready:"justifi.bankAccount.ready",tokenize:"justifi.bankAccount.tokenize",validate:"justifi.bankAccount.validate",resize:"justifi.bankAccount.resize",styleOverrides:"justifi.bankAccount.styleOverrides"}};class x{constructor(e,o){this.iframe=e,this.iframeOrigin=o}postMessage(e,o){const t=Object.assign({eventType:e},o);this.iframe.contentWindow.postMessage(t,this.iframeOrigin)}addMessageListener(e){window.addEventListener("message",e)}removeMessageListener(e){window.removeEventListener("message",e)}postMessageWithResponseListener(e,o){return new Promise((t=>{const i=o=>{o.data.eventType===e&&(window.removeEventListener("message",i),t(o.data.data))};window.addEventListener("message",i),this.postMessage(e,o)}))}}const z=class{constructor(o){e(this,o),this.paymentMethodFormReady=t(this,"paymentMethodFormReady",7),this.paymentMethodFormValidated=t(this,"paymentMethodFormValidated",7),this.paymentMethodFormTokenized=t(this,"paymentMethodFormTokenized",7),this.computedTheme=(()=>{const e=getComputedStyle(document.body);return{loadGoogleFont:e.getPropertyValue("--jfi-load-google-font"),layout:{fontFamily:e.getPropertyValue("--jfi-layout-font-family"),padding:e.getPropertyValue("--jfi-layout-padding"),formControlSpacingHorizontal:e.getPropertyValue("--jfi-layout-form-control-spacing-x"),formControlSpacingVertical:e.getPropertyValue("--jfi-layout-form-control-spacing-y")},formControl:{backgroundColor:e.getPropertyValue("--jfi-form-control-background-color"),borderColor:e.getPropertyValue("--jfi-form-control-border-color"),borderColorFocus:e.getPropertyValue("--jfi-form-control-border-color-focus"),borderColorError:e.getPropertyValue("--jfi-form-control-border-color-error"),borderWidth:e.getPropertyValue("--jfi-form-control-border-width"),borderBottomWidth:e.getPropertyValue("--jfi-form-control-border-bottom-width"),borderLeftWidth:e.getPropertyValue("--jfi-form-control-border-left-width"),borderRightWidth:e.getPropertyValue("--jfi-form-control-border-right-width"),borderTopWidth:e.getPropertyValue("--jfi-form-control-border-top-width"),borderRadius:e.getPropertyValue("--jfi-form-control-border-radius"),borderStyle:e.getPropertyValue("--jfi-form-control-border-style"),boxShadow:e.getPropertyValue("--jfi-form-control-box-shadow"),boxShadowError:e.getPropertyValue("--jfi-form-control-box-shadow-error"),boxShadowErrorFocus:e.getPropertyValue("--jfi-form-control-box-shadow-error-focus"),boxShadowFocus:e.getPropertyValue("--jfi-form-control-box-shadow-focus"),color:e.getPropertyValue("--jfi-form-control-color"),colorFocus:e.getPropertyValue("--jfi-form-control-color-focus"),fontSize:e.getPropertyValue("--jfi-form-control-font-size"),fontWeight:e.getPropertyValue("--jfi-form-control-font-weight"),lineHeight:e.getPropertyValue("--jfi-form-control-line-height"),margin:e.getPropertyValue("--jfi-form-control-margin"),padding:e.getPropertyValue("--jfi-form-control-padding")},formLabel:{color:e.getPropertyValue("--jfi-form-label-color"),fontFamily:e.getPropertyValue("--jfi-form-label-font-family"),fontSize:e.getPropertyValue("--jfi-form-label-font-size"),fontWeight:e.getPropertyValue("--jfi-form-label-font-weight"),margin:e.getPropertyValue("--jfi-form-label-margin")},errorMessage:{color:e.getPropertyValue("--jfi-error-message-color"),margin:e.getPropertyValue("--jfi-error-message-margin"),fontSize:e.getPropertyValue("--jfi-error-message-font-size")}}})(),this.dispatchMessageEvent=e=>{const{eventType:o,data:t}=e.data,i=k[this.paymentMethodFormType];o===i.ready?(this.paymentMethodFormReady.emit(t),this.sendStyleOverrides()):o===i.tokenize?this.paymentMethodFormTokenized.emit(t):o===i.validate&&this.paymentMethodFormValidated.emit(t)},this.postMessage=(e,o)=>{this.frameService.postMessage(e,o)},this.paymentMethodFormType=void 0,this.paymentMethodFormValidationMode=void 0,this.iframeOrigin=void 0,this.singleLine=void 0}disconnectedCallback(){this.frameService.removeMessageListener(this.dispatchMessageEvent)}async resize(){this.postMessage(k[this.paymentMethodFormType].resize)}async tokenize(e,o,t){return this.frameService.postMessageWithResponseListener(k[this.paymentMethodFormType].tokenize,{clientId:e,paymentMethodMetadata:o,account:t,componentVersion:b.version})}async validate(){return this.frameService.postMessageWithResponseListener(k[this.paymentMethodFormType].validate)}sendStyleOverrides(){this.computedTheme&&this.postMessage(k[this.paymentMethodFormType].styleOverrides,{styleOverrides:this.computedTheme})}getIframeSrc(){let e=[];return this.paymentMethodFormValidationMode&&e.push(`validationMode=${this.paymentMethodFormValidationMode}`),this.singleLine&&e.push(`singleLine=${this.singleLine}`),`${this.iframeOrigin}/${this.paymentMethodFormType}${w(e)}`}initializeFrameCommunicationService(){var e;this.frameService=new x(this.iframeElement,this.iframeOrigin),null===(e=this.frameService)||void 0===e||e.addMessageListener(this.dispatchMessageEvent)}render(){return o(i,{key:"10987c92745fbff8bb85367db69b76e2bc786c88"},o("iframe",{key:"0622dd0201a04a3c918fd3d175d2a29f24609759",id:`justifi-payment-method-form-${this.paymentMethodFormType}`,src:this.getIframeSrc(),ref:e=>{this.iframeElement=e,this.initializeFrameCommunicationService()},onLoad:()=>{j({scrollbars:!1},this.iframeElement)}}))}};z.style=":host{display:block}justifi-payment-method-form iframe{border:none;width:100%}iframe{width:1px;min-width:100%}";export{p as justifi_billing_form,z as justifi_payment_method_form}
@@ -0,0 +1 @@
1
+ import{a as e,b as s}from"./p-3c654c07.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-1815a43b.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").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,_ as a,g as b,A as c,f as d,S as e,C as f,F as g,O as h,$ as i,R as j,k,z as l,B as m,Z as n,G as o,N as p,j as q,q as r,T as s,w as t,x as u,I as v,y as w,P as x,D as y,H as z}
@@ -0,0 +1 @@
1
+ import{h as e}from"./p-fad19d75.js";const t=e=>{switch(e){case"connected":return"<span class='badge bg-success' title='This terminal is connected.'>Connected</span>";case"disconnected":return"<span class='badge bg-danger' title='This terminal is disconnected.'>Disconnected</span>";case"unknown":return"<span class='badge bg-secondary' title='The status of this terminal is unknown'>Unknown</span>"}},a="nickname,provider_id,status",n={nickname:()=>e("th",{part:"table-head-cell",scope:"col",title:"The nickname associated with the terminal"},"Nickname"),provider_id:()=>e("th",{part:"table-head-cell",scope:"col",title:"The provider ID of the terminal"},"Provider ID"),sub_account_name:()=>e("th",{part:"table-head-cell",scope:"col",title:"The sub account associated with the terminal"},"Sub Account"),status:()=>e("th",{part:"table-head-cell",scope:"col",title:"The current status of each terminal"},"Status")},s={nickname:t=>e("td",null,t),provider_id:t=>e("td",null,t),sub_account_name:t=>e("td",null,t),status:a=>e("td",{innerHTML:t(a)})};export{s as a,a as d,n as t}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-fad19d75.js";import{m as o,P as r}from"./p-47dbe17d.js";import"./p-16d2932d.js";import"./p-56f6ce4c.js";import"./p-7fec2bcb.js";import{P as e}from"./p-9f56ad71.js";import{C as a,a as p}from"./p-14c91ffd.js";import{g as h,a as d}from"./p-8115b2f4.js";import{E as c}from"./p-a8b4f429.js";import{J as n}from"./p-56bda985.js";import{c as m}from"./p-e7d6609d.js";import"./p-0e180654.js";import"./p-5a62fca2.js";import"./p-c1cf7d5b.js";const u=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.payoutId=void 0,this.authToken=void 0,this.getPayout=void 0,this.getPayoutCSV=void 0,this.errorMessage=null}componentWillLoad(){m(),this.analytics=new n(this),this.initializeServices()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeServices()}initializeServices(){this.payoutId&&this.authToken?(this.getPayout=(({id:t,authToken:s,service:i})=>async({onSuccess:o,onError:r})=>{var p;try{const c=await i.fetchPayout(t,s);c.error?r({error:h(c.error),code:d(null===(p=c.error)||void 0===p?void 0:p.code),severity:a.ERROR}):o(new e(c.data))}catch(t){r({error:h(t),code:d(null==t?void 0:t.code),severity:a.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new r}),this.getPayoutCSV=o({authToken:this.authToken,service:new r})):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:p.MISSING_PROPS,severity:a.ERROR}))}render(){return this.errorMessage?c(this.errorMessage):i("payout-details-core",{getPayout:this.getPayout,getPayoutCSV:this.getPayoutCSV,"onError-event":this.handleErrorEvent})}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_payout_details}
1
+ import{r as t,c as s,h as i}from"./p-fad19d75.js";import{m as o,P as r}from"./p-47dbe17d.js";import"./p-16d2932d.js";import"./p-56f6ce4c.js";import"./p-7fec2bcb.js";import{P as e}from"./p-9f56ad71.js";import{C as a,a as p}from"./p-14c91ffd.js";import{g as h,a as d}from"./p-8115b2f4.js";import{E as n}from"./p-a8b4f429.js";import{J as c}from"./p-9e7204b5.js";import{c as m}from"./p-b459d0b0.js";import"./p-0e180654.js";import"./p-5a62fca2.js";import"./p-22e38d5b.js";const u=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.payoutId=void 0,this.authToken=void 0,this.getPayout=void 0,this.getPayoutCSV=void 0,this.errorMessage=null}componentWillLoad(){m(),this.analytics=new c(this),this.initializeServices()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeServices()}initializeServices(){this.payoutId&&this.authToken?(this.getPayout=(({id:t,authToken:s,service:i})=>async({onSuccess:o,onError:r})=>{var p;try{const n=await i.fetchPayout(t,s);n.error?r({error:h(n.error),code:d(null===(p=n.error)||void 0===p?void 0:p.code),severity:a.ERROR}):o(new e(n.data))}catch(t){r({error:h(t),code:d(null==t?void 0:t.code),severity:a.ERROR})}})({id:this.payoutId,authToken:this.authToken,service:new r}),this.getPayoutCSV=o({authToken:this.authToken,service:new r})):(this.errorMessage="Failed to load payout details. payoutId or authToken is not provided.",this.errorEvent.emit({message:this.errorMessage,errorCode:p.MISSING_PROPS,severity:a.ERROR}))}render(){return this.errorMessage?n(this.errorMessage):i("payout-details-core",{getPayout:this.getPayout,getPayoutCSV:this.getPayoutCSV,"onError-event":this.handleErrorEvent})}static get watchers(){return{payoutId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_payout_details}
@@ -0,0 +1 @@
1
+ import{c as e,a as t}from"./p-3c654c07.js";import{l as n,k as s,m as a,n as r,q as o,u as i,v as l,e as c,p as d,x as m,y as p}from"./p-88efdd31.js";const u=i=>{const l=e({line1:n.required("Enter street address"),line2:s.nullable(),city:a.required("Enter city"),state:r.required("Select state"),postal_code:o.required("Enter postal code"),country:t().required("Select country")}),c=e({line1:n.nullable(),line2:s.nullable(),city:a.nullable(),state:r.nullable(),postal_code:o.nullable(),country:t().required("Select country")});return i?c:l},E=(n,s)=>{const a=e({name:i.required(`Enter ${n} name`),title:l.required(`Enter ${n} title`),email:c.required(`Enter ${n} email`),phone:d.required("Enter phone number"),dob_full:m(n).required("Enter date of birth"),ssn_last4:t().nullable(),identification_number:p,address:u(s)}),r=e({name:i.required(`Enter ${n} name`),title:l.nullable(),email:c.nullable(),phone:d.nullable(),dob_full:m(n).nullable(),ssn_last4:t().nullable(),identification_number:p.nullable(),address:u(s)});return s?r:a};export{u as a,E as i}
@@ -1 +1 @@
1
- import{r as s,c as t,h as e,H as i}from"./p-fad19d75.js";import{a,C as n}from"./p-14c91ffd.js";import{m as o,b as r}from"./p-5968ff8a.js";import{B as h}from"./p-f6f8dabc.js";import{c as d,F as c,e as u}from"./p-3c654c07.js";import{b as l,c as b,a as f}from"./p-a76ece26.js";import{z as p,A as m,u as v,B as y,C as g,D as k,E as _,F as w,G as j,H as T,I as C,J as S,K as O,L as x,M as I}from"./p-c65b78cf.js";import{c as A}from"./p-1815a43b.js";import{A as L}from"./p-0e180654.js";import"./p-16d2932d.js";import"./p-56f6ce4c.js";import"./p-7fec2bcb.js";import"./p-9f56ad71.js";import{c as F}from"./p-5a62fca2.js";import{n as B}from"./p-e3c22aa9.js";import{B as E}from"./p-5e7c60d8.js";import{S as D}from"./p-08b0fb31.js";import{B as H}from"./p-9c9c7dac.js";import"./p-8115b2f4.js";import"./p-6078a370.js";import"./p-1ff8810b.js";const P=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new h}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new h})):this.errorEvent.emit({message:"Missing required props",errorCode:a.MISSING_PROPS,severity:n.ERROR})}render(){return e("justifi-additional-questions-form-step-core",{key:"6ca8443cbe837d993be4381a9d650caaaf51f2df",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};class W{constructor(s){this.id=s.id,this.account_owner_name=s.account_owner_name,this.full_name=s.full_name,this.account_type=s.account_type,this.acct_last_four=s.acct_last_four,this.account_number_last4=s.account_number_last4,this.routing_number=s.routing_number,this.bank_name=s.bank_name,this.country=s.country,this.currency=s.currency,this.nickname=s.nickname,this.metadata=s.metadata,this.business_id=s.business_id,this.platform_account_id=s.platform_account_id,this.created_at=s.created_at,this.updated_at=s.updated_at}}const q=class{constructor(e){s(this,e),this.submitted=t(this,"submitted",7),this.stepCompleted=t(this,"form-step-completed",7),this.formLoading=t(this,"formLoading",7),this.errorEvent=t(this,"error-event",7),this.fetchData=async()=>{this.formLoading.emit(!0);try{const s=await this.api.get(this.businessEndpoint);this.bankAccount=Object.assign({},new W(s.data.bank_accounts.length>0?s.data.bank_accounts[0]:{})),this.formController.setInitialValues(Object.assign({},this.bankAccount))}catch(s){this.errorEvent.emit({errorCode:a.FETCH_ERROR,message:s.message,severity:n.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.sendData=async s=>{this.formLoading.emit(!0);try{const t=this.formController.values.getValue(),e=Object.assign(Object.assign({},t),{business_id:this.businessId}),i=await this.api.post(this.bankAccountEndpoint,e);this.handleResponse(i,s)}catch(s){this.errorEvent.emit({errorCode:a.POST_ERROR,message:s.message,severity:n.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.bankAccount=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}get businessEndpoint(){return`entities/business/${this.businessId}`}get bankAccountEndpoint(){return"entities/bank_accounts"}get formDisabled(){var s;return!!(null===(s=this.bankAccount)||void 0===s?void 0:s.id)}handleResponse(s,t){s.error?this.errorEvent.emit({errorCode:a.POST_ERROR,message:s.error.message,severity:n.ERROR,data:s.error}):t(),this.submitted.emit({data:s,metadata:{completedStep:l.bankAccount}}),this.stepCompleted.emit({data:s,formStep:b.bankAccount})}async validateAndSubmit({onSuccess:s}){this.formDisabled?(this.stepCompleted.emit({data:null,formStep:b.bankAccount,metadata:"no data submitted"}),s()):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentWillLoad(){this.formController=new c((s=>{const t=d({bank_name:p.required("Enter bank name"),nickname:m.required("Enter nickname"),account_owner_name:v.required("Enter account owner name"),account_type:y.required("Select account type"),account_number:g.required("Enter account number"),routing_number:k.required("Enter routing number")}),e=d({bank_name:p.nullable(),nickname:m.nullable(),account_owner_name:v.nullable(),account_type:y.nullable(),account_number:g.nullable(),routing_number:k.nullable()});return s?e:t})(this.allowOptionalFields)),this.api=L({authToken:this.authToken,apiOrigin:F.proxyApiOrigin}),this.businessId&&this.authToken&&this.fetchData()}componentDidLoad(){this.formController.values.subscribe((s=>this.bankAccount=Object.assign({},s))),this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){const s=this.formController.getInitialValues();return e("form",{key:"7ae39afd400c9bc2a86f75aeb2a529a36ecd849c"},e("fieldset",{key:"d01072ed3710acfbb7916de8ffb9fb80770750af"},e("div",{key:"75228827d492fcdbd603963a3574c1dca84530b4",class:"d-flex align-items-center gap-2"},e("legend",{key:"23600460d0b1486d3d4cd612bc9532ba30d5da0e",class:"mb-0"},"Bank Account Info"),e("form-control-tooltip",{key:"fed3ad0eef074985a25488a9c093b9eb0cbafabb",helpText:"The Direct Deposit Account is the business bank account where your funds will be deposited. The name of this account must match the registered business name exactly. We are not able to accept personal accounts unless your business is a registered sole proprietorship."})),e("hr",{key:"f7405cf23ee0a90d46f2c394d09ae421fe9472ee",class:"mt-2"}),e("div",{key:"4cc1d09daed6a897778440f69bd0a9dbd99c1270",class:"row gy-3"},e("div",{key:"f7e0e160adaf0925b4ea5ada12137dcf3e5c5d35",class:"col-12"},e("form-control-text",{key:"d7cbdb427b9bf332dd9da5885ccfc73d0dd4b40b",name:"bank_name",label:"Bank Name",defaultValue:s.bank_name,errorText:this.errors.bank_name,inputHandler:this.inputHandler,disabled:this.formDisabled})),e("div",{key:"010c5dd53d8d31f9edc4f0e7ca225c0d2c8a1e09",class:"col-12"},e("form-control-text",{key:"f524266d5fcd4e3e35539c130f6dfe742d620593",name:"nickname",label:"Nickname",defaultValue:s.nickname,errorText:this.errors.nickname,inputHandler:this.inputHandler,disabled:this.formDisabled})),e("div",{key:"1875fc9bb5e0741e1c2aff205effa030aafcd0e2",class:"col-12"},e("form-control-text",{key:"343754af2350ca668f39270513fa44be416834ba",name:"account_owner_name",label:"Account Owner Name",defaultValue:s.account_owner_name,errorText:this.errors.account_owner_name,inputHandler:this.inputHandler,disabled:this.formDisabled})),e("div",{key:"9870781e41bd5879ec161569a7b60ecc049690cc",class:"col-12"},e("form-control-select",{key:"1ade0e3e0f470e3165d227b67c9dd4054d8443fc",name:"account_type",label:"Account Type",options:A,defaultValue:s.account_type,errorText:this.errors.account_type,inputHandler:this.inputHandler,disabled:this.formDisabled})),e("div",{key:"c5e531aaded367bd825913cb100dd3225d1c6f61",class:"col-12"},e("form-control-text",{key:"39cd3bca5b86a0ca175c26be3982bc0e98953439",name:"account_number",label:"Account Number",defaultValue:s.account_number,maxLength:17,errorText:this.errors.account_number,inputHandler:this.inputHandler,keyDownHandler:B,disabled:this.formDisabled,helpText:"Please copy the account number as shown on your statement/check. Do not include spaces or dashes."})),e("div",{key:"8c3306dde7149b49d1ad6ba426634674e318b4fd",class:"col-12"},e("form-control-text",{key:"970305b04e9517f56bcb8217cd938b8971ca34b4",name:"routing_number",label:"Routing Number",defaultValue:s.routing_number,maxLength:9,errorText:this.errors.routing_number,inputHandler:this.inputHandler,keyDownHandler:B,disabled:this.formDisabled,helpText:"A valid routing number is nine digits. Please include any leading or trailing zeroes."})))))}},V=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new h}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new h})):this.errorEvent.emit({message:"Missing required props",errorCode:a.MISSING_PROPS,severity:n.ERROR})}render(){return e("justifi-business-core-info-form-step-core",{key:"8b034d8c728aef3683823a45083764a456d07545",businessId:this.businessId,getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},z=class{constructor(e){s(this,e),this.submitted=t(this,"submitted",7),this.stepCompleted=t(this,"form-step-completed",7),this.formLoading=t(this,"formLoading",7),this.errorEvent=t(this,"error-event",7),this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.fetchData=async()=>{this.renderState="loading",this.formLoading.emit(!0);try{const s=await this.api.get(this.businessEndpoint);this.business=Object.assign({},new E(s.data)),this.existingDocuments=s.data.documents,this.paymentVolume=s.data.additional_questions.business_payment_volume}catch(s){this.errorEvent.emit({errorCode:a.FETCH_ERROR,message:s.message,severity:n.ERROR,data:s}),this.renderState="error"}finally{this.initializeFormController(),this.formLoading.emit(!1),this.renderState="success"}},this.initializeFormController=()=>{this.formController=new c(((s,t,e)=>{const i=d({voided_check:_(t,e),government_id:w.nullable(),ss4:j.nullable(),other:T.nullable(),balance_sheet:C(s,t,e),bank_statement:S(s,t,e),profit_and_loss_statement:O(s,t,e)}),a=d({voided_check:_(t,e),government_id:w.nullable(),ss4:j.nullable(),other:T.nullable(),balance_sheet:C(s,t,e),bank_statement:S(s,t,e),profit_and_loss_statement:O(s,t,e)});return e?a:i})(this.paymentVolume,this.existingDocuments,this.allowOptionalFields)),this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))},this.createDocumentRecord=async s=>{this.formLoading.emit(!0);const t=s.record_data;try{const e=await this.api.post(this.documentEndpoint,t);return this.handleDocRecordResponse(s,e)}catch(s){return this.errorEvent.emit({errorCode:a.POST_ERROR,message:s.message,severity:n.ERROR,data:s}),!1}},this.handleDocRecordResponse=(s,t)=>t.error?(this.errorEvent.emit({errorCode:a.POST_ERROR,message:t.error.message,severity:n.ERROR,data:t.error}),!1):(s.setPresignedUrl(t.data.presigned_url),!0),this.uploadDocument=async s=>{if(!s.presigned_url)throw new Error("Presigned URL is not set");const t=await fetch(s.presigned_url,{method:"PUT",body:s.fileString});return this.handleUploadResponse(t)},this.handleUploadResponse=s=>s.error?(this.errorEvent.emit({errorCode:a.POST_ERROR,message:s.error.message,severity:n.ERROR,data:s.error}),!1):(this.submitted.emit({data:s,metadata:{completedStep:l.documentUpload}}),this.stepCompleted.emit({data:s,formStep:b.documentUpload}),!0),this.storeFiles=s=>{const t=Array.from(s.detail.fileList),e=s.detail.document_type,i=t.map((s=>new x({file:s,document_type:e},this.businessId)));this.documentData[e]=i},this.sendData=async s=>{try{const t=Object.values(this.documentData).flat();if(!t.length)return this.stepCompleted.emit({data:null,formStep:b.documentUpload,metadata:"no data submitted"}),s();const e=t.map((s=>this.createDocumentRecord(s)));if(!await Promise.all(e))return;const i=t.map((s=>this.uploadDocument(s)));if(!await Promise.all(i))return;await s()}finally{this.formLoading.emit(!1)}},this.formController=void 0,this.errors={},this.existingDocuments=[],this.paymentVolume=void 0,this.business=void 0,this.documentData=new I,this.renderState="loading",this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}get businessEndpoint(){return`entities/business/${this.businessId}`}get documentEndpoint(){return"entities/document"}componentWillLoad(){this.api=L({authToken:this.authToken,apiOrigin:F.proxyApiOrigin}),this.businessId&&this.authToken&&this.fetchData()}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get isLoading(){return"loading"===this.renderState}get isError(){return"error"===this.renderState}get documentsOnFile(){return this.isError?null:this.isLoading?e(D,{variant:"rounded",height:"50px"}):e("justifi-business-documents-on-file",{documents:this.existingDocuments})}get formInputs(){return this.isError?null:this.isLoading?e(D,{variant:"rounded",height:"350px"}):e("justifi-business-document-upload-input-group",{paymentVolume:this.paymentVolume,inputHandler:this.inputHandler,storeFiles:this.storeFiles,errors:this.errors})}render(){return e("form",{key:"5e0722b4d5ea462cf5ba6ed2de9d3a73b8bf910a"},e("fieldset",{key:"09f3589465a6ad53080743018a57b959bef68309"},e("div",{key:"b6c1aa4cf4754126b11902a8b35c19e3044ba4ed",class:"d-flex align-items-center gap-2"},e("legend",{key:"77b5d6847054afbfe6cc7e9e00762c226a582447",class:"mb-0"},"Document Uploads"),e("form-control-tooltip",{key:"9fb518fbad5039c77436377e26e420dc01a84ca2",helpText:"Various file formats such as PDF, DOC, DOCX, JPEG, and others are accepted. Multiple files can be uploaded for each document category."})),e("hr",{key:"e95938b42ad6d52d612bb654e39af7ee3442b454",class:"mt-2"}),this.documentsOnFile,e("div",{key:"8ee1cda96d28486faa2371bb1b82c57a57220071",class:"d-flex flex-column"},this.formInputs)))}},M=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new h}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new h})):this.errorEvent.emit({message:"Missing required props",errorCode:a.MISSING_PROPS,severity:n.ERROR})}render(){return e(i,{key:"31bd33a08c9eb4a849db8898b3ec7e6fede7b843"},e("justifi-business-owners-form-step-core",{key:"9e4c88686e1a5ebfd81ab5f1aebd21f58c4e6be5",authToken:this.authToken,businessId:this.businessId,getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s}))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},N=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new h}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new h})):this.errorEvent.emit({message:"Missing required props",errorCode:a.MISSING_PROPS,severity:n.ERROR})}render(){return e("justifi-business-representative-form-step-core",{key:"934b6204cfe78ffe17b3f975de3eedb64398168d",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},R=class{constructor(e){s(this,e),this.submitted=t(this,"submitted",7),this.stepCompleted=t(this,"form-step-completed",7),this.formLoading=t(this,"formLoading",7),this.errorEvent=t(this,"error-event",7),this.fetchData=async()=>{this.formLoading.emit(!0);try{const s=await this.api.get(this.businessEndpoint);this.acceptedTermsBefore=s.data.terms_conditions_accepted}catch(s){this.errorEvent.emit({errorCode:a.FETCH_ERROR,message:s.message,severity:n.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.sendData=async s=>{this.formLoading.emit(!0);try{const t=this.termsPayload,e=await this.api.post(this.termsConditionsEndpoint,t);this.handleResponse(e,s)}catch(s){this.errorEvent.emit({errorCode:a.POST_ERROR,message:s.message,severity:n.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.acceptedTermsBefore=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}get businessEndpoint(){return`entities/business/${this.businessId}`}get termsConditionsEndpoint(){return"entities/terms_and_conditions"}get formHelperText(){return this.acceptedTermsBefore?"You have already accepted the terms and conditions.":null}get termsPayload(){return{business_id:this.businessId,accepted:this.formController.values.getValue().accepted,user_agent:window.navigator.userAgent}}async componentWillLoad(){this.api=L({authToken:this.authToken,apiOrigin:F.proxyApiOrigin}),this.formController=new c((s=>{const t=d({accepted:u().oneOf([!0],"You must agree to the terms and conditions to continue").required("You must agree to the terms and conditions to continue")}),e=d({accepted:u().nullable()});return s?e:t})(this.allowOptionalFields)),this.businessId&&this.authToken&&this.fetchData()}handleResponse(s,t){s.error?this.errorEvent.emit({errorCode:a.POST_ERROR,message:s.error.message,severity:n.ERROR,data:s.error}):t(),this.submitted.emit({data:s,metadata:{completedStep:l.termsAndConditions}}),this.stepCompleted.emit({data:s,formStep:b.termsAndConditions})}async validateAndSubmit({onSuccess:s}){this.acceptedTermsBefore?(this.submitted.emit({metadata:{completedStep:l.termsAndConditions}}),s()):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){return e("form",{key:"e675f117eb90a0690e148a1164fffde5d4f01419"},e("fieldset",{key:"e1cb1fe38b7365cc282eb91689afb40d6b01136c"},e("legend",{key:"e57a4bc006983c3ee3805445d750ea330bedd477"},"Terms and Conditions"),e("hr",{key:"7b373693bd10d6493816b3dd9ae07d826bd7ff84"}),e("justifi-business-terms-conditions-text",{key:"984b3668240861df4947c60068c1be079a3eb7e1"}),e("br",{key:"15dfba53dd81d39be4ea216bf798f51881abf23d"}),e("div",{key:"b426c709c11435911efb4289b68fa8f86c2569f2",class:"row-gy-3"},e("div",{key:"307c51a7f78613807054a5d1480318fdb9316bff",class:"col-12"},e("form-control-checkbox",{key:"6069cb9929c7ea0f2c1b2cbc99dad61806c80429",name:"accepted",label:"I agree to the terms and conditions",inputHandler:this.inputHandler,errorText:this.errors.accepted,disabled:this.acceptedTermsBefore,helpText:this.formHelperText})))))}},U=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new h}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new h})):this.errorEvent.emit({message:"Missing required props",errorCode:a.MISSING_PROPS,severity:n.ERROR})}render(){return e("justifi-legal-address-form-step-core",{key:"06ac5acac2cc9c167a86448b0e12d885d21361fb",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},Y=class{constructor(t){s(this,t),this.currentStep=void 0,this.totalSteps=void 0,this.formLoading=void 0,this.formDisabled=void 0,this.previousStepButtonOnClick=void 0,this.nextStepButtonOnClick=void 0}get showPreviousStepButton(){return this.currentStep>0}get showNextStepButton(){return this.currentStep<this.totalSteps}get showSubmitButton(){return this.currentStep===this.totalSteps}render(){return e("div",{key:"3df3796f2bb35819373564c0002e35d14c85e360",class:"d-flex gap-2"},e(H,{key:"3f8fd4e288b2eed6776c77b44dda816e8a0580cd",variant:"secondary",type:"button",onClick:()=>this.previousStepButtonOnClick(),disabled:this.formDisabled,hidden:!this.showPreviousStepButton},"Previous"),e(H,{key:"83c7d2405d6e4f88f721a95250aa847a6999a211",variant:"primary",type:"button",onClick:s=>this.nextStepButtonOnClick(s,f.nextStep),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showNextStepButton},"Next"),e(H,{key:"d87bcdc9bea52b11307e31bd1d99636be05d7156",variant:"primary",type:"submit",onClick:s=>this.nextStepButtonOnClick(s,f.submit),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showSubmitButton},"Submit"))}},$=class{constructor(i){s(this,i),this.formCompleted=t(this,"formCompleted",7),this.componentStepMapping={0:()=>e("justifi-business-core-info-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[0]=s,allowOptionalFields:this.allowOptionalFields}),1:()=>e("justifi-legal-address-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[1]=s,allowOptionalFields:this.allowOptionalFields}),2:()=>e("justifi-additional-questions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[2]=s,allowOptionalFields:this.allowOptionalFields}),3:()=>e("justifi-business-representative-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[3]=s,allowOptionalFields:this.allowOptionalFields}),4:()=>e("justifi-business-owners-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[4]=s,allowOptionalFields:this.allowOptionalFields}),5:()=>e("justifi-business-bank-account-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[5]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields}),6:()=>e("justifi-business-document-upload-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[6]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields}),7:()=>e("justifi-business-terms-conditions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[7]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields,onSubmitted:()=>this.formCompleted.emit()})},this.businessId=void 0,this.authToken=void 0,this.refs=void 0,this.currentStep=void 0,this.allowOptionalFields=!1,this.handleFormLoading=void 0}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}render(){return e("div",{key:"8f02aa3223e38cda70319c127f60e5d2f3c5abe5",class:"col-12 mb-4"},this.currentStepComponent)}};export{P as justifi_additional_questions_form_step,q as justifi_business_bank_account_form_step,V as justifi_business_core_info_form_step,z as justifi_business_document_upload_form_step,M as justifi_business_owners_form_step,N as justifi_business_representative_form_step,R as justifi_business_terms_conditions_form_step,U as justifi_legal_address_form_step,Y as justifi_payment_provisioning_form_buttons,$ as justifi_payment_provisioning_form_steps}
1
+ import{r as s,c as t,h as e,H as i}from"./p-fad19d75.js";import{a,C as n}from"./p-14c91ffd.js";import{m as o,b as r}from"./p-5968ff8a.js";import{B as h}from"./p-f6f8dabc.js";import{c as d,F as c,e as u}from"./p-3c654c07.js";import{b as l,c as b,a as f}from"./p-a76ece26.js";import{z as p,A as m,u as v,B as y,C as g,D as k,E as _,F as w,G as j,H as T,I as C,J as S,K as O,L as x,M as I}from"./p-88efdd31.js";import{c as A}from"./p-1815a43b.js";import{A as L}from"./p-0e180654.js";import"./p-16d2932d.js";import"./p-56f6ce4c.js";import"./p-7fec2bcb.js";import"./p-9f56ad71.js";import{c as F}from"./p-5a62fca2.js";import{n as B}from"./p-e3c22aa9.js";import{B as E}from"./p-5e7c60d8.js";import{S as D}from"./p-08b0fb31.js";import{B as H}from"./p-9c9c7dac.js";import"./p-8115b2f4.js";import"./p-6078a370.js";import"./p-1ff8810b.js";const P=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new h}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new h})):this.errorEvent.emit({message:"Missing required props",errorCode:a.MISSING_PROPS,severity:n.ERROR})}render(){return e("justifi-additional-questions-form-step-core",{key:"6ca8443cbe837d993be4381a9d650caaaf51f2df",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}};class W{constructor(s){this.id=s.id,this.account_owner_name=s.account_owner_name,this.full_name=s.full_name,this.account_type=s.account_type,this.acct_last_four=s.acct_last_four,this.account_number_last4=s.account_number_last4,this.routing_number=s.routing_number,this.bank_name=s.bank_name,this.country=s.country,this.currency=s.currency,this.nickname=s.nickname,this.metadata=s.metadata,this.business_id=s.business_id,this.platform_account_id=s.platform_account_id,this.created_at=s.created_at,this.updated_at=s.updated_at}}const q=class{constructor(e){s(this,e),this.submitted=t(this,"submitted",7),this.stepCompleted=t(this,"form-step-completed",7),this.formLoading=t(this,"formLoading",7),this.errorEvent=t(this,"error-event",7),this.fetchData=async()=>{this.formLoading.emit(!0);try{const s=await this.api.get(this.businessEndpoint);this.bankAccount=Object.assign({},new W(s.data.bank_accounts.length>0?s.data.bank_accounts[0]:{})),this.formController.setInitialValues(Object.assign({},this.bankAccount))}catch(s){this.errorEvent.emit({errorCode:a.FETCH_ERROR,message:s.message,severity:n.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.sendData=async s=>{this.formLoading.emit(!0);try{const t=this.formController.values.getValue(),e=Object.assign(Object.assign({},t),{business_id:this.businessId}),i=await this.api.post(this.bankAccountEndpoint,e);this.handleResponse(i,s)}catch(s){this.errorEvent.emit({errorCode:a.POST_ERROR,message:s.message,severity:n.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.bankAccount=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}get businessEndpoint(){return`entities/business/${this.businessId}`}get bankAccountEndpoint(){return"entities/bank_accounts"}get formDisabled(){var s;return!!(null===(s=this.bankAccount)||void 0===s?void 0:s.id)}handleResponse(s,t){s.error?this.errorEvent.emit({errorCode:a.POST_ERROR,message:s.error.message,severity:n.ERROR,data:s.error}):t(),this.submitted.emit({data:s,metadata:{completedStep:l.bankAccount}}),this.stepCompleted.emit({data:s,formStep:b.bankAccount})}async validateAndSubmit({onSuccess:s}){this.formDisabled?(this.stepCompleted.emit({data:null,formStep:b.bankAccount,metadata:"no data submitted"}),s()):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentWillLoad(){this.formController=new c((s=>{const t=d({bank_name:p.required("Enter bank name"),nickname:m.required("Enter nickname"),account_owner_name:v.required("Enter account owner name"),account_type:y.required("Select account type"),account_number:g.required("Enter account number"),routing_number:k.required("Enter routing number")}),e=d({bank_name:p.nullable(),nickname:m.nullable(),account_owner_name:v.nullable(),account_type:y.nullable(),account_number:g.nullable(),routing_number:k.nullable()});return s?e:t})(this.allowOptionalFields)),this.api=L({authToken:this.authToken,apiOrigin:F.proxyApiOrigin}),this.businessId&&this.authToken&&this.fetchData()}componentDidLoad(){this.formController.values.subscribe((s=>this.bankAccount=Object.assign({},s))),this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){const s=this.formController.getInitialValues();return e("form",{key:"7ae39afd400c9bc2a86f75aeb2a529a36ecd849c"},e("fieldset",{key:"d01072ed3710acfbb7916de8ffb9fb80770750af"},e("div",{key:"75228827d492fcdbd603963a3574c1dca84530b4",class:"d-flex align-items-center gap-2"},e("legend",{key:"23600460d0b1486d3d4cd612bc9532ba30d5da0e",class:"mb-0"},"Bank Account Info"),e("form-control-tooltip",{key:"fed3ad0eef074985a25488a9c093b9eb0cbafabb",helpText:"The Direct Deposit Account is the business bank account where your funds will be deposited. The name of this account must match the registered business name exactly. We are not able to accept personal accounts unless your business is a registered sole proprietorship."})),e("hr",{key:"f7405cf23ee0a90d46f2c394d09ae421fe9472ee",class:"mt-2"}),e("div",{key:"4cc1d09daed6a897778440f69bd0a9dbd99c1270",class:"row gy-3"},e("div",{key:"f7e0e160adaf0925b4ea5ada12137dcf3e5c5d35",class:"col-12"},e("form-control-text",{key:"d7cbdb427b9bf332dd9da5885ccfc73d0dd4b40b",name:"bank_name",label:"Bank Name",defaultValue:s.bank_name,errorText:this.errors.bank_name,inputHandler:this.inputHandler,disabled:this.formDisabled})),e("div",{key:"010c5dd53d8d31f9edc4f0e7ca225c0d2c8a1e09",class:"col-12"},e("form-control-text",{key:"f524266d5fcd4e3e35539c130f6dfe742d620593",name:"nickname",label:"Nickname",defaultValue:s.nickname,errorText:this.errors.nickname,inputHandler:this.inputHandler,disabled:this.formDisabled})),e("div",{key:"1875fc9bb5e0741e1c2aff205effa030aafcd0e2",class:"col-12"},e("form-control-text",{key:"343754af2350ca668f39270513fa44be416834ba",name:"account_owner_name",label:"Account Owner Name",defaultValue:s.account_owner_name,errorText:this.errors.account_owner_name,inputHandler:this.inputHandler,disabled:this.formDisabled})),e("div",{key:"9870781e41bd5879ec161569a7b60ecc049690cc",class:"col-12"},e("form-control-select",{key:"1ade0e3e0f470e3165d227b67c9dd4054d8443fc",name:"account_type",label:"Account Type",options:A,defaultValue:s.account_type,errorText:this.errors.account_type,inputHandler:this.inputHandler,disabled:this.formDisabled})),e("div",{key:"c5e531aaded367bd825913cb100dd3225d1c6f61",class:"col-12"},e("form-control-text",{key:"39cd3bca5b86a0ca175c26be3982bc0e98953439",name:"account_number",label:"Account Number",defaultValue:s.account_number,maxLength:17,errorText:this.errors.account_number,inputHandler:this.inputHandler,keyDownHandler:B,disabled:this.formDisabled,helpText:"Please copy the account number as shown on your statement/check. Do not include spaces or dashes."})),e("div",{key:"8c3306dde7149b49d1ad6ba426634674e318b4fd",class:"col-12"},e("form-control-text",{key:"970305b04e9517f56bcb8217cd938b8971ca34b4",name:"routing_number",label:"Routing Number",defaultValue:s.routing_number,maxLength:9,errorText:this.errors.routing_number,inputHandler:this.inputHandler,keyDownHandler:B,disabled:this.formDisabled,helpText:"A valid routing number is nine digits. Please include any leading or trailing zeroes."})))))}},V=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new h}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new h})):this.errorEvent.emit({message:"Missing required props",errorCode:a.MISSING_PROPS,severity:n.ERROR})}render(){return e("justifi-business-core-info-form-step-core",{key:"8b034d8c728aef3683823a45083764a456d07545",businessId:this.businessId,getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},z=class{constructor(e){s(this,e),this.submitted=t(this,"submitted",7),this.stepCompleted=t(this,"form-step-completed",7),this.formLoading=t(this,"formLoading",7),this.errorEvent=t(this,"error-event",7),this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.fetchData=async()=>{this.renderState="loading",this.formLoading.emit(!0);try{const s=await this.api.get(this.businessEndpoint);this.business=Object.assign({},new E(s.data)),this.existingDocuments=s.data.documents,this.paymentVolume=s.data.additional_questions.business_payment_volume}catch(s){this.errorEvent.emit({errorCode:a.FETCH_ERROR,message:s.message,severity:n.ERROR,data:s}),this.renderState="error"}finally{this.initializeFormController(),this.formLoading.emit(!1),this.renderState="success"}},this.initializeFormController=()=>{this.formController=new c(((s,t,e)=>{const i=d({voided_check:_(t,e),government_id:w.nullable(),ss4:j.nullable(),other:T.nullable(),balance_sheet:C(s,t,e),bank_statement:S(s,t,e),profit_and_loss_statement:O(s,t,e)}),a=d({voided_check:_(t,e),government_id:w.nullable(),ss4:j.nullable(),other:T.nullable(),balance_sheet:C(s,t,e),bank_statement:S(s,t,e),profit_and_loss_statement:O(s,t,e)});return e?a:i})(this.paymentVolume,this.existingDocuments,this.allowOptionalFields)),this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))},this.createDocumentRecord=async s=>{this.formLoading.emit(!0);const t=s.record_data;try{const e=await this.api.post(this.documentEndpoint,t);return this.handleDocRecordResponse(s,e)}catch(s){return this.errorEvent.emit({errorCode:a.POST_ERROR,message:s.message,severity:n.ERROR,data:s}),!1}},this.handleDocRecordResponse=(s,t)=>t.error?(this.errorEvent.emit({errorCode:a.POST_ERROR,message:t.error.message,severity:n.ERROR,data:t.error}),!1):(s.setPresignedUrl(t.data.presigned_url),!0),this.uploadDocument=async s=>{if(!s.presigned_url)throw new Error("Presigned URL is not set");const t=await fetch(s.presigned_url,{method:"PUT",body:s.fileString});return this.handleUploadResponse(t)},this.handleUploadResponse=s=>s.error?(this.errorEvent.emit({errorCode:a.POST_ERROR,message:s.error.message,severity:n.ERROR,data:s.error}),!1):(this.submitted.emit({data:s,metadata:{completedStep:l.documentUpload}}),this.stepCompleted.emit({data:s,formStep:b.documentUpload}),!0),this.storeFiles=s=>{const t=Array.from(s.detail.fileList),e=s.detail.document_type,i=t.map((s=>new x({file:s,document_type:e},this.businessId)));this.documentData[e]=i},this.sendData=async s=>{try{const t=Object.values(this.documentData).flat();if(!t.length)return this.stepCompleted.emit({data:null,formStep:b.documentUpload,metadata:"no data submitted"}),s();const e=t.map((s=>this.createDocumentRecord(s)));if(!await Promise.all(e))return;const i=t.map((s=>this.uploadDocument(s)));if(!await Promise.all(i))return;await s()}finally{this.formLoading.emit(!1)}},this.formController=void 0,this.errors={},this.existingDocuments=[],this.paymentVolume=void 0,this.business=void 0,this.documentData=new I,this.renderState="loading",this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}get businessEndpoint(){return`entities/business/${this.businessId}`}get documentEndpoint(){return"entities/document"}componentWillLoad(){this.api=L({authToken:this.authToken,apiOrigin:F.proxyApiOrigin}),this.businessId&&this.authToken&&this.fetchData()}async validateAndSubmit({onSuccess:s}){this.formController.validateAndSubmit((()=>this.sendData(s)))}get isLoading(){return"loading"===this.renderState}get isError(){return"error"===this.renderState}get documentsOnFile(){return this.isError?null:this.isLoading?e(D,{variant:"rounded",height:"50px"}):e("justifi-business-documents-on-file",{documents:this.existingDocuments})}get formInputs(){return this.isError?null:this.isLoading?e(D,{variant:"rounded",height:"350px"}):e("justifi-business-document-upload-input-group",{paymentVolume:this.paymentVolume,inputHandler:this.inputHandler,storeFiles:this.storeFiles,errors:this.errors})}render(){return e("form",{key:"5e0722b4d5ea462cf5ba6ed2de9d3a73b8bf910a"},e("fieldset",{key:"09f3589465a6ad53080743018a57b959bef68309"},e("div",{key:"b6c1aa4cf4754126b11902a8b35c19e3044ba4ed",class:"d-flex align-items-center gap-2"},e("legend",{key:"77b5d6847054afbfe6cc7e9e00762c226a582447",class:"mb-0"},"Document Uploads"),e("form-control-tooltip",{key:"9fb518fbad5039c77436377e26e420dc01a84ca2",helpText:"Various file formats such as PDF, DOC, DOCX, JPEG, and others are accepted. Multiple files can be uploaded for each document category."})),e("hr",{key:"e95938b42ad6d52d612bb654e39af7ee3442b454",class:"mt-2"}),this.documentsOnFile,e("div",{key:"8ee1cda96d28486faa2371bb1b82c57a57220071",class:"d-flex flex-column"},this.formInputs)))}},M=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new h}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new h})):this.errorEvent.emit({message:"Missing required props",errorCode:a.MISSING_PROPS,severity:n.ERROR})}render(){return e(i,{key:"31bd33a08c9eb4a849db8898b3ec7e6fede7b843"},e("justifi-business-owners-form-step-core",{key:"9e4c88686e1a5ebfd81ab5f1aebd21f58c4e6be5",authToken:this.authToken,businessId:this.businessId,getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s}))}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},N=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new h}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new h})):this.errorEvent.emit({message:"Missing required props",errorCode:a.MISSING_PROPS,severity:n.ERROR})}render(){return e("justifi-business-representative-form-step-core",{key:"934b6204cfe78ffe17b3f975de3eedb64398168d",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},R=class{constructor(e){s(this,e),this.submitted=t(this,"submitted",7),this.stepCompleted=t(this,"form-step-completed",7),this.formLoading=t(this,"formLoading",7),this.errorEvent=t(this,"error-event",7),this.fetchData=async()=>{this.formLoading.emit(!0);try{const s=await this.api.get(this.businessEndpoint);this.acceptedTermsBefore=s.data.terms_conditions_accepted}catch(s){this.errorEvent.emit({errorCode:a.FETCH_ERROR,message:s.message,severity:n.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.sendData=async s=>{this.formLoading.emit(!0);try{const t=this.termsPayload,e=await this.api.post(this.termsConditionsEndpoint,t);this.handleResponse(e,s)}catch(s){this.errorEvent.emit({errorCode:a.POST_ERROR,message:s.message,severity:n.ERROR,data:s})}finally{this.formLoading.emit(!1)}},this.inputHandler=(s,t)=>{this.formController.setValues(Object.assign(Object.assign({},this.formController.values.getValue()),{[s]:t}))},this.formController=void 0,this.errors={},this.acceptedTermsBefore=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}get businessEndpoint(){return`entities/business/${this.businessId}`}get termsConditionsEndpoint(){return"entities/terms_and_conditions"}get formHelperText(){return this.acceptedTermsBefore?"You have already accepted the terms and conditions.":null}get termsPayload(){return{business_id:this.businessId,accepted:this.formController.values.getValue().accepted,user_agent:window.navigator.userAgent}}async componentWillLoad(){this.api=L({authToken:this.authToken,apiOrigin:F.proxyApiOrigin}),this.formController=new c((s=>{const t=d({accepted:u().oneOf([!0],"You must agree to the terms and conditions to continue").required("You must agree to the terms and conditions to continue")}),e=d({accepted:u().nullable()});return s?e:t})(this.allowOptionalFields)),this.businessId&&this.authToken&&this.fetchData()}handleResponse(s,t){s.error?this.errorEvent.emit({errorCode:a.POST_ERROR,message:s.error.message,severity:n.ERROR,data:s.error}):t(),this.submitted.emit({data:s,metadata:{completedStep:l.termsAndConditions}}),this.stepCompleted.emit({data:s,formStep:b.termsAndConditions})}async validateAndSubmit({onSuccess:s}){this.acceptedTermsBefore?(this.submitted.emit({metadata:{completedStep:l.termsAndConditions}}),s()):this.formController.validateAndSubmit((()=>this.sendData(s)))}componentDidLoad(){this.formController.errors.subscribe((s=>{this.errors=Object.assign({},s)}))}render(){return e("form",{key:"e675f117eb90a0690e148a1164fffde5d4f01419"},e("fieldset",{key:"e1cb1fe38b7365cc282eb91689afb40d6b01136c"},e("legend",{key:"e57a4bc006983c3ee3805445d750ea330bedd477"},"Terms and Conditions"),e("hr",{key:"7b373693bd10d6493816b3dd9ae07d826bd7ff84"}),e("justifi-business-terms-conditions-text",{key:"984b3668240861df4947c60068c1be079a3eb7e1"}),e("br",{key:"15dfba53dd81d39be4ea216bf798f51881abf23d"}),e("div",{key:"b426c709c11435911efb4289b68fa8f86c2569f2",class:"row-gy-3"},e("div",{key:"307c51a7f78613807054a5d1480318fdb9316bff",class:"col-12"},e("form-control-checkbox",{key:"6069cb9929c7ea0f2c1b2cbc99dad61806c80429",name:"accepted",label:"I agree to the terms and conditions",inputHandler:this.inputHandler,errorText:this.errors.accepted,disabled:this.acceptedTermsBefore,helpText:this.formHelperText})))))}},U=class{constructor(e){s(this,e),this.errorEvent=t(this,"error-event",7),this.getBusiness=void 0,this.patchBusiness=void 0,this.authToken=void 0,this.businessId=void 0,this.allowOptionalFields=void 0}propChanged(){this.initializeApi()}async validateAndSubmit({onSuccess:s}){this.coreComponent.validateAndSubmit({onSuccess:s})}componentWillLoad(){this.initializeApi()}initializeApi(){this.authToken&&this.businessId?(this.getBusiness=o({authToken:this.authToken,businessId:this.businessId,service:new h}),this.patchBusiness=r({authToken:this.authToken,businessId:this.businessId,service:new h})):this.errorEvent.emit({message:"Missing required props",errorCode:a.MISSING_PROPS,severity:n.ERROR})}render(){return e("justifi-legal-address-form-step-core",{key:"06ac5acac2cc9c167a86448b0e12d885d21361fb",getBusiness:this.getBusiness,patchBusiness:this.patchBusiness,allowOptionalFields:this.allowOptionalFields,ref:s=>this.coreComponent=s})}static get watchers(){return{authToken:["propChanged"],businessId:["propChanged"]}}},Y=class{constructor(t){s(this,t),this.currentStep=void 0,this.totalSteps=void 0,this.formLoading=void 0,this.formDisabled=void 0,this.previousStepButtonOnClick=void 0,this.nextStepButtonOnClick=void 0}get showPreviousStepButton(){return this.currentStep>0}get showNextStepButton(){return this.currentStep<this.totalSteps}get showSubmitButton(){return this.currentStep===this.totalSteps}render(){return e("div",{key:"3df3796f2bb35819373564c0002e35d14c85e360",class:"d-flex gap-2"},e(H,{key:"3f8fd4e288b2eed6776c77b44dda816e8a0580cd",variant:"secondary",type:"button",onClick:()=>this.previousStepButtonOnClick(),disabled:this.formDisabled,hidden:!this.showPreviousStepButton},"Previous"),e(H,{key:"83c7d2405d6e4f88f721a95250aa847a6999a211",variant:"primary",type:"button",onClick:s=>this.nextStepButtonOnClick(s,f.nextStep),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showNextStepButton},"Next"),e(H,{key:"d87bcdc9bea52b11307e31bd1d99636be05d7156",variant:"primary",type:"submit",onClick:s=>this.nextStepButtonOnClick(s,f.submit),disabled:this.formDisabled,isLoading:this.formLoading,hidden:!this.showSubmitButton},"Submit"))}},$=class{constructor(i){s(this,i),this.formCompleted=t(this,"formCompleted",7),this.componentStepMapping={0:()=>e("justifi-business-core-info-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[0]=s,allowOptionalFields:this.allowOptionalFields}),1:()=>e("justifi-legal-address-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[1]=s,allowOptionalFields:this.allowOptionalFields}),2:()=>e("justifi-additional-questions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[2]=s,allowOptionalFields:this.allowOptionalFields}),3:()=>e("justifi-business-representative-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[3]=s,allowOptionalFields:this.allowOptionalFields}),4:()=>e("justifi-business-owners-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[4]=s,allowOptionalFields:this.allowOptionalFields}),5:()=>e("justifi-business-bank-account-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[5]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields}),6:()=>e("justifi-business-document-upload-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[6]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields}),7:()=>e("justifi-business-terms-conditions-form-step",{businessId:this.businessId,authToken:this.authToken,ref:s=>this.refs[7]=s,onFormLoading:this.handleFormLoading,allowOptionalFields:this.allowOptionalFields,onSubmitted:()=>this.formCompleted.emit()})},this.businessId=void 0,this.authToken=void 0,this.refs=void 0,this.currentStep=void 0,this.allowOptionalFields=!1,this.handleFormLoading=void 0}get currentStepComponent(){return this.componentStepMapping[this.currentStep]()}render(){return e("div",{key:"8f02aa3223e38cda70319c127f60e5d2f3c5abe5",class:"col-12 mb-4"},this.currentStepComponent)}};export{P as justifi_additional_questions_form_step,q as justifi_business_bank_account_form_step,V as justifi_business_core_info_form_step,z as justifi_business_document_upload_form_step,M as justifi_business_owners_form_step,N as justifi_business_representative_form_step,R as justifi_business_terms_conditions_form_step,U as justifi_legal_address_form_step,Y as justifi_payment_provisioning_form_buttons,$ as justifi_payment_provisioning_form_steps}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i}from"./p-fad19d75.js";import{P as e}from"./p-fc4de0d2.js";import"./p-16d2932d.js";import"./p-56f6ce4c.js";import{P as r}from"./p-7fec2bcb.js";import"./p-9f56ad71.js";import{C as o,a}from"./p-14c91ffd.js";import{g as n,a as p}from"./p-8115b2f4.js";import{E as h}from"./p-a8b4f429.js";import{J as d}from"./p-56bda985.js";import{c}from"./p-e7d6609d.js";import"./p-0e180654.js";import"./p-5a62fca2.js";import"./p-c1cf7d5b.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.paymentService=new e,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.paymentId=void 0,this.authToken=void 0,this.getPaymentDetails=void 0,this.errorMessage=null}componentWillLoad(){c(),this.analytics=new d(this),this.initializeGetPaymentDetails()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=(({id:t,authToken:s,service:i})=>async({onSuccess:e,onError:a})=>{var h;try{const d=await i.fetchPayment(t,s);d.error?a({error:n(d.error),code:p(null===(h=d.error)||void 0===h?void 0:h.code),severity:o.ERROR}):e({payment:new r(d.data)})}catch(t){const s=p(null==t?void 0:t.code);a({error:n(t),code:s,severity:o.ERROR})}})({id:this.paymentId,authToken:this.authToken,service:new e}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:a.MISSING_PROPS,severity:o.ERROR}))}render(){return this.errorMessage?h(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_payment_details}
1
+ import{r as t,c as s,h as i}from"./p-fad19d75.js";import{P as e}from"./p-fc4de0d2.js";import"./p-16d2932d.js";import"./p-56f6ce4c.js";import{P as r}from"./p-7fec2bcb.js";import"./p-9f56ad71.js";import{C as o,a}from"./p-14c91ffd.js";import{g as n,a as p}from"./p-8115b2f4.js";import{E as h}from"./p-a8b4f429.js";import{J as d}from"./p-9e7204b5.js";import{c}from"./p-b459d0b0.js";import"./p-0e180654.js";import"./p-5a62fca2.js";import"./p-22e38d5b.js";const m=class{constructor(i){t(this,i),this.errorEvent=s(this,"error-event",7),this.paymentService=new e,this.handleErrorEvent=t=>{this.errorMessage=t.detail.message,this.errorEvent.emit(t.detail)},this.paymentId=void 0,this.authToken=void 0,this.getPaymentDetails=void 0,this.errorMessage=null}componentWillLoad(){c(),this.analytics=new d(this),this.initializeGetPaymentDetails()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetPaymentDetails()}initializeGetPaymentDetails(){this.paymentId&&this.authToken?this.getPaymentDetails=(({id:t,authToken:s,service:i})=>async({onSuccess:e,onError:a})=>{var h;try{const d=await i.fetchPayment(t,s);d.error?a({error:n(d.error),code:p(null===(h=d.error)||void 0===h?void 0:h.code),severity:o.ERROR}):e({payment:new r(d.data)})}catch(t){const s=p(null==t?void 0:t.code);a({error:n(t),code:s,severity:o.ERROR})}})({id:this.paymentId,authToken:this.authToken,service:new e}):(this.errorMessage="Payment ID and Auth Token are required",this.errorEvent.emit({message:this.errorMessage,errorCode:a.MISSING_PROPS,severity:o.ERROR}))}render(){return this.errorMessage?h(this.errorMessage):i("payment-details-core",{getPaymentDetails:this.getPaymentDetails,"onError-event":this.handleErrorEvent})}static get watchers(){return{paymentId:["propChanged"],authToken:["propChanged"]}}};export{m as justifi_payment_details}
@@ -1 +1 @@
1
- import{p as t}from"./p-c1cf7d5b.js";import{c as i}from"./p-5a62fca2.js";import{A as s}from"./p-0e180654.js";class e{async record(t){return s({apiOrigin:i.proxyApiOrigin}).post("analytics",t)}}class r{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents()}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submitted","error-event"],this.eventEmitters.forEach((t=>{"function"==typeof this.componentInstance.addEventListener&&this.componentInstance.addEventListener(t,(i=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),{error:i.detail})})))}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventEmitters.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}export{r as J}
1
+ import{p as t}from"./p-22e38d5b.js";import{c as i}from"./p-5a62fca2.js";import{A as s}from"./p-0e180654.js";class e{async record(t){return s({apiOrigin:i.proxyApiOrigin}).post("analytics",t)}}class r{constructor(t){this.handleCustomEvent=async t=>{await this.service.record(t)},this.service=new e,this.componentInstance=t,this.setUpBasicData(),this.setupLifecycleTracking(),this.trackCustomEvents()}get resourceId(){return this.componentInstance.accountId||this.componentInstance.businessId||this.componentInstance.paymentId||this.componentInstance.payoutId||this.componentInstance.checkoutId}setUpBasicData(){this.basicData={component_name:this.componentInstance.tagName,component_version:t.version,client_user_agent:navigator.userAgent,client_platform:navigator.userAgent,client_origin:window.location.origin,resource_id:this.resourceId}}trackCustomEvents(){this.eventEmitters=["submitted","error-event"],this.eventEmitters.forEach((t=>{"function"==typeof this.componentInstance.addEventListener&&this.componentInstance.addEventListener(t,(i=>this.handleCustomEvent({event_type:t,data:Object.assign(Object.assign({},this.basicData),{error:i.detail})})))}))}setupLifecycleTracking(){const t=this.componentInstance.componentDidLoad;this.componentInstance.componentDidLoad=()=>{if(this.service.record({event_type:"init",data:this.basicData}),t)return t.apply(this.componentInstance)}}cleanup(){this.eventEmitters.forEach((t=>{this.componentInstance.removeEventListener(t,this.handleCustomEvent)}))}}export{r as J}
@@ -1 +1 @@
1
- import{r as e,c as t,h as r}from"./p-fad19d75.js";import{c as a}from"./p-5a62fca2.js";import{J as i}from"./p-56bda985.js";import"./p-c1cf7d5b.js";import"./p-0e180654.js";const o=class{constructor(r){e(this,r),this.cardFormReady=t(this,"cardFormReady",7),this.ready=t(this,"ready",7),this.cardFormTokenized=t(this,"cardFormTokenize",7),this.cardFormValidated=t(this,"cardFormValidate",7),this.validationMode=void 0,this.iframeOrigin=a.iframeOrigin,this.singleLine=!1,this.internalStyleOverrides=void 0}readyHandler(e){console.warn("The 'cardFormReady' event is deprecated in the next major release and will be renamed to 'ready'"),this.cardFormReady.emit(e),this.ready.emit(e)}tokenizeHandler(e){console.warn("The 'cardFormTokenize' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future."),this.cardFormTokenized.emit(e)}validateHandler(e){console.warn("The 'cardFormValidate' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future."),this.cardFormValidated.emit(e)}componentWillLoad(){this.analytics=new i(this)}disconnectedCallback(){this.analytics.cleanup()}async tokenize(...e){if(!this.childRef)throw new Error("Cannot call tokenize");return this.childRef.tokenize(...e)}async validate(){if(!this.childRef)throw new Error("Cannot call validate");return this.childRef.validate()}async resize(){if(console.warn("The 'resize' method is deprecated and will be removed in the next major release. Please refer to the documentation for the migration process and alternative approach."),!this.childRef)throw new Error("Cannot call validate");return this.childRef.resize()}render(){return r("justifi-payment-method-form",{key:"e31d3c703e1a0c3778ddeb88d118ea3ef88d0adf",ref:e=>{e&&(this.childRef=e)},"iframe-origin":this.iframeOrigin,"payment-method-form-type":"card","single-line":this.singleLine,"payment-method-form-ready":this.cardFormReady,"payment-method-form-validate":this.cardFormValidated,"payment-method-form-tokenize":this.cardFormTokenized,"payment-method-form-validation-mode":this.validationMode||"onSubmit"})}};export{o as justifi_card_form}
1
+ import{r as e,c as t,h as r}from"./p-fad19d75.js";import{c as a}from"./p-5a62fca2.js";import{J as i}from"./p-9e7204b5.js";import"./p-22e38d5b.js";import"./p-0e180654.js";const o=class{constructor(r){e(this,r),this.cardFormReady=t(this,"cardFormReady",7),this.ready=t(this,"ready",7),this.cardFormTokenized=t(this,"cardFormTokenize",7),this.cardFormValidated=t(this,"cardFormValidate",7),this.validationMode=void 0,this.iframeOrigin=a.iframeOrigin,this.singleLine=!1,this.internalStyleOverrides=void 0}readyHandler(e){console.warn("The 'cardFormReady' event is deprecated in the next major release and will be renamed to 'ready'"),this.cardFormReady.emit(e),this.ready.emit(e)}tokenizeHandler(e){console.warn("The 'cardFormTokenize' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future."),this.cardFormTokenized.emit(e)}validateHandler(e){console.warn("The 'cardFormValidate' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future."),this.cardFormValidated.emit(e)}componentWillLoad(){this.analytics=new i(this)}disconnectedCallback(){this.analytics.cleanup()}async tokenize(...e){if(!this.childRef)throw new Error("Cannot call tokenize");return this.childRef.tokenize(...e)}async validate(){if(!this.childRef)throw new Error("Cannot call validate");return this.childRef.validate()}async resize(){if(console.warn("The 'resize' method is deprecated and will be removed in the next major release. Please refer to the documentation for the migration process and alternative approach."),!this.childRef)throw new Error("Cannot call validate");return this.childRef.resize()}render(){return r("justifi-payment-method-form",{key:"e31d3c703e1a0c3778ddeb88d118ea3ef88d0adf",ref:e=>{e&&(this.childRef=e)},"iframe-origin":this.iframeOrigin,"payment-method-form-type":"card","single-line":this.singleLine,"payment-method-form-ready":this.cardFormReady,"payment-method-form-validate":this.cardFormValidated,"payment-method-form-tokenize":this.cardFormTokenized,"payment-method-form-validation-mode":this.validationMode||"onSubmit"})}};export{o as justifi_card_form}
@@ -1 +1 @@
1
- import{r as s,c as t,h as r}from"./p-fad19d75.js";import{c as o}from"./p-5a62fca2.js";import{A as i}from"./p-0e180654.js";import{C as e,a}from"./p-14c91ffd.js";import{g as n,a as h}from"./p-8115b2f4.js";import{E as c}from"./p-a8b4f429.js";import{J as p}from"./p-56bda985.js";import{c as d}from"./p-e7d6609d.js";import"./p-c1cf7d5b.js";class m{async fetchGrossVolumeChartData(s,t){return i({authToken:t,apiOrigin:o.proxyApiOrigin}).get(`account/${s}/reports/gross_volume`)}}const u=class{constructor(r){s(this,r),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)},this.accountId=void 0,this.authToken=void 0,this.getGrossPayment=void 0,this.errorMessage=null}componentWillLoad(){d(),this.analytics=new p(this),this.initializeGetGrossPayment()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetGrossPayment()}initializeGetGrossPayment(){this.accountId&&this.authToken?this.getGrossPayment=(({id:s,authToken:t,service:r})=>async({onSuccess:o,onError:i})=>{var a;try{const c=await r.fetchGrossVolumeChartData(s,t);c.error?i({error:n(c.error),code:h(null===(a=c.error)||void 0===a?void 0:a.code),severity:e.ERROR}):o(c.data)}catch(s){const t=h(null==s?void 0:s.code);i({error:n(s),code:t,severity:e.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new m}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:a.MISSING_PROPS,message:this.errorMessage,severity:e.ERROR}))}render(){return this.errorMessage?c(this.errorMessage):r("gross-payment-chart-core",{getGrossPayment:this.getGrossPayment,"onError-event":this.handleErrorEvent})}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_gross_payment_chart}
1
+ import{r as s,c as t,h as r}from"./p-fad19d75.js";import{c as o}from"./p-5a62fca2.js";import{A as e}from"./p-0e180654.js";import{C as i,a}from"./p-14c91ffd.js";import{g as n,a as h}from"./p-8115b2f4.js";import{E as c}from"./p-a8b4f429.js";import{J as p}from"./p-9e7204b5.js";import{c as d}from"./p-b459d0b0.js";import"./p-22e38d5b.js";class m{async fetchGrossVolumeChartData(s,t){return e({authToken:t,apiOrigin:o.proxyApiOrigin}).get(`account/${s}/reports/gross_volume`)}}const u=class{constructor(r){s(this,r),this.errorEvent=t(this,"error-event",7),this.handleErrorEvent=s=>{this.errorMessage=s.detail.message,this.errorEvent.emit(s.detail)},this.accountId=void 0,this.authToken=void 0,this.getGrossPayment=void 0,this.errorMessage=null}componentWillLoad(){d(),this.analytics=new p(this),this.initializeGetGrossPayment()}disconnectedCallback(){this.analytics.cleanup()}propChanged(){this.initializeGetGrossPayment()}initializeGetGrossPayment(){this.accountId&&this.authToken?this.getGrossPayment=(({id:s,authToken:t,service:r})=>async({onSuccess:o,onError:e})=>{var a;try{const c=await r.fetchGrossVolumeChartData(s,t);c.error?e({error:n(c.error),code:h(null===(a=c.error)||void 0===a?void 0:a.code),severity:i.ERROR}):o(c.data)}catch(s){const t=h(null==s?void 0:s.code);e({error:n(s),code:t,severity:i.ERROR})}})({id:this.accountId,authToken:this.authToken,service:new m}):(this.errorMessage="Account ID and Auth Token are required",this.errorEvent.emit({errorCode:a.MISSING_PROPS,message:this.errorMessage,severity:i.ERROR}))}render(){return this.errorMessage?c(this.errorMessage):r("gross-payment-chart-core",{getGrossPayment:this.getGrossPayment,"onError-event":this.handleErrorEvent})}static get watchers(){return{accountId:["propChanged"],authToken:["propChanged"]}}};export{u as justifi_gross_payment_chart}
@@ -0,0 +1 @@
1
+ class t{get columnData(){return this.columnKeys.map((t=>this.tableColumns[t]()))}get rowData(){return this.collection.map((t=>this.columnKeys.map((s=>this.tableCells[s](t[s])))))}set collectionData(t){this.collection=t}constructor(t,s,i,h){this.columnKeys=s.split(","),this.collection=t,this.tableColumns=i,this.tableCells=h}}export{t as T}
@@ -1 +1 @@
1
- import{p as t}from"./p-c1cf7d5b.js";const s=async()=>{const s=t.version,a=t.name,e=await(async t=>{const s=await fetch("https://registry.npmjs.org/"+t+"/latest");return(await s.json()).version})(a),c=e.replace(/-rc.*/,""),o=s.split("."),r=e.split(".");o[0]!==r[0]&&console.warn(`The package ${a} is out of date. The latest version is ${c}. Please update.`)};export{s as c}
1
+ import{p as t}from"./p-22e38d5b.js";const s=async()=>{const s=t.version,a=t.name,e=await(async t=>{const s=await fetch("https://registry.npmjs.org/"+t+"/latest");return(await s.json()).version})(a),o=e.replace(/-rc.*/,""),c=s.split("."),r=e.split(".");c[0]!==r[0]&&console.warn(`The package ${a} is out of date. The latest version is ${o}. Please update.`)};export{s as c}
@@ -0,0 +1 @@
1
+ import{r as t,c as s,h as e}from"./p-fad19d75.js";import"./p-16d2932d.js";import{p as a}from"./p-56f6ce4c.js";import"./p-7fec2bcb.js";import"./p-9f56ad71.js";import{T as i,a as r,b as c}from"./p-e333620e.js";import{o as h}from"./p-2c51d29f.js";import{t as o,a as d}from"./p-8e228e5a.js";import{T as n}from"./p-b16269d7.js";const b=class{constructor(e){t(this,e),this.rowClicked=s(this,"terminal-row-clicked",7),this.errorEvent=s(this,"error-event",7),this.handleClickPrevious=t=>{const s=Object.assign({},this.params);delete s.after_cursor,this.params=Object.assign(Object.assign({},s),{before_cursor:t})},this.handleClickNext=t=>{const s=Object.assign({},this.params);delete s.before_cursor,this.params=Object.assign(Object.assign({},s),{after_cursor:t})},this.rowClickHandler=t=>{const s=t.target.closest("tr").dataset.rowEntityId;s&&this.rowClicked.emit(this.terminals.find((t=>t.id===s)))},this.setParamsOnChange=(t,s)=>{this.params=h({[t]:s},this.params)},this.clearParams=()=>{this.errorMessage="",this.params={}},this.getTerminals=void 0,this.getSubAccounts=void 0,this.columns=void 0,this.terminals=[],this.terminalsTable=void 0,this.subAccounts=[],this.loading=!0,this.errorMessage=void 0,this.paging=a,this.params={}}updateOnPropChange(){this.fetchTerminals()}componentWillLoad(){this.terminalsTable=new n(this.terminals,this.columns,o,d),this.getTerminals&&this.getSubAccounts&&this.fetchTerminals()}fetchTerminals(){this.loading=!0,this.getTerminals({params:this.params,onSuccess:async({terminals:t,pagingInfo:s})=>{this.terminals=t,this.paging=s,this.terminalsTable.collectionData=this.terminals,this.terminalsTable.columnKeys.includes("sub_account_name")?await this.fetchSubAccounts():this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}async fetchSubAccounts(){this.getSubAccounts({params:this.subAccountParams,onSuccess:({subAccounts:t})=>{this.subAccounts=t,this.terminals=this.terminals.map((t=>{var s;return t.sub_account_name=null===(s=this.subAccounts.find((s=>s.id===t.account_id)))||void 0===s?void 0:s.name,t})),this.loading=!1},onError:({error:t,code:s,severity:e})=>{this.errorMessage=t,this.errorEvent.emit({errorCode:s,message:t,severity:e}),this.loading=!1}})}get subAccountParams(){let t=this.terminals.map((t=>t.account_id));return{sub_account_id:[...new Set(t)].join(",")}}get entityId(){return this.terminals.map((t=>t.id))}get showEmptyState(){return!this.loading&&!this.errorMessage&&this.terminalsTable.rowData.length<1}get showErrorState(){return!this.loading&&!!this.errorMessage}get showRowData(){return!this.showEmptyState&&!this.showErrorState&&!this.loading}render(){return e("div",{key:"7f8bc3f39c1250281c2f2ad6fe081fc71bb20e79"},e("terminals-list-filters",{key:"d1184427fc74d970bd69d56a00d0ef4b7672516b",params:this.params,setParamsOnChange:this.setParamsOnChange,clearParams:this.clearParams}),e("div",{key:"582e37429a153cd17bf3c7ebb16e7330c774f986",class:"table-wrapper"},e("table",{key:"1c03b2ddc8ca2da6b1f2147113f7832b3f27ec1d",class:"table table-hover"},e("thead",{key:"811d48219cc04256f4a37854504252ff53392bd9",class:"table-head sticky-top",part:"table-head"},e("tr",{key:"fafa54ac3abba993dcf38ca2e47f248031226041",class:"table-light text-nowrap",part:"table-head-row"},this.terminalsTable.columnData.map((t=>t)))),e("tbody",{key:"8c9072bf6ebb7f720f1fad0faa47c72c8ed84dd2",class:"table-body",part:"table-body"},e(i,{key:"abddb3ce09e39245c0455893f09e54cc631b26bf",columnSpan:this.terminalsTable.columnKeys.length,isLoading:this.loading}),e(r,{key:"166a461ee8aaf7405fc0a2b12cd17e1e1e9553f3",isEmpty:this.showEmptyState,columnSpan:this.terminalsTable.columnKeys.length}),e(c,{key:"969bbfcce66b6bcee4dadabe465eaef37022d13b",columnSpan:this.terminalsTable.columnKeys.length,errorMessage:this.errorMessage}),this.showRowData&&this.terminalsTable.rowData.map(((t,s)=>e("tr",{"data-test-id":"table-row","data-row-entity-id":this.entityId[s],onClick:this.rowClickHandler,part:"table-row "+(s%2?"table-row-even":"table-row-odd")},t)))),this.paging&&e("tfoot",{key:"c63268c11facddaa44452c58743ad9c03f492898",class:"sticky-bottom"},e("tr",{key:"0e247f8968ad4ed7e8c001354b1c29d5bf7976aa",class:"table-light align-middle"},e("td",{key:"51c5157453d911f5bf370ba2ac6a556dd1592f24",part:"pagination-bar",colSpan:this.terminalsTable.columnData.length},e("pagination-menu",{key:"3a3ba65f31099125e9c01bc9c8c001c6437ed720",paging:Object.assign(Object.assign({},this.paging),{handleClickPrevious:this.handleClickPrevious,handleClickNext:this.handleClickNext}),params:this.params})))))))}static get watchers(){return{params:["updateOnPropChange"],getTerminals:["updateOnPropChange"],getSubAccounts:["updateOnPropChange"],columns:["updateOnPropChange"]}}};export{b as terminals_list_core}
@@ -1 +1 @@
1
- import{r as e,c as t,h as a}from"./p-fad19d75.js";import{c as o}from"./p-5a62fca2.js";import{J as r}from"./p-56bda985.js";import"./p-c1cf7d5b.js";import"./p-0e180654.js";const i=class{constructor(a){e(this,a),this.bankAccountFormReady=t(this,"bankAccountFormReady",7),this.ready=t(this,"ready",7),this.bankAccountFormTokenized=t(this,"bankAccountFormTokenize",7),this.bankAccountFormValidated=t(this,"bankAccountFormValidate",7),this.validationMode=void 0,this.iframeOrigin=o.iframeOrigin,this.internalStyleOverrides=void 0}readyHandler(e){console.warn("The 'bankAccountFormReady' event is deprecated in the next major release and will be renamed to 'ready'"),this.bankAccountFormReady.emit(e),this.ready.emit(e)}tokenizeHandler(e){console.warn("The 'bankAccountFormTokenized' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future."),this.bankAccountFormTokenized.emit(e)}validateHandler(e){console.warn("The 'bankAccountFormValidate' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future."),this.bankAccountFormValidated.emit(e)}componentWillLoad(){this.analytics=new r(this)}disconnectedCallback(){this.analytics.cleanup()}async tokenize(...e){if(!this.childRef)throw new Error("Cannot call tokenize");return this.childRef.tokenize(...e)}async validate(){if(!this.childRef)throw new Error("Cannot call validate");return this.childRef.validate()}async resize(){if(console.warn("The 'resize' method is deprecated and will be removed in the next major release. Please refer to the documentation for the migration process and alternative approach."),!this.childRef)throw new Error("Cannot call validate");return this.childRef.resize()}render(){return a("justifi-payment-method-form",{key:"e2fa64d199a6c550329c9797a6951335e7c12bc6",ref:e=>{e&&(this.childRef=e)},"iframe-origin":this.iframeOrigin,"payment-method-form-type":"bankAccount","payment-method-form-ready":this.bankAccountFormReady,"payment-method-form-validated":this.bankAccountFormValidated,"payment-method-form-tokenize":this.bankAccountFormTokenized,"payment-method-form-validation-mode":this.validationMode||"onSubmit"})}};export{i as justifi_bank_account_form}
1
+ import{r as e,c as t,h as a}from"./p-fad19d75.js";import{c as o}from"./p-5a62fca2.js";import{J as r}from"./p-9e7204b5.js";import"./p-22e38d5b.js";import"./p-0e180654.js";const i=class{constructor(a){e(this,a),this.bankAccountFormReady=t(this,"bankAccountFormReady",7),this.ready=t(this,"ready",7),this.bankAccountFormTokenized=t(this,"bankAccountFormTokenize",7),this.bankAccountFormValidated=t(this,"bankAccountFormValidate",7),this.validationMode=void 0,this.iframeOrigin=o.iframeOrigin,this.internalStyleOverrides=void 0}readyHandler(e){console.warn("The 'bankAccountFormReady' event is deprecated in the next major release and will be renamed to 'ready'"),this.bankAccountFormReady.emit(e),this.ready.emit(e)}tokenizeHandler(e){console.warn("The 'bankAccountFormTokenized' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future."),this.bankAccountFormTokenized.emit(e)}validateHandler(e){console.warn("The 'bankAccountFormValidate' event is deprecated in the next major release. Please refer to the documentation for the migration process and alternative approach. This method will be removed in the future."),this.bankAccountFormValidated.emit(e)}componentWillLoad(){this.analytics=new r(this)}disconnectedCallback(){this.analytics.cleanup()}async tokenize(...e){if(!this.childRef)throw new Error("Cannot call tokenize");return this.childRef.tokenize(...e)}async validate(){if(!this.childRef)throw new Error("Cannot call validate");return this.childRef.validate()}async resize(){if(console.warn("The 'resize' method is deprecated and will be removed in the next major release. Please refer to the documentation for the migration process and alternative approach."),!this.childRef)throw new Error("Cannot call validate");return this.childRef.resize()}render(){return a("justifi-payment-method-form",{key:"e2fa64d199a6c550329c9797a6951335e7c12bc6",ref:e=>{e&&(this.childRef=e)},"iframe-origin":this.iframeOrigin,"payment-method-form-type":"bankAccount","payment-method-form-ready":this.bankAccountFormReady,"payment-method-form-validated":this.bankAccountFormValidated,"payment-method-form-tokenize":this.bankAccountFormTokenized,"payment-method-form-validation-mode":this.validationMode||"onSubmit"})}};export{i as justifi_bank_account_form}
@@ -1 +1 @@
1
- import{r as s,c as i,h as t,H as r}from"./p-fad19d75.js";import{E as o}from"./p-a8b4f429.js";import{B as e}from"./p-f6f8dabc.js";import{B as a}from"./p-5e7c60d8.js";import{C as n,a as d}from"./p-14c91ffd.js";import{g as c,a as p}from"./p-8115b2f4.js";import{J as h}from"./p-56bda985.js";import{c as m}from"./p-e7d6609d.js";import"./p-5a62fca2.js";import"./p-0e180654.js";import"./p-1ff8810b.js";import"./p-6078a370.js";import"./p-c1cf7d5b.js";const f=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.businessId=void 0,this.authToken=void 0,this.errorMessage=void 0,this.getBusiness=void 0}componentWillLoad(){m(),this.analytics=new h(this),this.initializeGetBusiness()}disconnectedCallback(){this.analytics.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:d.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR});this.getBusiness=(({id:s,authToken:i,service:t})=>async({onSuccess:r,onError:o})=>{var e;try{const d=await t.fetchBusiness(s,i);if(d.error)return o({error:c(d.error),code:p(null===(e=d.error)||void 0===e?void 0:e.code),severity:n.ERROR});r({business:new a(d.data)})}catch(s){const i=p(null==s?void 0:s.code);return o({error:s.message||s,code:i,severity:n.ERROR})}})({id:this.businessId,authToken:this.authToken,service:new e})}render(){return t(r,null,this.errorMessage?o(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness}))}};export{f as justifi_business_details}
1
+ import{r as s,c as i,h as t,H as r}from"./p-fad19d75.js";import{E as e}from"./p-a8b4f429.js";import{B as o}from"./p-f6f8dabc.js";import{B as a}from"./p-5e7c60d8.js";import{C as n,a as d}from"./p-14c91ffd.js";import{g as p,a as c}from"./p-8115b2f4.js";import{J as h}from"./p-9e7204b5.js";import{c as m}from"./p-b459d0b0.js";import"./p-5a62fca2.js";import"./p-0e180654.js";import"./p-1ff8810b.js";import"./p-6078a370.js";import"./p-22e38d5b.js";const f=class{constructor(t){s(this,t),this.errorEvent=i(this,"error-event",7),this.businessId=void 0,this.authToken=void 0,this.errorMessage=void 0,this.getBusiness=void 0}componentWillLoad(){m(),this.analytics=new h(this),this.initializeGetBusiness()}disconnectedCallback(){this.analytics.cleanup()}initializeGetBusiness(){if(!this.businessId||!this.authToken)return this.errorMessage="Invalid business id or auth token",void this.errorEvent.emit({errorCode:d.MISSING_PROPS,message:this.errorMessage,severity:n.ERROR});this.getBusiness=(({id:s,authToken:i,service:t})=>async({onSuccess:r,onError:e})=>{var o;try{const d=await t.fetchBusiness(s,i);if(d.error)return e({error:p(d.error),code:c(null===(o=d.error)||void 0===o?void 0:o.code),severity:n.ERROR});r({business:new a(d.data)})}catch(s){const i=c(null==s?void 0:s.code);return e({error:s.message||s,code:i,severity:n.ERROR})}})({id:this.businessId,authToken:this.authToken,service:new o})}render(){return t(r,null,this.errorMessage?e(this.errorMessage):t("business-details-core",{getBusiness:this.getBusiness}))}};export{f as justifi_business_details}
@@ -1 +1 @@
1
- import{r as t,c as i,h as a}from"./p-fad19d75.js";import{B as s}from"./p-9c9c7dac.js";import{S as e}from"./p-74da98da.js";import{C as o}from"./p-14c91ffd.js";import{c as d}from"./p-e7d6609d.js";import{J as c}from"./p-56bda985.js";import"./p-c1cf7d5b.js";import"./p-5a62fca2.js";import"./p-0e180654.js";const r=class{constructor(a){t(this,a),this.submitted=i(this,"submitted",7),this.errorEvent=i(this,"error-event",7),this.authToken=void 0,this.accountId=void 0,this.paymentMethodGroupId=void 0,this.isLoading=!0,this.submitButtonText=void 0,this.disableCreditCard=void 0,this.disableBankAccount=void 0}componentWillLoad(){d(),this.analytics=new c(this),this.isLoading=!1}async tokenizePaymentMethod(t){t&&t.preventDefault();const i=await this.paymentMethodOptionsRef.resolvePaymentMethod({isValid:!0});i.error?this.errorEvent.emit({errorCode:i.error.code,message:i.error.message,severity:o.ERROR}):i.token&&this.submitted.emit({token:i.token})}async fillBillingForm(t){this.paymentMethodOptionsRef.fillBillingForm(t)}render(){return a(e,{key:"d6b961d57ad40a36a55db9f4a338f2e4659737b8"},a("form",{key:"478202bc0e742f132df696e317a5d87b583a65c3"},a("fieldset",{key:"565295af010636d9746c5a3466ce6b3bf4fe5ba2"},a("div",{key:"95736fa3b125f6c389e80505842749d40eb50318",class:"row gy-3"},a("div",{key:"086f7078ab5301c59ea3a1003162ebf82907b594",class:"col-12"},a("justifi-payment-method-options",{key:"13d99aee101cd0dc9cdf52abf3e510a8ee490e82",ref:t=>this.paymentMethodOptionsRef=t,"show-card":!this.disableCreditCard,"show-ach":!this.disableBankAccount,"show-bnpl":!1,paymentMethodGroupId:this.paymentMethodGroupId,"show-saved-payment-methods":!1,authToken:this.authToken,"account-id":this.accountId})),a("div",{key:"348afe48dbcb996b268bf9e6416f25540f9b2930",class:"col-12"},a(s,{key:"00baa2bd2b99a9a8329b9abaace0afac36ae094a",variant:"primary",type:"submit",onClick:t=>this.tokenizePaymentMethod(t),isLoading:this.isLoading,"data-testid":"submit-button"},this.submitButtonText||"Submit"))))))}};r.style=":host{display:block}justifi-payment-method-form{display:block;margin-left:calc(var(--jfi-layout-padding) * -1);margin-right:calc(var(--jfi-layout-padding) * -1)}";export{r as justifi_tokenize_payment_method}
1
+ import{r as t,c as i,h as a}from"./p-fad19d75.js";import{B as s}from"./p-9c9c7dac.js";import{S as e}from"./p-74da98da.js";import{C as o}from"./p-14c91ffd.js";import{c as d}from"./p-b459d0b0.js";import{J as r}from"./p-9e7204b5.js";import"./p-22e38d5b.js";import"./p-5a62fca2.js";import"./p-0e180654.js";const c=class{constructor(a){t(this,a),this.submitted=i(this,"submitted",7),this.errorEvent=i(this,"error-event",7),this.authToken=void 0,this.accountId=void 0,this.paymentMethodGroupId=void 0,this.isLoading=!0,this.submitButtonText=void 0,this.disableCreditCard=void 0,this.disableBankAccount=void 0}componentWillLoad(){d(),this.analytics=new r(this),this.isLoading=!1}async tokenizePaymentMethod(t){t&&t.preventDefault();const i=await this.paymentMethodOptionsRef.resolvePaymentMethod({isValid:!0});i.error?this.errorEvent.emit({errorCode:i.error.code,message:i.error.message,severity:o.ERROR}):i.token&&this.submitted.emit({token:i.token})}async fillBillingForm(t){this.paymentMethodOptionsRef.fillBillingForm(t)}render(){return a(e,{key:"d6b961d57ad40a36a55db9f4a338f2e4659737b8"},a("form",{key:"478202bc0e742f132df696e317a5d87b583a65c3"},a("fieldset",{key:"565295af010636d9746c5a3466ce6b3bf4fe5ba2"},a("div",{key:"95736fa3b125f6c389e80505842749d40eb50318",class:"row gy-3"},a("div",{key:"086f7078ab5301c59ea3a1003162ebf82907b594",class:"col-12"},a("justifi-payment-method-options",{key:"13d99aee101cd0dc9cdf52abf3e510a8ee490e82",ref:t=>this.paymentMethodOptionsRef=t,"show-card":!this.disableCreditCard,"show-ach":!this.disableBankAccount,"show-bnpl":!1,paymentMethodGroupId:this.paymentMethodGroupId,"show-saved-payment-methods":!1,authToken:this.authToken,"account-id":this.accountId})),a("div",{key:"348afe48dbcb996b268bf9e6416f25540f9b2930",class:"col-12"},a(s,{key:"00baa2bd2b99a9a8329b9abaace0afac36ae094a",variant:"primary",type:"submit",onClick:t=>this.tokenizePaymentMethod(t),isLoading:this.isLoading,"data-testid":"submit-button"},this.submitButtonText||"Submit"))))))}};c.style=":host{display:block}justifi-payment-method-form{display:block;margin-left:calc(var(--jfi-layout-padding) * -1);margin-right:calc(var(--jfi-layout-padding) * -1)}";export{c as justifi_tokenize_payment_method}