document.addEventListener("DOMContentLoaded",function(e){var n,o,a,r,i,l,t=document.querySelectorAll(".invoice-item-price"),c=document.querySelectorAll(".invoice-item-qty"),u=document.querySelectorAll(".date-picker"),t=(document.querySelector(".invoice-date"),document.querySelector(".due-date"),t&&t.forEach(function(t){t&&t.addEventListener("input",e=>{t.value=formatNumeral(e.target.value,{delimiter:"",numeral:!0})})}),c&&c.forEach(function(t){t&&t.addEventListener("input",e=>{t.value=formatNumeral(e.target.value,{delimiter:"",numeral:!0})})}),u&&u.forEach(function(e){e.flatpickr({monthSelectorType:"static"})}),$(".btn-apply-changes")),c=$(".source-item"),p={"App Design":"Designed UI kit & app pages.","App Customization":"Customization & Bug Fixes.","ABC Template":"Bootstrap 4 admin template.","App Development":"Native App Development."};function s(e,t){e.closest(".repeater-wrapper").find(t).text(e.val())}$(document).on("click",".tax-select",function(e){e.stopPropagation()}),t.length&&$(document).on("click",".btn-apply-changes",function(e){var t=$(this);i=t.closest(".dropdown-menu").find("#taxInput1"),l=t.closest(".dropdown-menu").find("#taxInput2"),r=t.closest(".dropdown-menu").find("#discountInput"),o=t.closest(".repeater-wrapper").find(".tax-1"),a=t.closest(".repeater-wrapper").find(".tax-2"),n=$(".discount"),null!==i.val()&&s(i,o),null!==l.val()&&s(l,a),r.val().length&&t.closest(".repeater-wrapper").find(n).text(r.val()+"%")}),c.length&&(c.on("submit",function(e){e.preventDefault()}),c.repeater({show:function(){$(this).slideDown(),[].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]')).map(function(e){return new bootstrap.Tooltip(e)})},hide:function(e){$(this).slideUp()}})),$(document).on("change",".item-details",function(){var e=$(this),t=p[e.val()];e.next("textarea").length?e.next("textarea").val(t):e.after('<textarea class="form-control" rows="2">'+t+"</textarea>")})});