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