"use strict";function _classCallCheck(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}function _defineProperties(e,n){for(var i=0;i");e.from(n).toImg().then(function(){i.css("display","none"),a.prop("alt",o).prop("src",e.prop.img.src).addClass("invoice-img").css("max-width","".concat(i.outerWidth(),"px")),t.append(a)}),this.worker=e}},{key:"savePdf",value:function(){var e=document.getElementById("invoice"),n=$(e).data("id");this.worker.from(e).toPdf().save(n)}},{key:"handleUpdate",value:function(){var i=this,t=$("#invoice");$("#update-invoice").on("click",function(e){var n=$(".invoice-img");t.css("display","").find(".invoice-body").append("
"),n.remove(),i.generateInvoice()})}},{key:"handleDownload",value:function(){var n=this;$("#download-pdf").on("click",function(e){e.preventDefault(),n.savePdf()})}}]),e}();$(document).on("theme:init",function(){new InvoiceDemo}); //# sourceMappingURL=../../sourcemaps/pages/invoice-demo.min.js.map