!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="/codesoup/wp-content/plugins/cs-invoice-plugin/dist/",n(n.s=9)}([function(e,t){e.exports=jQuery},function(e,t,n){"use strict";(function(e){t.a=function(){e(document).on("carbonFields.apiLoaded",(function(t,n){e(document).on("carbonFields.fieldUpdated",(function(t,n){let i=t.target.activeElement;if("number"===i.type&&n.includes("inv_item_")){let t,n=i.closest(".fields-container"),o=e(n).find(".inv-item-amount input"),u=e(n).find(".inv-item-quantity input").val(),a=e(n).find(".inv-item-rate input").val();t=u*a-u*a*(e(n).find(".inv-item-discount input").val()/100),t=Math.round(100*(t+Number.EPSILON))/100,o.val(t)}}))}))}}).call(this,n(0))},function(e,t,n){"use strict";(function(e){t.a=function(){const t=e("[name=_inv_date]")[0],n=e("[name=_inv_due_date]")[0],i=e("[name=_inv_net_period]"),o=i[0],u=flatpickr(n,{onClose:function(e,t,n){o.value=a()}});flatpickr(t,{onReady:function(e){0===e.length&&(t.value=(new Date).toISOString().slice(0,10)),u.set("minDate",t.value)},onClose:function(e,n,i){u.set("minDate",n),""!==t.value&&(o.value=a())}});function a(){let e=new Date(n.value)-new Date(t.value);return Math.floor(e/864e5)}i.on("change",(function(e){let n=e.currentTarget.value,i=new Date(t.value).addDays(parseInt(n)).toISOString().slice(0,10);u.setDate(i)})),Date.prototype.addDays=function(e){let t=new Date(this.valueOf());return t.setDate(t.getDate()+e),t}}}).call(this,n(0))},,,,,,,function(e,t,n){e.exports=n(10)},function(e,t,n){"use strict";n.r(t),function(e){var t=n(1),i=n(2);document.addEventListener("DOMContentLoaded",()=>{e(".carbon-date").find("button").remove(),Object(i.a)()}),Object(t.a)()}.call(this,n(0))}]);