From 1f2bb6adf7e10d437a2ef81b8d776732c6f0a4c0 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Fri, 9 Aug 2024 12:48:21 +1000 Subject: [PATCH] Improve new flow --- app/Services/Client/RFFService.php | 6 +- package-lock.json | 2 +- .../authorize-credit-card-payment-5206050e.js | 12 --- .../authorize-credit-card-payment-9071bd46.js | 9 --- .../assets/braintree-credit-card-2ba935f9.js | 9 --- .../build/assets/eway-credit-card-62ce5f3b.js | 9 --- .../assets/forte-ach-payment-2f7fa236.js | 9 --- .../assets/mollie-credit-card-db5c26c6.js | 9 --- .../assets/paytrace-credit-card-9cea3700.js | 9 --- public/build/assets/razorpay-aio-3d02ff1d.js | 9 --- .../assets/square-credit-card-a20464a3.js | 9 --- public/build/assets/stripe-alipay-010d5388.js | 9 --- public/build/assets/stripe-bacs-e1cfee99.js | 9 --- .../assets/stripe-bancontact-743204e1.js | 9 --- .../assets/stripe-bank-transfer-801a4de6.js | 9 --- public/build/assets/stripe-becs-ce05fb09.js | 9 --- .../assets/stripe-browserpay-813e625e.js | 9 --- .../assets/stripe-credit-card-f3658509.js | 9 --- public/build/assets/stripe-eps-735c10bd.js | 9 --- public/build/assets/stripe-fpx-d93f7d79.js | 9 --- .../build/assets/stripe-giropay-bff9b7b5.js | 9 --- public/build/assets/stripe-ideal-22b9f5cf.js | 9 --- public/build/assets/stripe-klarna-9ee067e7.js | 9 --- .../assets/stripe-przelewy24-7f03b69e.js | 9 --- public/build/assets/stripe-sepa-554f6dfd.js | 9 --- public/build/assets/stripe-sofort-6e4e7148.js | 9 --- public/build/manifest.json | 79 +++++++++++++------ 27 files changed, 60 insertions(+), 246 deletions(-) delete mode 100644 public/build/assets/authorize-credit-card-payment-5206050e.js delete mode 100644 public/build/assets/authorize-credit-card-payment-9071bd46.js delete mode 100644 public/build/assets/braintree-credit-card-2ba935f9.js delete mode 100644 public/build/assets/eway-credit-card-62ce5f3b.js delete mode 100644 public/build/assets/forte-ach-payment-2f7fa236.js delete mode 100644 public/build/assets/mollie-credit-card-db5c26c6.js delete mode 100644 public/build/assets/paytrace-credit-card-9cea3700.js delete mode 100644 public/build/assets/razorpay-aio-3d02ff1d.js delete mode 100644 public/build/assets/square-credit-card-a20464a3.js delete mode 100644 public/build/assets/stripe-alipay-010d5388.js delete mode 100644 public/build/assets/stripe-bacs-e1cfee99.js delete mode 100644 public/build/assets/stripe-bancontact-743204e1.js delete mode 100644 public/build/assets/stripe-bank-transfer-801a4de6.js delete mode 100644 public/build/assets/stripe-becs-ce05fb09.js delete mode 100644 public/build/assets/stripe-browserpay-813e625e.js delete mode 100644 public/build/assets/stripe-credit-card-f3658509.js delete mode 100644 public/build/assets/stripe-eps-735c10bd.js delete mode 100644 public/build/assets/stripe-fpx-d93f7d79.js delete mode 100644 public/build/assets/stripe-giropay-bff9b7b5.js delete mode 100644 public/build/assets/stripe-ideal-22b9f5cf.js delete mode 100644 public/build/assets/stripe-klarna-9ee067e7.js delete mode 100644 public/build/assets/stripe-przelewy24-7f03b69e.js delete mode 100644 public/build/assets/stripe-sepa-554f6dfd.js delete mode 100644 public/build/assets/stripe-sofort-6e4e7148.js diff --git a/app/Services/Client/RFFService.php b/app/Services/Client/RFFService.php index 9f4293aa1c..9d76c6390e 100644 --- a/app/Services/Client/RFFService.php +++ b/app/Services/Client/RFFService.php @@ -128,7 +128,7 @@ class RFFService $contact = []; MultiDB::setDb($this->database); - + foreach ($data as $field => $value) { if (Str::startsWith($field, 'client_')) { $client[$this->mappings[$field]] = $value; @@ -162,8 +162,8 @@ class RFFService $_contact - ->fill($contact) - ->push(); + ->fill($contact); + // ->push(); $_contact->client ->fill($client) diff --git a/package-lock.json b/package-lock.json index 835834e969..3c1cb22736 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "@invoiceninja/invoiceninja", + "name": "invoiceninja", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/public/build/assets/authorize-credit-card-payment-5206050e.js b/public/build/assets/authorize-credit-card-payment-5206050e.js deleted file mode 100644 index e2361ae4bf..0000000000 --- a/public/build/assets/authorize-credit-card-payment-5206050e.js +++ /dev/null @@ -1,12 +0,0 @@ -var G=Object.defineProperty;var J=(t,e,n)=>e in t?G(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var T=(t,e,n)=>(J(t,typeof e!="symbol"?e+"":e,n),n);import{i as Q,w as ee}from"./wait-8f4ae121.js";var q=t=>{throw TypeError(t)},te=(t,e,n)=>e.has(t)||q("Cannot "+n),ne=(t,e,n)=>e.has(t)?q("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ae=(t,e,n)=>(te(t,e,"access private method"),n);const B={mask:/^.*$/,preprocessors:[],postprocessors:[],plugins:[],overwriteMode:"shift"};class se{constructor(){this.now=null,this.past=[],this.future=[]}undo(){const e=this.past.pop();e&&this.now&&(this.future.push(this.now),this.updateElement(e,"historyUndo"))}redo(){const e=this.future.pop();e&&this.now&&(this.past.push(this.now),this.updateElement(e,"historyRedo"))}updateHistory(e){if(!this.now){this.now=e;return}const n=this.now.value!==e.value,a=this.now.selection.some((s,r)=>s!==e.selection[r]);!n&&!a||(n&&(this.past.push(this.now),this.future=[]),this.now=e)}updateElement(e,n){this.now=e,this.updateElementState(e,{inputType:n,data:null})}}function re(t,...e){return e.every(({value:n})=>n===t.value)}function ie(t,...e){return e.every(({value:n,selection:a})=>n===t.value&&a[0]===t.selection[0]&&a[1]===t.selection[1])}function le({value:t,selection:e},n,a){const[s,r]=e,i=typeof a=="function"?a({value:t,selection:e}):a;return{value:t,selection:i==="replace"?[s,s+n.length]:[s,r]}}function I(t){return typeof t=="string"}function O(t,e,n,a){let s="";for(let r=e.length;r{const s=e[a];return I(s)?n===s:n.match(s)}):e.test(t)}function oe(t,e,n){let a=null,s=null;const r=Array.from(t.value).reduce((l,o,c)=>{const u=O(e,l,o,n),d=l+u,h=e[d.length];return I(h)?d+h:o.match(h)?(a===null&&c>=t.selection[0]&&(a=d.length),s===null&&c>=t.selection[1]&&(s=d.length),d+o):d},""),i=O(e,r,"",n);return{value:H(r+i,e)?r+i:r,selection:[a??r.length,s??r.length]}}function ce({value:t,selection:e},n){const[a,s]=e;let r=a,i=s;return{value:Array.from(t).reduce((l,o,c)=>{const u=l+o;return a===c&&(r=l.length),s===c&&(i=l.length),u.match(n)?u:l},""),selection:[r,i]}}function A(t,e,n=null){if(H(t.value,e))return t;const{value:a,selection:s}=Array.isArray(e)?oe(t,e,n):ce(t,e);return{selection:s,value:Array.isArray(e)?a.slice(0,e.length):a}}function R(t,e){if(!Array.isArray(e))return t;const[n,a]=t.selection,s=[],r=Array.from(t.value).reduce((i,l,o)=>{const c=e[o];return o===n&&s.push(i.length),o===a&&s.push(i.length),I(c)&&c===l?i:i+l},"");return s.length<2&&s.push(...new Array(2-s.length).fill(r.length)),{value:r,selection:[s[0],s[1]]}}class D{constructor(e,n){this.initialElementState=e,this.maskOptions=n,this.value="",this.selection=[0,0];const{value:a,selection:s}=A(this.initialElementState,this.getMaskExpression(this.initialElementState));this.value=a,this.selection=s}addCharacters([e,n],a){const{value:s}=this,r=this.getMaskExpression({value:s.slice(0,e)+a+s.slice(n),selection:[e+a.length,e+a.length]}),i={value:s,selection:[e,n]},l=R(i,r),[o,c]=le(l,a,this.maskOptions.overwriteMode).selection,u=l.value.slice(0,o)+a,d=u.length,h=A({value:u+l.value.slice(c),selection:[d,d]},r,i);if(s.slice(0,o)===A({value:u,selection:[d,d]},r,i).value||ie(this,h))throw new Error("Invalid mask value");this.value=h.value,this.selection=h.selection}deleteCharacters([e,n]){if(e===n||!n)return;const{value:a}=this,s=this.getMaskExpression({value:a.slice(0,e)+a.slice(n),selection:[e,e]}),r={value:a,selection:[e,n]},i=R(r,s),[l,o]=i.selection,c=i.value.slice(0,l)+i.value.slice(o),u=A({value:c,selection:[l,l]},s,r);this.value=u.value,this.selection=u.selection}getMaskExpression(e){const{mask:n}=this.maskOptions;return typeof n=="function"?n(e):n}}class ue{constructor(e){this.element=e,this.listeners=[]}listen(e,n,a){const s=n;this.element.addEventListener(e,s,a),this.listeners.push(()=>this.element.removeEventListener(e,s))}destroy(){this.listeners.forEach(e=>e())}}const g={CTRL:1,ALT:2,SHIFT:4,META:8},w={Y:89,Z:90};function E(t,e,n){return t.ctrlKey===!!(e&g.CTRL)&&t.altKey===!!(e&g.ALT)&&t.shiftKey===!!(e&g.SHIFT)&&t.metaKey===!!(e&g.META)&&t.keyCode===n}function de(t){return E(t,g.CTRL,w.Y)||E(t,g.CTRL|g.SHIFT,w.Z)||E(t,g.META|g.SHIFT,w.Z)}function he(t){return E(t,g.CTRL,w.Z)||E(t,g.META,w.Z)}function me({value:t,selection:e},n){const[a,s]=e;if(a!==s)return[a,s];const r=n?t.slice(a).indexOf(` -`)+1||t.length:t.slice(0,s).lastIndexOf(` -`)+1;return[n?a:r,n?r:s]}function pe({value:t,selection:e},n){const[a,s]=e;return a!==s?[a,s]:(n?[a,s+1]:[a-1,s]).map(r=>Math.min(Math.max(r,0),t.length))}const ve=/\s+$/g,ge=/^\s+/g,j=/\s/;function fe({value:t,selection:e},n){const[a,s]=e;if(a!==s)return[a,s];if(n){const o=t.slice(a),[c]=o.match(ge)||[""],u=o.trimStart().search(j);return[a,u!==-1?a+c.length+u:t.length]}const r=t.slice(0,s),[i]=r.match(ve)||[""],l=r.trimEnd().split("").reverse().findIndex(o=>o.match(j));return[l!==-1?s-i.length-l:0,s]}function k(t=[]){return(e,...n)=>t.reduce((a,s)=>Object.assign(Object.assign({},a),s(a,...n)),e)}function ye(t,e){const n=Object.assign(Object.assign({},B),e),a=k(n.preprocessors),s=k(n.postprocessors),r=typeof t=="string"?{value:t,selection:[0,0]}:t,{elementState:i}=a({elementState:r,data:""},"validation"),l=new D(i,n),{value:o,selection:c}=s(l,r);return typeof t=="string"?o:{value:o,selection:c}}class M extends se{constructor(e,n){super(),this.element=e,this.maskitoOptions=n,this.isTextArea=this.element.nodeName==="TEXTAREA",this.eventListener=new ue(this.element),this.options=Object.assign(Object.assign({},B),this.maskitoOptions),this.preprocessor=k(this.options.preprocessors),this.postprocessor=k(this.options.postprocessors),this.teardowns=this.options.plugins.map(a=>a(this.element,this.options)),this.updateHistory(this.elementState),this.eventListener.listen("keydown",a=>{if(de(a))return a.preventDefault(),this.redo();if(he(a))return a.preventDefault(),this.undo()}),this.eventListener.listen("beforeinput",a=>{var s;const r=a.inputType.includes("Forward");switch(this.updateHistory(this.elementState),a.inputType){case"historyUndo":return a.preventDefault(),this.undo();case"historyRedo":return a.preventDefault(),this.redo();case"deleteByCut":case"deleteContentBackward":case"deleteContentForward":return this.handleDelete({event:a,isForward:r,selection:pe(this.elementState,r)});case"deleteWordForward":case"deleteWordBackward":return this.handleDelete({event:a,isForward:r,selection:fe(this.elementState,r),force:!0});case"deleteSoftLineBackward":case"deleteSoftLineForward":case"deleteHardLineBackward":case"deleteHardLineForward":return this.handleDelete({event:a,isForward:r,selection:me(this.elementState,r),force:!0});case"insertCompositionText":return;case"insertReplacementText":return;case"insertLineBreak":case"insertParagraph":return this.handleEnter(a);case"insertFromPaste":case"insertText":case"insertFromDrop":default:return this.handleInsert(a,a.data||((s=a.dataTransfer)===null||s===void 0?void 0:s.getData("text/plain"))||"")}}),this.eventListener.listen("input",({inputType:a})=>{a!=="insertCompositionText"&&(this.ensureValueFitsMask(),this.updateHistory(this.elementState))}),this.eventListener.listen("compositionend",()=>{this.ensureValueFitsMask(),this.updateHistory(this.elementState)})}get elementState(){const{value:e,selectionStart:n,selectionEnd:a}=this.element;return{value:e,selection:[n||0,a||0]}}get maxLength(){const{maxLength:e}=this.element;return e===-1?1/0:e}destroy(){this.eventListener.destroy(),this.teardowns.forEach(e=>e==null?void 0:e())}updateElementState({value:e,selection:n},a={inputType:"insertText",data:null}){const s=this.elementState.value;this.updateValue(e),this.updateSelectionRange(n),s!==e&&this.dispatchInputEvent(a)}updateSelectionRange([e,n]){var a;const{element:s}=this;s.matches(":focus")&&(s.selectionStart!==e||s.selectionEnd!==n)&&((a=s.setSelectionRange)===null||a===void 0||a.call(s,e,n))}updateValue(e){this.element.value=e}ensureValueFitsMask(){this.updateElementState(ye(this.elementState,this.options))}dispatchInputEvent(e={inputType:"insertText",data:null}){globalThis.InputEvent&&this.element.dispatchEvent(new InputEvent("input",Object.assign(Object.assign({},e),{bubbles:!0,cancelable:!1})))}handleDelete({event:e,selection:n,isForward:a,force:s=!1}){const r={value:this.elementState.value,selection:n},[i,l]=r.selection,{elementState:o}=this.preprocessor({elementState:r,data:""},a?"deleteForward":"deleteBackward"),c=new D(o,this.options),[u,d]=o.selection;c.deleteCharacters([u,d]);const h=this.postprocessor(c,r);if(!(r.value.slice(0,i)+r.value.slice(l)===h.value&&!s&&!this.element.isContentEditable)){if(e.preventDefault(),re(r,o,c,h))return this.updateSelectionRange(a?[d,d]:[u,u]);this.updateElementState(h,{inputType:e.inputType,data:null}),this.updateHistory(h)}}handleInsert(e,n){const a=this.elementState,{elementState:s,data:r=n}=this.preprocessor({data:n,elementState:a},"insert"),i=new D(s,this.options);try{i.addCharacters(s.selection,r)}catch{return e.preventDefault()}const[l,o]=s.selection,c=a.value.slice(0,l)+n+a.value.slice(o),u=this.postprocessor(i,a);if(u.value.length>this.maxLength)return e.preventDefault();(c!==u.value||this.element.isContentEditable)&&(e.preventDefault(),this.updateElementState(u,{data:n,inputType:e.inputType}),this.updateHistory(u))}handleEnter(e){(this.isTextArea||this.element.isContentEditable)&&this.handleInsert(e,` -`)}}function Se(t,e,n){const a=Math.min(Number(n),Math.max(Number(e),Number(t)));return t instanceof Date?new Date(a):a}function we(t){return t.replaceAll(/\W/g,"").length}const V=t=>{var e,n,a;return{day:((e=t.match(/d/g))===null||e===void 0?void 0:e.length)||0,month:((n=t.match(/m/g))===null||n===void 0?void 0:n.length)||0,year:((a=t.match(/y/g))===null||a===void 0?void 0:a.length)||0}};function Ee(t){return{day:String(t.getDate()).padStart(2,"0"),month:String(t.getMonth()+1).padStart(2,"0"),year:String(t.getFullYear()).padStart(4,"0"),hours:String(t.getHours()).padStart(2,"0"),minutes:String(t.getMinutes()).padStart(2,"0"),seconds:String(t.getSeconds()).padStart(2,"0"),milliseconds:String(t.getMilliseconds()).padStart(3,"0")}}function be(t,e){return t.length!n.match(/^0+$/))}function W(t,e,n){const a=we(e);return t.replace(n,"").match(new RegExp(`(\\D*\\d[^\\d\\s]*){1,${a}}`,"g"))||[]}function C(t,e){const n=e.replaceAll(/[^dmy]/g,""),a=t.replaceAll(/\D+/g,""),s={day:a.slice(n.indexOf("d"),n.lastIndexOf("d")+1),month:a.slice(n.indexOf("m"),n.lastIndexOf("m")+1),year:a.slice(n.indexOf("y"),n.lastIndexOf("y")+1)};return Object.fromEntries(Object.entries(s).filter(([r,i])=>!!i).sort(([r],[i])=>e.toLowerCase().indexOf(r[0])>e.toLowerCase().indexOf(i[0])?1:-1))}function xe(t,e){var n,a,s,r,i,l,o;const c=((n=t.year)===null||n===void 0?void 0:n.length)===2?`20${t.year}`:t.year,u=new Date(Number(c??"0"),Number((a=t.month)!==null&&a!==void 0?a:"1")-1,Number((s=t.day)!==null&&s!==void 0?s:"1"),Number((r=void 0)!==null&&r!==void 0?r:"0"),Number((i=void 0)!==null&&i!==void 0?i:"0"),Number((l=void 0)!==null&&l!==void 0?l:"0"),Number((o=void 0)!==null&&o!==void 0?o:"0"));return u.setFullYear(Number(c??"0")),u}const z=", ";function b({day:t,month:e,year:n,hours:a,minutes:s,seconds:r,milliseconds:i},{dateMode:l,dateTimeSeparator:o=z,timeMode:c}){var u;const d=((u=l.match(/y/g))===null||u===void 0?void 0:u.length)===2?n==null?void 0:n.slice(-2):n;return(l+(c?o+c:"")).replaceAll(/d+/g,t??"").replaceAll(/m+/g,e??"").replaceAll(/y+/g,d??"").replaceAll(/H+/g,a??"").replaceAll("MSS",i??"").replaceAll(/M+/g,s??"").replaceAll(/S+/g,r??"").replaceAll(/^\D+/g,"").replaceAll(/\D+$/g,"")}const K={day:31,month:12,year:9999},Te=new Date("0001-01-01"),Ae=new Date("9999-12-31"),ke=[":","."];function Ie({dateString:t,dateModeTemplate:e,dateSegmentsSeparator:n,offset:a,selection:[s,r]}){const i=C(t,e),l=Object.entries(i),o={};for(const[d,h]of l){const p=b(o,{dateMode:e}),S=K[d],f=p.length&&n.length,v=a+p.length+f+V(e)[d],y=v>=s&&v===r;if(y&&Number(h)>Number(S))return{validatedDateString:"",updatedSelection:[s,r]};if(y&&Number(h)<1)return{validatedDateString:"",updatedSelection:[s,r]};o[d]=h}const c=b(o,{dateMode:e}),u=c.length-t.length;return{validatedDateString:c,updatedSelection:[s+u,r+u]}}const Z=/[\\^$.*+?()[\]{}|]/g,Me=new RegExp(Z.source);function P(t){return t&&Me.test(t)?t.replaceAll(Z,"\\$&"):t}function L(t,e,n=0){return Number(t.padEnd(e.length,"0"))<=Number(e)?{validatedSegmentValue:t,prefixedZeroesCount:n}:t.endsWith("0")?L(`0${t.slice(0,e.length-1)}`,e,n+1):L(`${t.slice(0,e.length-1)}0`,e,n)}function F(t){return t.replaceAll(/[0-9]/g,e=>String.fromCharCode(e.charCodeAt(0)-65248))}function De({dateModeTemplate:t,dateSegmentSeparator:e,splitFn:n,uniteFn:a}){return({value:s,selection:r})=>{var i;const[l,o]=r,{dateStrings:c,restPart:u=""}=n(s),d=[];let h=0;c.forEach(S=>{const f=C(S,t),v=Object.entries(f).reduce((y,[x,_])=>{const{validatedSegmentValue:U,prefixedZeroesCount:X}=L(_,`${K[x]}`);return h+=X,Object.assign(Object.assign({},y),{[x]:U})},{});d.push(b(v,{dateMode:t}))});const p=a(d,s)+(!((i=c[c.length-1])===null||i===void 0)&&i.endsWith(e)?e:"")+u;return h&&p.slice(o+h,o+h+e.length)===e&&(h+=e.length),{selection:[l+h,o+h],value:p}}}function Le(){return({elementState:t,data:e})=>{const{value:n,selection:a}=t;return{elementState:{selection:a,value:F(n)},data:F(e)}}}function $e(t,e){const n=V(e);return Object.fromEntries(Object.entries(t).map(([a,s])=>{const r=n[a];return[a,s.length===r&&s.match(/^0+$/)?"1".padStart(r,"0"):s]}))}function Be({dateModeTemplate:t,min:e=Te,max:n=Ae,rangeSeparator:a="",dateSegmentSeparator:s="."}){return({value:r,selection:i})=>{const l=a&&r.endsWith(a),o=W(r,t,a);let c="";for(const u of o){c+=c?a:"";const d=C(u,t);if(!be(u,t)){const S=$e(d,t),f=b(S,{dateMode:t}),v=u.endsWith(s)?s:"";c+=f+v;continue}const h=xe(d),p=Se(h,e,n);c+=b(Ee(p),{dateMode:t})}return{selection:i,value:c+(l?a:"")}}}function Ce({dateModeTemplate:t,dateSegmentsSeparator:e,rangeSeparator:n="",dateTimeSeparator:a=z}){return({elementState:s,data:r})=>{const i=n?new RegExp(`${n}|-`):a,l=r.split(i),o=r.includes(a)?[l[0]]:l;if(o.every(c=>c.trim().split(/\D/).filter(Boolean).length===t.split(e).length)){const c=o.map(u=>Oe(u,t,e)).join(n);return{elementState:s,data:`${c}${r.includes(a)&&a+l[1]||""}`}}return{elementState:s,data:r}}}function Oe(t,e,n){const a=t.split(/\D/).filter(Boolean),s=e.split(n);return a.map((r,i)=>i===s.length-1?r:r.padStart(s[i].length,"0")).join(n)}function Re({dateModeTemplate:t,dateSegmentsSeparator:e,rangeSeparator:n=""}){return({elementState:a,data:s})=>{const{value:r,selection:i}=a;if(s===e)return{elementState:a,data:i[0]===r.length?s:""};const l=s.replaceAll(new RegExp(`[^\\d${P(e)}${n}]`,"g"),"");if(!l)return{elementState:a,data:""};const[o,c]=i;let u=c+s.length;const d=r.slice(0,o)+l+r.slice(u),h=W(d,t,n);let p="";const S=!!n&&d.includes(n);for(const v of h){const{validatedDateString:y,updatedSelection:x}=Ie({dateString:v,dateModeTemplate:t,dateSegmentsSeparator:e,offset:p.length,selection:[o,u]});if(v&&!y)return{elementState:a,data:""};u=x[1],p+=S&&!p?y+n:y}const f=p.slice(o,u);return{elementState:{selection:i,value:p.slice(0,o)+f.split(e).map(v=>"0".repeat(v.length)).join(e)+p.slice(u)},data:f}}}function je(){return({elementState:t},e)=>{const{value:n,selection:a}=t;if(!n||Fe(n,a))return{elementState:t};const[s,r]=a,i=n.slice(s,r).replaceAll(/\d/g,"0"),l=n.slice(0,s)+i+n.slice(r);return e==="validation"||e==="insert"&&s===r?{elementState:{selection:a,value:l}}:{elementState:{selection:e==="deleteBackward"||e==="insert"?[s,s]:[r,r],value:l}}}}function Fe(t,[e,n]){return n===t.length}function Ne({mode:t,separator:e=".",max:n,min:a}){const s=t.split("/").join(e);return Object.assign(Object.assign({},B),{mask:Array.from(s).map(r=>e.includes(r)?r:/\d/),overwriteMode:"replace",preprocessors:[Le(),je(),Ce({dateModeTemplate:s,dateSegmentsSeparator:e}),Re({dateModeTemplate:s,dateSegmentsSeparator:e})],postprocessors:[De({dateModeTemplate:s,dateSegmentSeparator:e,splitFn:r=>({dateStrings:[r]}),uniteFn:([r])=>r}),Be({min:a,max:n,dateModeTemplate:s,dateSegmentSeparator:e})]})}new RegExp(`[${ke.map(P).join("")}]$`);const qe=/^(?:\d{4}[ -]?){0,3}\d{0,4}$/,m={visa:{final:/^4(?:\d{3}[- ]?){3}\d{3,4}$/,start:/^4/,length:/^4\d{0,15}$/},mastercard:{final:/^5[1-5]\d{3}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}$/,start:/^5[1-5]/,length:/^5[1-5]\d{0,15}$/},amex:{final:/^3[47]\d{2}[- ]?\d{6}[- ]?\d{5}$/,start:/^3[47]/,length:/^3[47]\d{0,15}$/},discover:{final:/^(6011|65|64[4-9])\d{4}[- ]?\d{4}[- ]?\d{4}$/,start:/^(6011|65|64[4-9])/,length:/^(6011|65|64[4-9])\d{0,15}$/},diners:{final:/^(30[0-5]|36|38|39)\d{4}[- ]?\d{4}[- ]?\d{4}$/,start:/^(30[0-5]|36|38|39)/,length:/^(30[0-5]|36|38|39)\d{0,14}$/},jcb:{final:/^(2131|1800|35[0-9]{3})\d{4}[- ]?\d{4}[- ]?\d{4}$/,start:/^(2131|1800|35[0-9]{3})/,length:/^(2131|1800|35[0-9]{3})\d{0,15}$/}};var $,Y;class He{constructor(e){ne(this,$),this.options=e}mount(){return this.number=this.options.fields.card.number instanceof HTMLInputElement?this.options.fields.card.number:document.querySelector(this.options.fields.card.number),this.date=this.options.fields.card.date instanceof HTMLInputElement?this.options.fields.card.date:document.querySelector(this.options.fields.card.date),this.cvv=this.options.fields.card.cvv instanceof HTMLInputElement?this.options.fields.card.cvv:document.querySelector(this.options.fields.card.cvv),ae(this,$,Y).call(this),this}check(){const e=m.visa.final.test(this.number.value)||m.mastercard.final.test(this.number.value)||m.amex.final.test(this.number.value)||m.discover.final.test(this.number.value)||m.diners.final.test(this.number.value)||m.jcb.final.test(this.number.value),n=new RegExp("^(0[1-9]|1[0-2])/(?:\\d{2})$").test(this.date.value),a=new RegExp("^\\d{3}$").test(this.cvv.value);return{valid:e&&n&&a,number:{valid:e,value:this.number.value},date:{valid:n,value:this.date.value},cvv:{valid:a,value:this.cvv.value}}}type(){return m.visa.start.test(this.number.value)?"visa":m.mastercard.start.test(this.number.value)?"mastercard":m.amex.start.test(this.number.value)?"amex":m.discover.start.test(this.number.value)?"discover":m.diners.start.test(this.number.value)?"diners":m.jcb.start.test(this.number.value)?"jcb":"unknown"}value(e){if(e==="number")return this.number.value;if(e==="date")return this.date.value;if(e==="year"){const[,n]=this.date.value.split("/");return n}if(e==="month"){const[n]=this.date.value.split("/");return n}return e==="cvv"?this.cvv.value:null}}$=new WeakSet,Y=function(){new M(this.number,{mask:t=>m.visa.start.test(t.value)?new RegExp(m.visa.length):m.mastercard.start.test(t.value)?new RegExp(m.mastercard.length):m.amex.start.test(t.value)?new RegExp(m.amex.length):m.discover.start.test(t.value)?new RegExp(m.discover.length):m.diners.start.test(t.value)?new RegExp(m.diners.length):m.jcb.start.test(t.value)?new RegExp(m.jcb.length):new RegExp(qe)}),new M(this.date,Ne({mode:"mm/yy",separator:"/"})),new M(this.cvv,{mask:[/\d/,/\d/,/\d/]})};/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class Ve{constructor(e,n){T(this,"handleAuthorization",()=>{var r,i,l,o;if(this.cvvRequired=="1"&&document.getElementById("cvv").value.length<3){const c=document.getElementById("errors");c&&(c.innerText="CVV is required",c.style.display="block"),document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden");return}var e={};e.clientKey=this.publicKey,e.apiLoginID=this.loginId;var n={};n.cardNumber=(r=this.sc.value("number"))==null?void 0:r.replace(/[^\d]/g,""),n.month=(i=this.sc.value("month"))==null?void 0:i.replace(/[^\d]/g,""),n.year=`20${(l=this.sc.value("year"))==null?void 0:l.replace(/[^\d]/g,"")}`,n.cardCode=(o=this.sc.value("cvv"))==null?void 0:o.replace(/[^\d]/g,"");var a={};return a.authData=e,a.cardData=n,document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden")),Accept.dispatchData(a,this.responseHandler),!1});T(this,"responseHandler",e=>{if(e.messages.resultCode==="Error"){var n=0;const a=document.getElementById("errors");a&&(a.innerText=`${e.messages.message[n].code}: ${e.messages.message[n].text}`,a.style.display="block"),document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}else if(e.messages.resultCode==="Ok"){document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue;let a=document.querySelector("input[name=token-billing-checkbox]:checked");a&&(document.getElementById("store_card").value=a.value),document.getElementById("server_response").submit()}return!1});T(this,"handle",()=>{Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(a=>a.addEventListener("click",s=>{document.getElementById("save-card--container").style.display="none",document.getElementById("authorize--credit-card-container").style.display="none",document.getElementById("token").value=s.target.dataset.token}));let e=document.getElementById("toggle-payment-with-credit-card");e&&e.addEventListener("click",()=>{document.getElementById("save-card--container").style.display="grid",document.getElementById("authorize--credit-card-container").style.display="flex",document.getElementById("token").value=null});let n=document.getElementById("pay-now");return n&&n.addEventListener("click",a=>{let s=document.getElementById("token");s.value?this.handlePayNowAction(s.value):this.handleAuthorization()}),this});this.publicKey=e,this.loginId=n,this.cardHolderName=document.getElementById("cardholder_name"),this.sc=new He({fields:{card:{number:"#number",date:"#date",cvv:"#cvv"}}}),this.sc.mount(),this.cvvRequired=document.querySelector('meta[name="authnet-require-cvv"]').content}handlePayNowAction(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),document.getElementById("token").value=e,document.getElementById("server_response").submit()}}function N(){const t=document.querySelector('meta[name="authorize-public-key"]').content,e=document.querySelector('meta[name="authorize-login-id"]').content;new Ve(t,e).handle()}Q()?N():ee("#authorize-net-credit-card-payment").then(()=>N()); diff --git a/public/build/assets/authorize-credit-card-payment-9071bd46.js b/public/build/assets/authorize-credit-card-payment-9071bd46.js deleted file mode 100644 index b091e94d96..0000000000 --- a/public/build/assets/authorize-credit-card-payment-9071bd46.js +++ /dev/null @@ -1,9 +0,0 @@ -var l=Object.defineProperty;var s=(n,e,t)=>e in n?l(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var o=(n,e,t)=>(s(n,typeof e!="symbol"?e+"":e,t),t);import{i,w as u}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class m{constructor(e,t){o(this,"handleAuthorization",()=>{if(cvvRequired=="1"&&document.getElementById("cvv").value.length<3){var e=$("#errors");e.show().html("

CVV is required

"),document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden");return}var t=$("#my-card"),d={};d.clientKey=this.publicKey,d.apiLoginID=this.loginId;var a={};a.cardNumber=t.CardJs("cardNumber").replace(/[^\d]/g,""),a.month=t.CardJs("expiryMonth").replace(/[^\d]/g,""),a.year=t.CardJs("expiryYear").replace(/[^\d]/g,""),a.cardCode=document.getElementById("cvv").value.replace(/[^\d]/g,"");var r={};return r.authData=d,r.cardData=a,document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden")),Accept.dispatchData(r,this.responseHandler),!1});o(this,"responseHandler",e=>{if(e.messages.resultCode==="Error"){var t=0,d=$("#errors");d.show().html("

