var document={createElementNS:function(){return{}}},window=this;importScripts("/static/js/workers/pdf-worker-libs.js"),pdfMake.fonts={PdfFont:{normal:"OSFont-regular.ttf",bold:"OSFont-bold.ttf",italics:"OSFont-italic.ttf",bolditalics:"OSFont-bold_italic.ttf"}};var replacePlaceholder=function(e){for(var t=0;t<e.length;t++)if("object"==typeof e[t]){if("{{motion-placeholder-to-insert-functions-here}}"===e[t].layout)return e[t].layout={hLineWidth:function(e,t){return 0===e||e===t.table.body.length?0:.5},vLineWidth:function(){return 0},hLineColor:function(){return"white"}},!0;if("{{ballot-placeholder-to-insert-functions-here}}"===e[t].layout)return e[t].layout={hLineWidth:function(e,t){return 0===e?0:.5},vLineWidth:function(e,t){return 0===e||e===t.table.widths.length?0:.5},hLineColor:function(){return"gray"},vLineColor:function(){return"gray"}},!0;replacePlaceholder(e[t])}},replaceFooter=function(e){e.footerTpl&&(e.footer=function(t,n){for(var r=JSON.parse(JSON.stringify(e.footerTpl.columns)),o=0;o<r.length;o++)r[o].text&&(r[o].text=r[o].text.replace("{{currentPage}}",t).replace("{{pageCount}}",n));return{columns:r,margin:e.footerTpl.margin}})};self.addEventListener("message",function(e){var t=JSON.parse(e.data);pdfMake.vfs=t.vfs;var n=t.pdfDocument;replaceFooter(n),replacePlaceholder(n.content),pdfMake.createPdf(n).getBase64(function(e){t.filename?self.postMessage(JSON.stringify({filename:t.filename,base64:e})):self.postMessage(e)})},!1);