"+e.messages.message[t].code+": "+e.messages.message[t].text+"

"),document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}else if(e.messages.resultCode==="Ok"){document.getElementById("dataDescriptor").value=e.opaqueData.dataDescriptor,document.getElementById("dataValue").value=e.opaqueData.dataValue;let a=document.querySelector("input[name=token-billing-checkbox]:checked");a&&(document.getElementById("store_card").value=a.value),document.getElementById("server_response").submit()}return!1});o(this,"handle",()=>{Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(d=>d.addEventListener("click",a=>{document.getElementById("save-card--container").style.display="none",document.getElementById("authorize--credit-card-container").style.display="none",document.getElementById("token").value=a.target.dataset.token}));let e=document.getElementById("toggle-payment-with-credit-card");e&&e.addEventListener("click",()=>{document.getElementById("save-card--container").style.display="grid",document.getElementById("authorize--credit-card-container").style.display="flex",document.getElementById("token").value=null});let t=document.getElementById("pay-now");return t&&t.addEventListener("click",d=>{let a=document.getElementById("token");a.value?this.handlePayNowAction(a.value):this.handleAuthorization()}),this});this.publicKey=e,this.loginId=t,this.cardHolderName=document.getElementById("cardholder_name")}handlePayNowAction(e){document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),document.getElementById("token").value=e,document.getElementById("server_response").submit()}}function c(){const n=document.querySelector('meta[name="authorize-public-key"]').content,e=document.querySelector('meta[name="authorize-login-id"]').content;document.querySelector('meta[name="authnet-require-cvv"]').content,new m(n,e).handle()}i()?c():u("#authorize-net-credit-card-payment").then(()=>c()); diff --git a/public/build/assets/braintree-credit-card-2ba935f9.js b/public/build/assets/braintree-credit-card-2ba935f9.js deleted file mode 100644 index d9e5d9b3b0..0000000000 --- a/public/build/assets/braintree-credit-card-2ba935f9.js +++ /dev/null @@ -1,9 +0,0 @@ -import{i as e,w as n}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com). - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */function t(){console.log("boot",document.querySelector("meta[name=client-token]"))}e()?t():n("#braintree-credit-card-payment","meta[name=client-token]").then(()=>t()); diff --git a/public/build/assets/eway-credit-card-62ce5f3b.js b/public/build/assets/eway-credit-card-62ce5f3b.js deleted file mode 100644 index 3c3ceed101..0000000000 --- a/public/build/assets/eway-credit-card-62ce5f3b.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Invoice Ninja (https://invoiceninja.com). - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class i{constructor(){this.cardStyles="padding: 2px; border: 1px solid #AAA; border-radius: 3px; height: 34px; width: 100%;",this.errorCodes=new Map,this.errorCodes.set("V6000","Validation error"),this.errorCodes.set("V6001","Invalid CustomerIP"),this.errorCodes.set("V6002","Invalid DeviceID"),this.errorCodes.set("V6003","Invalid Request PartnerID"),this.errorCodes.set("V6004","Invalid Request Method"),this.errorCodes.set("V6010","Invalid TransactionType, account not certified for eCome only MOTO or Recurring available"),this.errorCodes.set("V6011","Invalid Payment TotalAmount"),this.errorCodes.set("V6012","Invalid Payment InvoiceDescription"),this.errorCodes.set("V6013","Invalid Payment InvoiceNumber"),this.errorCodes.set("V6014","Invalid Payment InvoiceReference"),this.errorCodes.set("V6015","Invalid Payment CurrencyCode"),this.errorCodes.set("V6016","Payment Required"),this.errorCodes.set("V6017","Payment CurrencyCode Required"),this.errorCodes.set("V6018","Unknown Payment CurrencyCode"),this.errorCodes.set("V6019","Cardholder identity authentication required"),this.errorCodes.set("V6020","Cardholder Input Required"),this.errorCodes.set("V6021","EWAY_CARDHOLDERNAME Required"),this.errorCodes.set("V6022","EWAY_CARDNUMBER Required"),this.errorCodes.set("V6023","EWAY_CARDCVN Required"),this.errorCodes.set("V6024","Cardholder Identity Authentication One Time Password Not Active Yet"),this.errorCodes.set("V6025","PIN Required"),this.errorCodes.set("V6033","Invalid Expiry Date"),this.errorCodes.set("V6034","Invalid Issue Number"),this.errorCodes.set("V6035","Invalid Valid From Date"),this.errorCodes.set("V6039","Invalid Network Token Status"),this.errorCodes.set("V6040","Invalid TokenCustomerID"),this.errorCodes.set("V6041","Customer Required"),this.errorCodes.set("V6042","Customer FirstName Required"),this.errorCodes.set("V6043","Customer LastName Required"),this.errorCodes.set("V6044","Customer CountryCode Required"),this.errorCodes.set("V6045","Customer Title Required"),this.errorCodes.set("V6046","TokenCustomerID Required"),this.errorCodes.set("V6047","RedirectURL Required"),this.errorCodes.set("V6048","CheckoutURL Required when CheckoutPayment specified"),this.errorCodes.set("V6049","nvalid Checkout URL"),this.errorCodes.set("V6051","Invalid Customer FirstName"),this.errorCodes.set("V6052","Invalid Customer LastName"),this.errorCodes.set("V6053","Invalid Customer CountryCode"),this.errorCodes.set("V6058","Invalid Customer Title"),this.errorCodes.set("V6059","Invalid RedirectURL"),this.errorCodes.set("V6060","Invalid TokenCustomerID"),this.errorCodes.set("V6061","Invalid Customer Reference"),this.errorCodes.set("V6062","Invalid Customer CompanyName"),this.errorCodes.set("V6063","Invalid Customer JobDescription"),this.errorCodes.set("V6064","Invalid Customer Street1"),this.errorCodes.set("V6065","Invalid Customer Street2"),this.errorCodes.set("V6066","Invalid Customer City"),this.errorCodes.set("V6067","Invalid Customer State"),this.errorCodes.set("V6068","Invalid Customer PostalCode"),this.errorCodes.set("V6069","Invalid Customer Email"),this.errorCodes.set("V6070","Invalid Customer Phone"),this.errorCodes.set("V6071","Invalid Customer Mobile"),this.errorCodes.set("V6072","Invalid Customer Comments"),this.errorCodes.set("V6073","Invalid Customer Fax"),this.errorCodes.set("V6074","Invalid Customer URL"),this.errorCodes.set("V6075","Invalid ShippingAddress FirstName"),this.errorCodes.set("V6076","Invalid ShippingAddress LastName"),this.errorCodes.set("V6077","Invalid ShippingAddress Street1"),this.errorCodes.set("V6078","Invalid ShippingAddress Street2"),this.errorCodes.set("V6079","Invalid ShippingAddress City"),this.errorCodes.set("V6080","Invalid ShippingAddress State"),this.errorCodes.set("V6081","Invalid ShippingAddress PostalCode"),this.errorCodes.set("V6082","Invalid ShippingAddress Email"),this.errorCodes.set("V6083","Invalid ShippingAddress Phone"),this.errorCodes.set("V6084","Invalid ShippingAddress Country"),this.errorCodes.set("V6085","Invalid ShippingAddress ShippingMethod"),this.errorCodes.set("V6086","Invalid ShippingAddress Fax"),this.errorCodes.set("V6091","Unknown Customer CountryCode"),this.errorCodes.set("V6092","Unknown ShippingAddress CountryCode"),this.errorCodes.set("V6093","Insufficient Address Information"),this.errorCodes.set("V6100","Invalid EWAY_CARDNAME"),this.errorCodes.set("V6101","Invalid EWAY_CARDEXPIRYMONTH"),this.errorCodes.set("V6102","Invalid EWAY_CARDEXPIRYYEAR"),this.errorCodes.set("V6103","Invalid EWAY_CARDSTARTMONTH"),this.errorCodes.set("V6104","Invalid EWAY_CARDSTARTYEAR"),this.errorCodes.set("V6105","Invalid EWAY_CARDISSUENUMBER"),this.errorCodes.set("V6106","Invalid EWAY_CARDCVN"),this.errorCodes.set("V6107","Invalid EWAY_ACCESSCODE"),this.errorCodes.set("V6108","Invalid CustomerHostAddress"),this.errorCodes.set("V6109","Invalid UserAgent"),this.errorCodes.set("V6110","Invalid EWAY_CARDNUMBER"),this.errorCodes.set("V6111","Unauthorised API Access, Account Not PCI Certified"),this.errorCodes.set("V6112","Redundant card details other than expiry year and month"),this.errorCodes.set("V6113","Invalid transaction for refund"),this.errorCodes.set("V6114","Gateway validation error"),this.errorCodes.set("V6115","Invalid DirectRefundRequest, Transaction ID"),this.errorCodes.set("V6116","Invalid card data on original TransactionID"),this.errorCodes.set("V6117","Invalid CreateAccessCodeSharedRequest, FooterText"),this.errorCodes.set("V6118","Invalid CreateAccessCodeSharedRequest, HeaderText"),this.errorCodes.set("V6119","Invalid CreateAccessCodeSharedRequest, Language"),this.errorCodes.set("V6120","Invalid CreateAccessCodeSharedRequest, LogoUrl"),this.errorCodes.set("V6121","Invalid TransactionSearch, Filter Match Type"),this.errorCodes.set("V6122","Invalid TransactionSearch, Non numeric Transaction ID"),this.errorCodes.set("V6123","Invalid TransactionSearch,no TransactionID or AccessCode specified"),this.errorCodes.set("V6124","Invalid Line Items. The line items have been provided however the totals do not match the TotalAmount field"),this.errorCodes.set("V6125","Selected Payment Type not enabled"),this.errorCodes.set("V6126","Invalid encrypted card number, decryption failed"),this.errorCodes.set("V6127","Invalid encrypted cvn, decryption failed"),this.errorCodes.set("V6128","Invalid Method for Payment Type"),this.errorCodes.set("V6129","Transaction has not been authorised for Capture/Cancellation"),this.errorCodes.set("V6130","Generic customer information error"),this.errorCodes.set("V6131","Generic shipping information error"),this.errorCodes.set("V6132","Transaction has already been completed or voided, operation not permitted"),this.errorCodes.set("V6133","Checkout not available for Payment Type"),this.errorCodes.set("V6134","Invalid Auth Transaction ID for Capture/Void"),this.errorCodes.set("V6135","PayPal Error Processing Refund"),this.errorCodes.set("V6136","Original transaction does not exist or state is incorrect"),this.errorCodes.set("V6140","Merchant account is suspended"),this.errorCodes.set("V6141","Invalid PayPal account details or API signature"),this.errorCodes.set("V6142","Authorise not available for Bank/Branch"),this.errorCodes.set("V6143","Invalid Public Key"),this.errorCodes.set("V6144","Method not available with Public API Key Authentication"),this.errorCodes.set("V6145","Credit Card not allow if Token Customer ID is provided with Public API Key Authentication"),this.errorCodes.set("V6146","Client Side Encryption Key Missing or Invalid"),this.errorCodes.set("V6147","Unable to Create One Time Code for Secure Field"),this.errorCodes.set("V6148","Secure Field has Expired"),this.errorCodes.set("V6149","Invalid Secure Field One Time Code"),this.errorCodes.set("V6150","Invalid Refund Amount"),this.errorCodes.set("V6151","Refund amount greater than original transaction"),this.errorCodes.set("V6152","Original transaction already refunded for total amount"),this.errorCodes.set("V6153","Card type not support by merchant"),this.errorCodes.set("V6154","Insufficent Funds Available For Refund"),this.errorCodes.set("V6155","Missing one or more fields in request"),this.errorCodes.set("V6160","Encryption Method Not Supported"),this.errorCodes.set("V6161","Encryption failed, missing or invalid key"),this.errorCodes.set("V6165","Invalid Click-to-Pay (Visa Checkout) data or decryption failed"),this.errorCodes.set("V6170","Invalid TransactionSearch, Invoice Number is not unique"),this.errorCodes.set("V6171","Invalid TransactionSearch, Invoice Number not found"),this.errorCodes.set("V6220","Three domain secure XID invalid"),this.errorCodes.set("V6221","Three domain secure ECI invalid"),this.errorCodes.set("V6222","Three domain secure AVV invalid"),this.errorCodes.set("V6223","Three domain secure XID is required"),this.errorCodes.set("V6224","Three Domain Secure ECI is required"),this.errorCodes.set("V6225","Three Domain Secure AVV is required"),this.errorCodes.set("V6226","Three Domain Secure AuthStatus is required"),this.errorCodes.set("V6227","Three Domain Secure AuthStatus invalid"),this.errorCodes.set("V6228","Three domain secure Version is required"),this.errorCodes.set("V6230","Three domain secure Directory Server Txn ID invalid"),this.errorCodes.set("V6231","Three domain secure Directory Server Txn ID is required"),this.errorCodes.set("V6232","Three domain secure Version is invalid"),this.errorCodes.set("V6501","Invalid Amex InstallementPlan"),this.errorCodes.set("V6502","Invalid Number Of Installements for Amex. Valid values are from 0 to 99 inclusive"),this.errorCodes.set("V6503","Merchant Amex ID required"),this.errorCodes.set("V6504","Invalid Merchant Amex ID"),this.errorCodes.set("V6505","Merchant Terminal ID required"),this.errorCodes.set("V6506","Merchant category code required"),this.errorCodes.set("V6507","Invalid merchant category code"),this.errorCodes.set("V6508","Amex 3D ECI required"),this.errorCodes.set("V6509","Invalid Amex 3D ECI"),this.errorCodes.set("V6510","Invalid Amex 3D verification value"),this.errorCodes.set("V6511","Invalid merchant location data"),this.errorCodes.set("V6512","Invalid merchant street address"),this.errorCodes.set("V6513","Invalid merchant city"),this.errorCodes.set("V6514","Invalid merchant country"),this.errorCodes.set("V6515","Invalid merchant phone"),this.errorCodes.set("V6516","Invalid merchant postcode"),this.errorCodes.set("V6517","Amex connection error"),this.errorCodes.set("V6518","Amex EC Card Details API returned invalid data"),this.errorCodes.set("V6520","Invalid or missing Amex Point Of Sale Data"),this.errorCodes.set("V6521","Invalid or missing Amex transaction date time"),this.errorCodes.set("V6522","Invalid or missing Amex Original transaction date time"),this.errorCodes.set("V6530","Credit Card Number in non Credit Card Field")}get groupFieldConfig(){var e,t,r,s,o;return{publicApiKey:(e=document.querySelector("meta[name=public-api-key]"))==null?void 0:e.content,fieldDivId:"eway-secure-panel",fieldType:"group",styles:"",layout:{fonts:["Lobster"],rows:[{styles:"",cells:[{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(t=document.querySelector("meta[name=translation-card-name]"))==null?void 0:t.content,styles:""},field:{fieldColSpan:8,fieldType:"name",styles:this.cardStyles,divStyles:"padding-left: 10px;"}},{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(r=document.querySelector("meta[name=translation-expiry_date]"))==null?void 0:r.content,styles:""},field:{fieldColSpan:8,fieldType:"expirytext",styles:this.cardStyles,divStyles:"padding-left: 10px;"}}]},{styles:"",cells:[{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(s=document.querySelector("meta[name=translation-card_number]"))==null?void 0:s.content,styles:""},field:{fieldColSpan:8,fieldType:"card",styles:this.cardStyles}},{colSpan:12,styles:"margin-top: 15px;",label:{fieldColSpan:4,text:(o=document.querySelector("meta[name=translation-cvv]"))==null?void 0:o.content,styles:""},field:{fieldColSpan:8,fieldType:"cvn",styles:this.cardStyles}}]}]}}}securePanelCallback(e){if(document.getElementById("errors").hidden=!0,e.errors)return this.handleErrors(e.errors);document.getElementById("authorize-card")&&(document.getElementById("authorize-card").disabled=!1),document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!1),document.querySelector("input[name=securefieldcode]").value=e.secureFieldCode}handleErrors(e){let t=e.split(" "),r="";t.forEach(s=>{r=r.concat(this.errorCodes.get(s)+"
")}),document.getElementById("errors").innerHTML=r,document.getElementById("errors").hidden=!1}completeAuthorization(e){e.target.parentElement.disabled=!0,document.getElementById("server-response").submit()}completePaymentUsingToken(e){e.target.parentElement.disabled=!0,document.getElementById("server-response").submit()}completePaymentWithoutToken(e){e.target.parentElement.disabled=!0;let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.getElementById("server-response").submit()}initialize(){this.eWAY=eWAY.setupSecureField(this.groupFieldConfig,e=>this.securePanelCallback(e))}handle(){var e,t;this.initialize(),(e=document.getElementById("authorize-card"))==null||e.addEventListener("click",r=>this.completeAuthorization(r)),Array.from(document.getElementsByClassName("toggle-payment-with-token")??[]).forEach(r=>r.addEventListener("click",s=>{document.getElementById("eway-secure-panel").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=s.target.dataset.token,document.getElementById("pay-now").disabled=!1})),document.getElementById("toggle-payment-with-credit-card")&&document.getElementById("toggle-payment-with-credit-card").addEventListener("click",r=>{document.getElementById("eway-secure-panel").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="",document.getElementById("pay-now").disabled=!0}),(t=document.getElementById("pay-now"))==null||t.addEventListener("click",r=>document.querySelector("input[name=token]").value?this.completePaymentUsingToken(r):this.completePaymentWithoutToken(r))}}new i().handle(); diff --git a/public/build/assets/forte-ach-payment-2f7fa236.js b/public/build/assets/forte-ach-payment-2f7fa236.js deleted file mode 100644 index faf0f66ed4..0000000000 --- a/public/build/assets/forte-ach-payment-2f7fa236.js +++ /dev/null @@ -1,9 +0,0 @@ -var a=Object.defineProperty;var s=(t,e,n)=>e in t?a(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var o=(t,e,n)=>(s(t,typeof e!="symbol"?e+"":e,n),n);/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://opensource.org/licenses/AAL - */class d{constructor(e){o(this,"handleAuthorization",()=>{var e=document.getElementById("account-number").value,n=document.getElementById("routing-number").value,r={api_login_id:this.apiLoginId,account_number:e,routing_number:n,account_type:"checking"};return document.getElementById("pay-now")&&(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden")),forte.createToken(r).success(this.successResponseHandler).error(this.failedResponseHandler),!1});o(this,"successResponseHandler",e=>(document.getElementById("payment_token").value=e.onetime_token,document.getElementById("server_response").submit(),!1));o(this,"failedResponseHandler",e=>{var n='
  • '+e.response_description+"
";return document.getElementById("forte_errors").innerHTML=n,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden"),!1});o(this,"handle",()=>{let e=document.getElementById("pay-now");return e&&e.addEventListener("click",n=>{this.handleAuthorization()}),this});this.apiLoginId=e}}const u=document.querySelector('meta[name="forte-api-login-id"]').content;new d(u).handle(); diff --git a/public/build/assets/mollie-credit-card-db5c26c6.js b/public/build/assets/mollie-credit-card-db5c26c6.js deleted file mode 100644 index c822f500ba..0000000000 --- a/public/build/assets/mollie-credit-card-db5c26c6.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Invoice Ninja (https://invoiceninja.com). - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class a{constructor(){var e,t;this.mollie=Mollie((e=document.querySelector("meta[name=mollie-profileId]"))==null?void 0:e.content,{testmode:(t=document.querySelector("meta[name=mollie-testmode]"))==null?void 0:t.content,locale:"en_US"})}createCardHolderInput(){let e=this.mollie.createComponent("cardHolder");e.mount("#card-holder");let t=document.getElementById("card-holder-error");return e.addEventListener("change",function(n){n.error&&n.touched?t.textContent=n.error:t.textContent=""}),this}createCardNumberInput(){let e=this.mollie.createComponent("cardNumber");e.mount("#card-number");let t=document.getElementById("card-number-error");return e.addEventListener("change",function(n){n.error&&n.touched?t.textContent=n.error:t.textContent=""}),this}createExpiryDateInput(){let e=this.mollie.createComponent("expiryDate");e.mount("#expiry-date");let t=document.getElementById("expiry-date-error");return e.addEventListener("change",function(n){n.error&&n.touched?t.textContent=n.error:t.textContent=""}),this}createCvvInput(){let e=this.mollie.createComponent("verificationCode");e.mount("#cvv");let t=document.getElementById("cvv-error");return e.addEventListener("change",function(n){n.error&&n.touched?t.textContent=n.error:t.textContent=""}),this}handlePayNowButton(){if(document.getElementById("pay-now").disabled=!0,document.querySelector("input[name=token]").value!=="")return document.querySelector("input[name=gateway_response]").value="",document.getElementById("server-response").submit();this.mollie.createToken().then(function(e){let t=e.token,n=e.error;if(n){document.getElementById("pay-now").disabled=!1;let o=document.getElementById("errors");o.innerText=n.message,o.hidden=!1;return}let r=document.querySelector('input[name="token-billing-checkbox"]:checked');r&&(document.querySelector('input[name="store_card"]').value=r.value),document.querySelector("input[name=gateway_response]").value=t,document.querySelector("input[name=token]").value="",document.getElementById("server-response").submit()})}handle(){this.createCardHolderInput().createCardNumberInput().createExpiryDateInput().createCvvInput(),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(e=>e.addEventListener("click",t=>{document.getElementById("mollie--payment-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=t.target.dataset.token})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",e=>{document.getElementById("mollie--payment-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""}),document.getElementById("pay-now").addEventListener("click",()=>this.handlePayNowButton())}}new a().handle(); diff --git a/public/build/assets/paytrace-credit-card-9cea3700.js b/public/build/assets/paytrace-credit-card-9cea3700.js deleted file mode 100644 index 00c406bb51..0000000000 --- a/public/build/assets/paytrace-credit-card-9cea3700.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Invoice Ninja (https://invoiceninja.com). - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class r{constructor(){var t;this.clientKey=(t=document.querySelector("meta[name=paytrace-client-key]"))==null?void 0:t.content}get creditCardStyles(){return{font_color:"#000",border_color:"#a1b1c9",border_style:"dotted",font_size:"13pt",input_border_radius:"3px",input_border_width:"1px",input_font:"Times New Roman, arial, fantasy",input_font_weight:"400",input_margin:"5px 0px 5px 0px",input_padding:"0px 5px 0px 5px",label_color:"#a0aec0",label_size:"16px",label_width:"150px",label_font:"Times New Roman, sans-serif, serif",label_font_weight:"light",label_margin:"5px 0px 0px 0px",label_padding:"0px 5px 0px 5px",background_color:"white",height:"30px",width:"370px",padding_bottom:"0px"}}get codeStyles(){return{font_color:"#000",border_color:"#a1b1c9",border_style:"dotted",font_size:"13pt",input_border_radius:"2px",input_border_width:"1px",input_font:"serif, cursive, fantasy",input_font_weight:"700",input_margin:"5px 0px 5px 20px",input_padding:"0px 5px 0px 5px",label_color:"#a0aec0",label_size:"16px",label_width:"150px",label_font:"sans-serif, arial, serif",label_font_weight:"bold",label_margin:"5px 0px 0px 20px",label_padding:"2px 5px 2px 5px",background_color:"white",height:"30px",width:"150px",padding_bottom:"2px"}}get expStyles(){return{font_color:"#000",border_color:"#a1b1c9",border_style:"dashed",font_size:"12pt",input_border_radius:"0px",input_border_width:"2px",input_font:"arial, cursive, fantasy",input_font_weight:"400",input_margin:"5px 0px 5px 0px",input_padding:"0px 5px 0px 5px",label_color:"#a0aec0",label_size:"16px",label_width:"150px",label_font:"arial, fantasy, serif",label_font_weight:"normal",label_margin:"5px 0px 0px 0px",label_padding:"2px 5px 2px 5px",background_color:"white",height:"30px",width:"85px",padding_bottom:"2px",type:"dropdown"}}updatePayTraceLabels(){window.PTPayment.getControl("securityCode").label.text(document.querySelector("meta[name=ctrans-cvv]").content),window.PTPayment.getControl("creditCard").label.text(document.querySelector("meta[name=ctrans-card_number]").content),window.PTPayment.getControl("expiration").label.text(document.querySelector("meta[name=ctrans-expires]").content)}setupPayTrace(){return window.PTPayment.setup({styles:{code:this.codeStyles,cc:this.creditCardStyles,exp:this.expStyles},authorization:{clientKey:this.clientKey}})}handlePaymentWithCreditCard(t){t.target.parentElement.disabled=!0,document.getElementById("errors").hidden=!0,window.PTPayment.validate(n=>{if(n.length>=1){let e=document.getElementById("errors");return e.textContent=n[0].description,e.hidden=!1,t.target.parentElement.disabled=!1}this.ptInstance.process().then(e=>{document.getElementById("HPF_Token").value=e.message.hpf_token,document.getElementById("enc_key").value=e.message.enc_key;let a=document.querySelector('input[name="token-billing-checkbox"]:checked');a&&(document.querySelector('input[name="store_card"]').value=a.value),document.getElementById("server_response").submit()}).catch(e=>{document.getElementById("errors").textContent=JSON.stringify(e),document.getElementById("errors").hidden=!1,console.log(e)})})}handlePaymentWithToken(t){t.target.parentElement.disabled=!0,document.getElementById("server_response").submit()}handle(){var t;Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(n=>n.addEventListener("click",e=>{document.getElementById("paytrace--credit-card-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=e.target.dataset.token})),(t=document.getElementById("toggle-payment-with-credit-card"))==null||t.addEventListener("click",n=>{document.getElementById("paytrace--credit-card-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value="",this.setupPayTrace().then(e=>{this.ptInstance=e,this.updatePayTraceLabels()})}),document.getElementById("pay-now").addEventListener("click",n=>document.querySelector("input[name=token]").value===""?this.handlePaymentWithCreditCard(n):this.handlePaymentWithToken(n))}}new r().handle(); diff --git a/public/build/assets/razorpay-aio-3d02ff1d.js b/public/build/assets/razorpay-aio-3d02ff1d.js deleted file mode 100644 index 37774d9fd6..0000000000 --- a/public/build/assets/razorpay-aio-3d02ff1d.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Invoice Ninja (https://invoiceninja.com). - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */var a;let n=JSON.parse((a=document.querySelector("meta[name=razorpay-options]"))==null?void 0:a.content);n.handler=function(e){document.getElementById("razorpay_payment_id").value=e.razorpay_payment_id,document.getElementById("razorpay_signature").value=e.razorpay_signature,document.getElementById("server-response").submit()};n.modal={ondismiss:function(){t.disabled=!1}};let o=new Razorpay(n),t=document.getElementById("pay-now");t.onclick=function(e){t.disabled=!0,o.open()}; diff --git a/public/build/assets/square-credit-card-a20464a3.js b/public/build/assets/square-credit-card-a20464a3.js deleted file mode 100644 index 11597eeaf5..0000000000 --- a/public/build/assets/square-credit-card-a20464a3.js +++ /dev/null @@ -1,9 +0,0 @@ -/** - * Invoice Ninja (https://invoiceninja.com). - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class c{constructor(){this.appId=document.querySelector("meta[name=square-appId]").content,this.locationId=document.querySelector("meta[name=square-locationId]").content,this.isLoaded=!1}async init(){this.payments=Square.payments(this.appId,this.locationId),this.card=await this.payments.card(),await this.card.attach("#card-container"),this.isLoaded=!0;let e=document.querySelector(".sq-card-iframe-container");e&&e.setAttribute("style","150px !important"),document.querySelector(".toggle-payment-with-token")&&document.getElementById("card-container").classList.add("hidden")}async completePaymentWithoutToken(e){document.getElementById("errors").hidden=!0,e.target.parentElement.disabled=!0;let t=await this.card.tokenize(),o;try{const n={amount:document.querySelector("meta[name=amount]").content,billingContact:JSON.parse(document.querySelector("meta[name=square_contact]").content),currencyCode:document.querySelector("meta[name=currencyCode]").content,intent:"CHARGE"};o=(await this.payments.verifyBuyer(t.token,n)).token}catch{e.target.parentElement.disabled=!0}if(document.querySelector('input[name="verificationToken"]').value=o,t.status==="OK"){document.getElementById("sourceId").value=t.token;let n=document.querySelector('input[name="token-billing-checkbox"]:checked');return n&&(document.querySelector('input[name="store_card"]').value=n.value),document.getElementById("server_response").submit()}document.getElementById("errors").textContent=t.errors[0].message,document.getElementById("errors").hidden=!1,e.target.parentElement.disabled=!1}async completePaymentUsingToken(e){return e.target.parentElement.disabled=!0,document.getElementById("server_response").submit()}async verifyBuyer(e){const t={amount:document.querySelector("meta[name=amount]").content,billingContact:document.querySelector("meta[name=square_contact]").content,currencyCode:document.querySelector("meta[name=currencyCode]").content,intent:"CHARGE"};return(await this.payments.verifyBuyer(e,t)).token}async handle(){document.getElementById("payment-list").classList.add("hidden"),await this.init().then(()=>{var e,t,o,n;(e=document.getElementById("authorize-card"))==null||e.addEventListener("click",a=>this.completePaymentWithoutToken(a)),(t=document.getElementById("pay-now"))==null||t.addEventListener("click",a=>document.querySelector("input[name=token]").value?this.completePaymentUsingToken(a):this.completePaymentWithoutToken(a)),Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(a=>a.addEventListener("click",async r=>{document.getElementById("card-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=r.target.dataset.token})),(o=document.getElementById("toggle-payment-with-credit-card"))==null||o.addEventListener("click",async a=>{document.getElementById("card-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""}),document.getElementById("loader").classList.add("hidden"),document.getElementById("payment-list").classList.remove("hidden"),(n=document.getElementById("toggle-payment-with-credit-card"))==null||n.click()})}}new c().handle(); diff --git a/public/build/assets/stripe-alipay-010d5388.js b/public/build/assets/stripe-alipay-010d5388.js deleted file mode 100644 index 0c85224428..0000000000 --- a/public/build/assets/stripe-alipay-010d5388.js +++ /dev/null @@ -1,9 +0,0 @@ -var i=Object.defineProperty;var o=(n,e,t)=>e in n?i(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>(o(n,typeof e!="symbol"?e+"":e,t),t);/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class c{constructor(e,t){s(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));this.key=e,this.stripeConnect=t,this.errors=document.getElementById("errors")}async handle(){document.getElementById("pay-now").addEventListener("click",async e=>{document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden");const{error:t}=await this.stripe.confirmAlipayPayment(document.querySelector("meta[name=ci_intent]").content,{return_url:`${document.querySelector("meta[name=return_url]").content}`});document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),t&&(this.errors.textContent="",this.errors.textContent=result.error.message,this.errors.hidden=!1)})}}wait("#stripe-alipay-payment").then(()=>{var t,r;const n=((t=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:t.content)??"",e=((r=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:r.content)??"";new c(n,e).setupStripe().handle()}); diff --git a/public/build/assets/stripe-bacs-e1cfee99.js b/public/build/assets/stripe-bacs-e1cfee99.js deleted file mode 100644 index b4d5cef67f..0000000000 --- a/public/build/assets/stripe-bacs-e1cfee99.js +++ /dev/null @@ -1,9 +0,0 @@ -var i=Object.defineProperty;var a=(n,e,t)=>e in n?i(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var s=(n,e,t)=>(a(n,typeof e!="symbol"?e+"":e,t),t);import{w as c}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class d{constructor(e,t){s(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));s(this,"payment_data");s(this,"handle",()=>{this.onlyAuthorization?document.getElementById("authorize-bacs").addEventListener("click",e=>{document.getElementById("authorize-bacs").disabled=!0,document.querySelector("#authorize-bacs > svg").classList.remove("hidden"),document.querySelector("#authorize-bacs > span").classList.add("hidden"),location.href=document.querySelector("meta[name=stripe-redirect-url]").content}):(this.payNowButton=document.getElementById("pay-now"),document.getElementById("pay-now").addEventListener("click",e=>{this.payNowButton.disabled=!0,this.payNowButton.querySelector("svg").classList.remove("hidden"),this.payNowButton.querySelector("span").classList.add("hidden"),document.getElementById("server-response").submit()}),this.payment_data=Array.from(document.getElementsByClassName("toggle-payment-with-token")),this.payment_data.length>0?this.payment_data.forEach(e=>e.addEventListener("click",t=>{document.querySelector("input[name=token]").value=t.target.dataset.token})):(this.errors.textContent=document.querySelector("meta[name=translation-payment-method-required]").content,this.errors.hidden=!1,this.payNowButton.disabled=!0,this.payNowButton.querySelector("span").classList.remove("hidden"),this.payNowButton.querySelector("svg").classList.add("hidden")))});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t,this.onlyAuthorization=onlyAuthorization}}c("#stripe-bacs-payment").then(()=>{var t,o,r;const n=((t=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:t.content)??"",e=((o=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:o.content)??"";(r=document.querySelector('meta[name="only-authorization"]'))==null||r.content,new d(n,e).setupStripe().handle()}); diff --git a/public/build/assets/stripe-bancontact-743204e1.js b/public/build/assets/stripe-bancontact-743204e1.js deleted file mode 100644 index 13347096a6..0000000000 --- a/public/build/assets/stripe-bancontact-743204e1.js +++ /dev/null @@ -1,9 +0,0 @@ -var c=Object.defineProperty;var s=(n,t,e)=>t in n?c(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var r=(n,t,e)=>(s(n,typeof t!="symbol"?t+"":t,e),e);import{w as a}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class i{constructor(t,e){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(!document.getElementById("bancontact-name").value){e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1,console.log("name");return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmBancontactPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{billing_details:{name:document.getElementById("bancontact-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}a("#stripe-bancontact-payment").then(()=>{var e,o;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((o=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:o.content)??"";new i(n,t).setupStripe().handle()}); diff --git a/public/build/assets/stripe-bank-transfer-801a4de6.js b/public/build/assets/stripe-bank-transfer-801a4de6.js deleted file mode 100644 index 7ab3e60f09..0000000000 --- a/public/build/assets/stripe-bank-transfer-801a4de6.js +++ /dev/null @@ -1,9 +0,0 @@ -import{w as u}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com). - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */u("#stripe-bank-transfer-payment").then(()=>p());function p(){var r,o,s;const c=(r=document.querySelector('meta[name="stripe-client-secret"]'))==null?void 0:r.content,m=(o=document.querySelector('meta[name="stripe-return-url"]'))==null?void 0:o.content,i={clientSecret:c,appearance:{theme:"stripe",variables:{colorPrimary:"#0570de",colorBackground:"#ffffff",colorText:"#30313d",colorDanger:"#df1b41",fontFamily:"Ideal Sans, system-ui, sans-serif",spacingUnit:"2px",borderRadius:"4px"}}},e=Stripe(document.querySelector('meta[name="stripe-publishable-key"]').getAttribute("content")),t=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";t&&(e.stripeAccount=t);const n=e.elements(i);n.create("payment").mount("#payment-element"),document.getElementById("payment-form").addEventListener("submit",async d=>{d.preventDefault(),document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden");const{error:a}=await e.confirmPayment({elements:n,confirmParams:{return_url:m}});if(a){document.getElementById("pay-now").disabled=!1,document.querySelector("svg").classList.remove("hidden"),document.querySelector("span").classList.add("hidden");const l=document.querySelector("#errors");l.textContent=a.message}})} diff --git a/public/build/assets/stripe-becs-ce05fb09.js b/public/build/assets/stripe-becs-ce05fb09.js deleted file mode 100644 index d930c4350b..0000000000 --- a/public/build/assets/stripe-becs-ce05fb09.js +++ /dev/null @@ -1,9 +0,0 @@ -var a=Object.defineProperty;var c=(n,t,e)=>t in n?a(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>(c(n,typeof t!="symbol"?t+"":t,e),e);import{w as r}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class d{constructor(t,e){o(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);const t=this.stripe.elements(),s={style:{base:{color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"},":-webkit-autofill":{color:"#32325d"}},invalid:{color:"#fa755a",iconColor:"#fa755a",":-webkit-autofill":{color:"#fa755a"}}},disabled:!1,hideIcon:!1,iconStyle:"default"};return this.auBankAccount=t.create("auBankAccount",s),this.auBankAccount.mount("#becs-iban"),this});o(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(document.getElementById("becs-name").value===""){document.getElementById("becs-name").focus(),e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}if(document.getElementById("becs-email-address").value===""){document.getElementById("becs-email-address").focus(),e.textContent=document.querySelector("meta[name=translation-email-required]").content,e.hidden=!1;return}if(!document.getElementById("becs-mandate-acceptance").checked){document.getElementById("becs-mandate-acceptance").focus(),e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1,console.log("Terms");return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmAuBecsDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{au_becs_debit:this.auBankAccount,billing_details:{name:document.getElementById("becs-name").value,email:document.getElementById("becs-email-address").value}}}).then(s=>s.error?this.handleFailure(s.error.message):this.handleSuccess(s))})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}handleSuccess(t){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(t.paymentIntent),document.getElementById("server-response").submit()}handleFailure(t){let e=document.getElementById("errors");e.textContent="",e.textContent=t,e.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}r("#stripe-becs-payment").then(()=>{var e,s;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";new d(n,t).setupStripe().handle()}); diff --git a/public/build/assets/stripe-browserpay-813e625e.js b/public/build/assets/stripe-browserpay-813e625e.js deleted file mode 100644 index b13f13db82..0000000000 --- a/public/build/assets/stripe-browserpay-813e625e.js +++ /dev/null @@ -1,9 +0,0 @@ -import{w as a}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com). - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class o{constructor(){var e;this.clientSecret=(e=document.querySelector("meta[name=stripe-pi-client-secret]"))==null?void 0:e.content}init(){var t,n;let e={};return document.querySelector("meta[name=stripe-account-id]")&&(e.apiVersion="2020-08-27",e.stripeAccount=(t=document.querySelector("meta[name=stripe-account-id]"))==null?void 0:t.content),this.stripe=Stripe((n=document.querySelector("meta[name=stripe-publishable-key]"))==null?void 0:n.content,e),this.elements=this.stripe.elements(),this}createPaymentRequest(){return this.paymentRequest=this.stripe.paymentRequest(JSON.parse(document.querySelector("meta[name=payment-request-data").content)),this}createPaymentRequestButton(){this.paymentRequestButton=this.elements.create("paymentRequestButton",{paymentRequest:this.paymentRequest})}handlePaymentRequestEvents(e,t){document.querySelector("#errors").hidden=!0,this.paymentRequest.on("paymentmethod",function(n){e.confirmCardPayment(t,{payment_method:n.paymentMethod.id},{handleActions:!1}).then(function(r){r.error?(document.querySelector("#errors").innerText=r.error.message,document.querySelector("#errors").hidden=!1,n.complete("fail")):(n.complete("success"),r.paymentIntent.status==="requires_action"?e.confirmCardPayment(t).then(function(s){s.error?(n.complete("fail"),document.querySelector("#errors").innerText=s.error.message,document.querySelector("#errors").hidden=!1):(document.querySelector('input[name="gateway_response"]').value=JSON.stringify(s.paymentIntent),document.getElementById("server-response").submit())}):(document.querySelector('input[name="gateway_response"]').value=JSON.stringify(r.paymentIntent),document.getElementById("server-response").submit()))})})}handle(){this.init().createPaymentRequest().createPaymentRequestButton(),this.paymentRequest.canMakePayment().then(e=>{var t;if(e)return this.paymentRequestButton.mount("#payment-request-button");document.querySelector("#errors").innerHTML=JSON.parse((t=document.querySelector("meta[name=no-available-methods]"))==null?void 0:t.content),document.querySelector("#errors").hidden=!1}),this.handlePaymentRequestEvents(this.stripe,this.clientSecret)}}a("#stripe-browserpay-payment").then(()=>new o().handle()); diff --git a/public/build/assets/stripe-credit-card-f3658509.js b/public/build/assets/stripe-credit-card-f3658509.js deleted file mode 100644 index df86788972..0000000000 --- a/public/build/assets/stripe-credit-card-f3658509.js +++ /dev/null @@ -1,9 +0,0 @@ -import{w as l}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class c{constructor(e,t,n,r){this.key=e,this.secret=t,this.onlyAuthorization=n,this.stripeConnect=r}setupStripe(){return this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this.elements=this.stripe.elements(),this}createElement(){var e;return this.cardElement=this.elements.create("card",{hidePostalCode:((e=document.querySelector("meta[name=stripe-require-postal-code]"))==null?void 0:e.content)==="0",value:{postalCode:document.querySelector("meta[name=client-postal-code]").content},hideIcon:!1}),this}mountCardElement(){return this.cardElement.mount("#card-element"),this}completePaymentUsingToken(){let e=document.querySelector("input[name=token]").value,t=document.getElementById("pay-now");this.payNowButton=t,this.payNowButton.disabled=!0,this.payNowButton.querySelector("svg").classList.remove("hidden"),this.payNowButton.querySelector("span").classList.add("hidden"),this.stripe.handleCardPayment(this.secret,{payment_method:e}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n))}completePaymentWithoutToken(){let e=document.getElementById("pay-now");this.payNowButton=e,this.payNowButton.disabled=!0,this.payNowButton.querySelector("svg").classList.remove("hidden"),this.payNowButton.querySelector("span").classList.add("hidden");let t=document.getElementById("cardholder-name");this.stripe.handleCardPayment(this.secret,this.cardElement,{payment_method_data:{billing_details:{name:t.value}}}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n))}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent);let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.getElementById("server-response").submit()}handleFailure(e){let t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,this.payNowButton.disabled=!1,this.payNowButton.querySelector("svg").classList.add("hidden"),this.payNowButton.querySelector("span").classList.remove("hidden")}handleAuthorization(){let e=document.getElementById("cardholder-name"),t=document.getElementById("authorize-card");this.payNowButton=t,this.payNowButton.disabled=!0,this.payNowButton.querySelector("svg").classList.remove("hidden"),this.payNowButton.querySelector("span").classList.add("hidden"),this.stripe.handleCardSetup(this.secret,this.cardElement,{payment_method_data:{billing_details:{name:e.value}}}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccessfulAuthorization(n))}handleSuccessfulAuthorization(e){document.getElementById("gateway_response").value=JSON.stringify(e.setupIntent),document.getElementById("server_response").submit()}handle(){this.setupStripe(),this.onlyAuthorization?(this.createElement().mountCardElement(),document.getElementById("authorize-card").addEventListener("click",()=>this.handleAuthorization())):(Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(e=>e.addEventListener("click",t=>{document.getElementById("stripe--payment-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=t.target.dataset.token})),document.getElementById("toggle-payment-with-credit-card").addEventListener("click",e=>{document.getElementById("stripe--payment-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""}),this.createElement().mountCardElement(),document.getElementById("pay-now").addEventListener("click",()=>{try{return document.querySelector("input[name=token]").value?this.completePaymentUsingToken():this.completePaymentWithoutToken()}catch(e){console.log(e.message)}}))}}l("#stripe-credit-card-payment").then(()=>{var a,s,i,d;const o=((a=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:a.content)??"",e=((s=document.querySelector('meta[name="stripe-secret"]'))==null?void 0:s.content)??"",t=((i=document.querySelector('meta[name="only-authorization"]'))==null?void 0:i.content)??"",n=((d=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:d.content)??"";new c(o,e,t,n).handle()}); diff --git a/public/build/assets/stripe-eps-735c10bd.js b/public/build/assets/stripe-eps-735c10bd.js deleted file mode 100644 index 5bbd7d09c8..0000000000 --- a/public/build/assets/stripe-eps-735c10bd.js +++ /dev/null @@ -1,9 +0,0 @@ -var o=Object.defineProperty;var i=(n,t,e)=>t in n?o(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var s=(n,t,e)=>(i(n,typeof t!="symbol"?t+"":t,e),e);import{w as a}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class c{constructor(t,e){s(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let t=this.stripe.elements();var e={style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}};return this.eps=t.create("epsBank",e),this.eps.mount("#eps-bank-element"),this});s(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(!document.getElementById("eps-name").value){e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmEpsPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{eps:this.eps,billing_details:{name:document.getElementById("eps-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}a("#stripe-eps-payment").then(()=>{var e,r;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((r=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:r.content)??"";new c(n,t).setupStripe().handle()}); diff --git a/public/build/assets/stripe-fpx-d93f7d79.js b/public/build/assets/stripe-fpx-d93f7d79.js deleted file mode 100644 index 4ba34ef6b4..0000000000 --- a/public/build/assets/stripe-fpx-d93f7d79.js +++ /dev/null @@ -1,9 +0,0 @@ -var o=Object.defineProperty;var i=(n,t,e)=>t in n?o(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var r=(n,t,e)=>(i(n,typeof t!="symbol"?t+"":t,e),e);import{w as a}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class c{constructor(t,e){r(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let t=this.stripe.elements(),e={base:{padding:"10px 12px",color:"#32325d",fontSize:"16px"}};return this.fpx=t.create("fpxBank",{style:e,accountHolderType:"individual"}),this.fpx.mount("#fpx-bank-element"),this});r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmFpxPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{fpx:this.fpx},return_url:document.querySelector('meta[name="return-url"]').content}).then(e=>{e.error&&this.handleFailure(e.error.message)})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}handleFailure(t){let e=document.getElementById("errors");e.textContent="",e.textContent=t,e.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}}a("#stripe-fpx-payment").then(()=>{var e,s;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((s=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:s.content)??"";new c(n,t).setupStripe().handle()}); diff --git a/public/build/assets/stripe-giropay-bff9b7b5.js b/public/build/assets/stripe-giropay-bff9b7b5.js deleted file mode 100644 index 8c1ac225f8..0000000000 --- a/public/build/assets/stripe-giropay-bff9b7b5.js +++ /dev/null @@ -1,9 +0,0 @@ -var s=Object.defineProperty;var i=(n,t,e)=>t in n?s(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var r=(n,t,e)=>(i(n,typeof t!="symbol"?t+"":t,e),e);import{w as c}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class a{constructor(t,e){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(!document.getElementById("giropay-mandate-acceptance").checked){e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1,console.log("Terms");return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmGiropayPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{billing_details:{name:document.getElementById("giropay-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}c("#stripe-giropay-payment").then(()=>{var e,o;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((o=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:o.content)??"";new a(n,t).setupStripe().handle()}); diff --git a/public/build/assets/stripe-ideal-22b9f5cf.js b/public/build/assets/stripe-ideal-22b9f5cf.js deleted file mode 100644 index 7715c89001..0000000000 --- a/public/build/assets/stripe-ideal-22b9f5cf.js +++ /dev/null @@ -1,9 +0,0 @@ -var s=Object.defineProperty;var o=(n,t,e)=>t in n?s(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var r=(n,t,e)=>(o(n,typeof t!="symbol"?t+"":t,e),e);import{w as a}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class l{constructor(t,e){r(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let t=this.stripe.elements();var e={style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}};return this.ideal=t.create("idealBank",e),this.ideal.mount("#ideal-bank-element"),this});r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(!document.getElementById("ideal-name").value){e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1,console.log("name");return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmIdealPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{ideal:this.ideal,billing_details:{name:document.getElementById("ideal-name").value}},return_url:document.querySelector('meta[name="return-url"]').content})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}a("#stripe-ideal-payment").then(()=>{var e,i;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((i=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:i.content)??"";new l(n,t).setupStripe().handle()}); diff --git a/public/build/assets/stripe-klarna-9ee067e7.js b/public/build/assets/stripe-klarna-9ee067e7.js deleted file mode 100644 index 2d19995fb9..0000000000 --- a/public/build/assets/stripe-klarna-9ee067e7.js +++ /dev/null @@ -1,9 +0,0 @@ -var s=Object.defineProperty;var c=(n,e,t)=>e in n?s(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var o=(n,e,t)=>(c(n,typeof e!="symbol"?e+"":e,t),t);import{w as m}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class d{constructor(e,t){o(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));o(this,"handleError",e=>{document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden"),this.errors.textContent="",this.errors.textContent=e,this.errors.hidden=!1});o(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",e=>{let t=document.getElementById("errors"),r=document.getElementById("klarna-name").value;/^[A-Za-z\s]*$/.test(r)?(document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmKlarnaPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{billing_details:{name:r,email:document.querySelector("meta[name=email]").content,address:{line1:document.querySelector("meta[name=address-1]").content,line2:document.querySelector("meta[name=address-2]").content,city:document.querySelector("meta[name=city]").content,postal_code:document.querySelector("meta[name=postal_code]").content,state:document.querySelector("meta[name=state]").content,country:document.querySelector("meta[name=country]").content}}},return_url:document.querySelector('meta[name="return-url"]').content}).then(a=>{if(a.hasOwnProperty("error"))return this.handleError(a.error.message)})):(document.getElementById("klarna-name-correction").hidden=!1,document.getElementById("klarna-name").textContent=r.replace(/^[A-Za-z\s]*$/,""),document.getElementById("klarna-name").focus(),t.textContent=document.querySelector("meta[name=translation-name-without-special-characters]").content,t.hidden=!1)})});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}}m("#stripe-klarna-payment").then(()=>{var t,r;const n=((t=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:t.content)??"",e=((r=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:r.content)??"";new d(n,e).setupStripe().handle()}); diff --git a/public/build/assets/stripe-przelewy24-7f03b69e.js b/public/build/assets/stripe-przelewy24-7f03b69e.js deleted file mode 100644 index 9071abf9f3..0000000000 --- a/public/build/assets/stripe-przelewy24-7f03b69e.js +++ /dev/null @@ -1,9 +0,0 @@ -var r=Object.defineProperty;var c=(n,t,e)=>t in n?r(n,t,{enumerable:!0,configurable:!0,writable:!0,value:e}):n[t]=e;var o=(n,t,e)=>(c(n,typeof t!="symbol"?t+"":t,e),e);import{w as d}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class s{constructor(t,e){o(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);let t=this.stripe.elements();var e={style:{base:{padding:"10px 12px",color:"#32325d",fontSize:"16px","::placeholder":{color:"#aab7c4"}}}};return this.p24bank=t.create("p24Bank",e),this.p24bank.mount("#p24-bank-element"),this});o(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",t=>{let e=document.getElementById("errors");if(document.getElementById("p24-name").value===""){document.getElementById("p24-name").focus(),e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}if(document.getElementById("p24-email-address").value===""){document.getElementById("p24-email-address").focus(),e.textContent=document.querySelector("meta[name=translation-email-required]").content,e.hidden=!1;return}if(!document.getElementById("p24-mandate-acceptance").checked){document.getElementById("p24-mandate-acceptance").focus(),e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1;return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmP24Payment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{p24:this.p24bank,billing_details:{name:document.getElementById("p24-name").value,email:document.getElementById("p24-email-address").value}},payment_method_options:{p24:{tos_shown_and_accepted:document.getElementById("p24-mandate-acceptance").checked}},return_url:document.querySelector('meta[name="return-url"]').content}).then(function(a){a.error?(e.textContent=a.error.message,e.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")):a.paymentIntent.status==="succeeded"&&(window.location=document.querySelector('meta[name="return-url"]').content)})})});this.key=t,this.errors=document.getElementById("errors"),this.stripeConnect=e}}d("#stripe-przelewy24-payment").then(()=>{var e,a;const n=((e=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:e.content)??"",t=((a=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:a.content)??"";new s(n,t).setupStripe().handle()}); diff --git a/public/build/assets/stripe-sepa-554f6dfd.js b/public/build/assets/stripe-sepa-554f6dfd.js deleted file mode 100644 index 32af728f43..0000000000 --- a/public/build/assets/stripe-sepa-554f6dfd.js +++ /dev/null @@ -1,9 +0,0 @@ -var r=Object.defineProperty;var c=(a,e,t)=>e in a?r(a,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):a[e]=t;var o=(a,e,t)=>(c(a,typeof e!="symbol"?e+"":e,t),t);import{w as s}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class i{constructor(e,t){o(this,"setupStripe",()=>{this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key);const e=this.stripe.elements();var t={base:{color:"#32325d",fontFamily:'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif',fontSmoothing:"antialiased",fontSize:"16px","::placeholder":{color:"#aab7c4"},":-webkit-autofill":{color:"#32325d"}},invalid:{color:"#fa755a",iconColor:"#fa755a",":-webkit-autofill":{color:"#fa755a"}}},n={style:t,supportedCountries:["SEPA"],placeholderCountry:document.querySelector('meta[name="country"]').content};return this.iban=e.create("iban",n),this.iban.mount("#sepa-iban"),document.getElementById("sepa-name").value=document.querySelector("meta[name=client_name]").content,document.getElementById("sepa-email-address").value=document.querySelector("meta[name=client_email]").content,this});o(this,"handle",()=>{let e=document.getElementById("errors");Array.from(document.getElementsByClassName("toggle-payment-with-token")).forEach(t=>t.addEventListener("click",n=>{document.getElementById("stripe--payment-container").classList.add("hidden"),document.getElementById("save-card--container").style.display="none",document.querySelector("input[name=token]").value=n.target.dataset.token})),document.getElementById("toggle-payment-with-new-bank-account").addEventListener("click",t=>{document.getElementById("stripe--payment-container").classList.remove("hidden"),document.getElementById("save-card--container").style.display="grid",document.querySelector("input[name=token]").value=""}),document.getElementById("pay-now").addEventListener("click",t=>{if(document.querySelector("input[name=token]").value.length!==0)document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmSepaDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:document.querySelector("input[name=token]").value}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n));else{if(document.getElementById("sepa-name").value===""){document.getElementById("sepa-name").focus(),e.textContent=document.querySelector("meta[name=translation-name-required]").content,e.hidden=!1;return}if(document.getElementById("sepa-email-address").value===""){document.getElementById("sepa-email-address").focus(),e.textContent=document.querySelector("meta[name=translation-email-required]").content,e.hidden=!1;return}if(!document.getElementById("sepa-mandate-acceptance").checked){e.textContent=document.querySelector("meta[name=translation-terms-required]").content,e.hidden=!1;return}document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmSepaDebitPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{sepa_debit:this.iban,billing_details:{name:document.getElementById("sepa-name").value,email:document.getElementById("sepa-email-address").value}}}).then(n=>n.error?this.handleFailure(n.error.message):this.handleSuccess(n))}})});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent);let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.querySelector("input[name=token]").value.length>2&&(document.querySelector('input[name="store_card"]').value=!1),document.getElementById("server-response").submit()}handleFailure(e){let t=document.getElementById("errors");t.textContent="",t.textContent=e,t.hidden=!1,document.getElementById("pay-now").disabled=!1,document.querySelector("#pay-now > svg").classList.add("hidden"),document.querySelector("#pay-now > span").classList.remove("hidden")}handleSuccess(e){document.querySelector('input[name="gateway_response"]').value=JSON.stringify(e.paymentIntent);let t=document.querySelector('input[name="token-billing-checkbox"]:checked');t&&(document.querySelector('input[name="store_card"]').value=t.value),document.getElementById("server-response").submit()}}s("#stripe-sepa-payment").then(()=>{var t,n;const a=((t=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:t.content)??"",e=((n=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:n.content)??"";new i(a,e).setupStripe().handle()}); diff --git a/public/build/assets/stripe-sofort-6e4e7148.js b/public/build/assets/stripe-sofort-6e4e7148.js deleted file mode 100644 index 59ebc243fe..0000000000 --- a/public/build/assets/stripe-sofort-6e4e7148.js +++ /dev/null @@ -1,9 +0,0 @@ -var s=Object.defineProperty;var c=(n,e,t)=>e in n?s(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var r=(n,e,t)=>(c(n,typeof e!="symbol"?e+"":e,t),t);import{w as i}from"./wait-8f4ae121.js";/** - * Invoice Ninja (https://invoiceninja.com) - * - * @link https://github.com/invoiceninja/invoiceninja source repository - * - * @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com) - * - * @license https://www.elastic.co/licensing/elastic-license - */class u{constructor(e,t){r(this,"setupStripe",()=>(this.stripeConnect?this.stripe=Stripe(this.key,{stripeAccount:this.stripeConnect}):this.stripe=Stripe(this.key),this));r(this,"handle",()=>{document.getElementById("pay-now").addEventListener("click",e=>{document.getElementById("pay-now").disabled=!0,document.querySelector("#pay-now > svg").classList.remove("hidden"),document.querySelector("#pay-now > span").classList.add("hidden"),this.stripe.confirmSofortPayment(document.querySelector("meta[name=pi-client-secret").content,{payment_method:{sofort:{country:document.querySelector('meta[name="country"]').content}},return_url:document.querySelector('meta[name="return-url"]').content})})});this.key=e,this.errors=document.getElementById("errors"),this.stripeConnect=t}}i("#stripe-sofort-payment").then(()=>{var t,o;const n=((t=document.querySelector('meta[name="stripe-publishable-key"]'))==null?void 0:t.content)??"",e=((o=document.querySelector('meta[name="stripe-account-id"]'))==null?void 0:o.content)??"";new u(n,e).setupStripe().handle()}); diff --git a/public/build/manifest.json b/public/build/manifest.json index c423e56ed5..49ba6724ce 100644 --- a/public/build/manifest.json +++ b/public/build/manifest.json @@ -8,6 +8,9 @@ "__commonjsHelpers-725317a4.js" ] }, + "_simple-card-4314d842.js": { + "file": "assets/simple-card-4314d842.js" + }, "_wait-8f4ae121.js": { "file": "assets/wait-8f4ae121.js" }, @@ -67,15 +70,16 @@ "src": "resources/js/clients/payment_methods/wepay-bank-account.js" }, "resources/js/clients/payments/authorize-credit-card-payment.js": { - "file": "assets/authorize-credit-card-payment-5206050e.js", + "file": "assets/authorize-credit-card-payment-f92567bc.js", "imports": [ + "_simple-card-4314d842.js", "_wait-8f4ae121.js" ], "isEntry": true, "src": "resources/js/clients/payments/authorize-credit-card-payment.js" }, "resources/js/clients/payments/braintree-credit-card.js": { - "file": "assets/braintree-credit-card-2ba935f9.js", + "file": "assets/braintree-credit-card-60bd8878.js", "imports": [ "_wait-8f4ae121.js" ], @@ -99,37 +103,63 @@ "src": "resources/js/clients/payments/checkout-credit-card.js" }, "resources/js/clients/payments/eway-credit-card.js": { - "file": "assets/eway-credit-card-62ce5f3b.js", + "file": "assets/eway-credit-card-0119725d.js", + "imports": [ + "_wait-8f4ae121.js" + ], "isEntry": true, "src": "resources/js/clients/payments/eway-credit-card.js" }, "resources/js/clients/payments/forte-ach-payment.js": { - "file": "assets/forte-ach-payment-2f7fa236.js", + "file": "assets/forte-ach-payment-546428ee.js", + "imports": [ + "_wait-8f4ae121.js" + ], "isEntry": true, "src": "resources/js/clients/payments/forte-ach-payment.js" }, "resources/js/clients/payments/forte-credit-card-payment.js": { +<<<<<<< HEAD "file": "assets/forte-credit-card-payment-7bb15431.js", +======= + "file": "assets/forte-credit-card-payment-3ff75b59.js", + "imports": [ + "_wait-8f4ae121.js", + "_simple-card-4314d842.js" + ], +>>>>>>> fb57d4d9de (Improve new flow) "isEntry": true, "src": "resources/js/clients/payments/forte-credit-card-payment.js" }, "resources/js/clients/payments/mollie-credit-card.js": { - "file": "assets/mollie-credit-card-db5c26c6.js", + "file": "assets/mollie-credit-card-d81afbd4.js", + "imports": [ + "_wait-8f4ae121.js" + ], "isEntry": true, "src": "resources/js/clients/payments/mollie-credit-card.js" }, "resources/js/clients/payments/paytrace-credit-card.js": { - "file": "assets/paytrace-credit-card-9cea3700.js", + "file": "assets/paytrace-credit-card-7f87b811.js", + "imports": [ + "_wait-8f4ae121.js" + ], "isEntry": true, "src": "resources/js/clients/payments/paytrace-credit-card.js" }, "resources/js/clients/payments/razorpay-aio.js": { - "file": "assets/razorpay-aio-3d02ff1d.js", + "file": "assets/razorpay-aio-f8e8c7f0.js", + "imports": [ + "_wait-8f4ae121.js" + ], "isEntry": true, "src": "resources/js/clients/payments/razorpay-aio.js" }, "resources/js/clients/payments/square-credit-card.js": { - "file": "assets/square-credit-card-a20464a3.js", + "file": "assets/square-credit-card-2fc5c3fa.js", + "imports": [ + "_wait-8f4ae121.js" + ], "isEntry": true, "src": "resources/js/clients/payments/square-credit-card.js" }, @@ -155,12 +185,15 @@ "src": "resources/js/clients/payments/stripe-acss.js" }, "resources/js/clients/payments/stripe-alipay.js": { - "file": "assets/stripe-alipay-010d5388.js", + "file": "assets/stripe-alipay-1457b63d.js", + "imports": [ + "_wait-8f4ae121.js" + ], "isEntry": true, "src": "resources/js/clients/payments/stripe-alipay.js" }, "resources/js/clients/payments/stripe-bacs.js": { - "file": "assets/stripe-bacs-e1cfee99.js", + "file": "assets/stripe-bacs-c9a61b93.js", "imports": [ "_wait-8f4ae121.js" ], @@ -168,7 +201,7 @@ "src": "resources/js/clients/payments/stripe-bacs.js" }, "resources/js/clients/payments/stripe-bancontact.js": { - "file": "assets/stripe-bancontact-743204e1.js", + "file": "assets/stripe-bancontact-4a0d7a40.js", "imports": [ "_wait-8f4ae121.js" ], @@ -176,7 +209,7 @@ "src": "resources/js/clients/payments/stripe-bancontact.js" }, "resources/js/clients/payments/stripe-bank-transfer.js": { - "file": "assets/stripe-bank-transfer-801a4de6.js", + "file": "assets/stripe-bank-transfer-4ab58b35.js", "imports": [ "_wait-8f4ae121.js" ], @@ -184,7 +217,7 @@ "src": "resources/js/clients/payments/stripe-bank-transfer.js" }, "resources/js/clients/payments/stripe-becs.js": { - "file": "assets/stripe-becs-ce05fb09.js", + "file": "assets/stripe-becs-483b1b23.js", "imports": [ "_wait-8f4ae121.js" ], @@ -192,7 +225,7 @@ "src": "resources/js/clients/payments/stripe-becs.js" }, "resources/js/clients/payments/stripe-browserpay.js": { - "file": "assets/stripe-browserpay-813e625e.js", + "file": "assets/stripe-browserpay-c23582f0.js", "imports": [ "_wait-8f4ae121.js" ], @@ -200,7 +233,7 @@ "src": "resources/js/clients/payments/stripe-browserpay.js" }, "resources/js/clients/payments/stripe-credit-card.js": { - "file": "assets/stripe-credit-card-f3658509.js", + "file": "assets/stripe-credit-card-5487be17.js", "imports": [ "_wait-8f4ae121.js" ], @@ -208,7 +241,7 @@ "src": "resources/js/clients/payments/stripe-credit-card.js" }, "resources/js/clients/payments/stripe-eps.js": { - "file": "assets/stripe-eps-735c10bd.js", + "file": "assets/stripe-eps-0c461508.js", "imports": [ "_wait-8f4ae121.js" ], @@ -216,7 +249,7 @@ "src": "resources/js/clients/payments/stripe-eps.js" }, "resources/js/clients/payments/stripe-fpx.js": { - "file": "assets/stripe-fpx-d93f7d79.js", + "file": "assets/stripe-fpx-c82fd7dc.js", "imports": [ "_wait-8f4ae121.js" ], @@ -224,7 +257,7 @@ "src": "resources/js/clients/payments/stripe-fpx.js" }, "resources/js/clients/payments/stripe-giropay.js": { - "file": "assets/stripe-giropay-bff9b7b5.js", + "file": "assets/stripe-giropay-aedb4a64.js", "imports": [ "_wait-8f4ae121.js" ], @@ -232,7 +265,7 @@ "src": "resources/js/clients/payments/stripe-giropay.js" }, "resources/js/clients/payments/stripe-ideal.js": { - "file": "assets/stripe-ideal-22b9f5cf.js", + "file": "assets/stripe-ideal-95836518.js", "imports": [ "_wait-8f4ae121.js" ], @@ -240,7 +273,7 @@ "src": "resources/js/clients/payments/stripe-ideal.js" }, "resources/js/clients/payments/stripe-klarna.js": { - "file": "assets/stripe-klarna-9ee067e7.js", + "file": "assets/stripe-klarna-93dcc6f1.js", "imports": [ "_wait-8f4ae121.js" ], @@ -248,7 +281,7 @@ "src": "resources/js/clients/payments/stripe-klarna.js" }, "resources/js/clients/payments/stripe-przelewy24.js": { - "file": "assets/stripe-przelewy24-7f03b69e.js", + "file": "assets/stripe-przelewy24-5db060c5.js", "imports": [ "_wait-8f4ae121.js" ], @@ -256,7 +289,7 @@ "src": "resources/js/clients/payments/stripe-przelewy24.js" }, "resources/js/clients/payments/stripe-sepa.js": { - "file": "assets/stripe-sepa-554f6dfd.js", + "file": "assets/stripe-sepa-9ab85221.js", "imports": [ "_wait-8f4ae121.js" ], @@ -264,7 +297,7 @@ "src": "resources/js/clients/payments/stripe-sepa.js" }, "resources/js/clients/payments/stripe-sofort.js": { - "file": "assets/stripe-sofort-6e4e7148.js", + "file": "assets/stripe-sofort-fbef42bb.js", "imports": [ "_wait-8f4ae121.js" ],