survey-pdf 2.0.0-rc.2 → 2.0.0-rc.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. package/LICENSE +1 -1
  2. package/fesm/survey.pdf.fonts.js +55 -0
  3. package/fesm/survey.pdf.fonts.js.map +1 -0
  4. package/fesm/survey.pdf.js +9943 -0
  5. package/fesm/survey.pdf.js.map +1 -0
  6. package/package.json +16 -11
  7. package/survey.pdf.d.ts +1309 -1309
  8. package/survey.pdf.fonts.js +92 -78
  9. package/survey.pdf.fonts.js.map +1 -0
  10. package/survey.pdf.fonts.min.js +2 -6
  11. package/survey.pdf.fonts.min.js.LICENSE.txt +5 -0
  12. package/survey.pdf.js +7698 -7281
  13. package/survey.pdf.js.map +1 -0
  14. package/survey.pdf.min.js +2 -26
  15. package/survey.pdf.min.js.LICENSE.txt +5 -0
  16. package/typings/doc_controller.d.ts +298 -0
  17. package/typings/entries/helpers.d.ts +7 -0
  18. package/typings/entries/pdf.d.ts +51 -0
  19. package/typings/event_handler/adorners.d.ts +24 -0
  20. package/typings/event_handler/draw_canvas.d.ts +133 -0
  21. package/typings/event_handler/event_handler.d.ts +11 -0
  22. package/typings/flat_layout/flat_boolean.d.ts +22 -0
  23. package/typings/flat_layout/flat_checkbox.d.ts +19 -0
  24. package/typings/flat_layout/flat_comment.d.ts +12 -0
  25. package/typings/flat_layout/flat_custom_model.d.ts +11 -0
  26. package/typings/flat_layout/flat_default.d.ts +6 -0
  27. package/typings/flat_layout/flat_dropdown.d.ts +12 -0
  28. package/typings/flat_layout/flat_expression.d.ts +11 -0
  29. package/typings/flat_layout/flat_file.d.ts +17 -0
  30. package/typings/flat_layout/flat_html.d.ts +15 -0
  31. package/typings/flat_layout/flat_image.d.ts +12 -0
  32. package/typings/flat_layout/flat_imagepicker.d.ts +14 -0
  33. package/typings/flat_layout/flat_matrix.d.ts +38 -0
  34. package/typings/flat_layout/flat_matrixdynamic.d.ts +8 -0
  35. package/typings/flat_layout/flat_matrixmultiple.d.ts +29 -0
  36. package/typings/flat_layout/flat_multipletext.d.ts +15 -0
  37. package/typings/flat_layout/flat_paneldynamic.d.ts +13 -0
  38. package/typings/flat_layout/flat_question.d.ts +27 -0
  39. package/typings/flat_layout/flat_radiogroup.d.ts +14 -0
  40. package/typings/flat_layout/flat_ranking.d.ts +16 -0
  41. package/typings/flat_layout/flat_rating.d.ts +16 -0
  42. package/typings/flat_layout/flat_repository.d.ts +16 -0
  43. package/typings/flat_layout/flat_selectbase.d.ts +18 -0
  44. package/typings/flat_layout/flat_signaturepad.d.ts +15 -0
  45. package/typings/flat_layout/flat_survey.d.ts +15 -0
  46. package/typings/flat_layout/flat_textbox.d.ts +12 -0
  47. package/typings/fonts.d.ts +4 -0
  48. package/typings/helper_survey.d.ts +155 -0
  49. package/typings/helper_test.d.ts +21 -0
  50. package/typings/jspdf_plugins/acroform.d.ts +1 -0
  51. package/typings/page_layout/page_packer.d.ts +7 -0
  52. package/typings/pdf_render/pdf_booleanitem.d.ts +6 -0
  53. package/typings/pdf_render/pdf_brick.d.ts +86 -0
  54. package/typings/pdf_render/pdf_checkboxitem.d.ts +6 -0
  55. package/typings/pdf_render/pdf_checkitem.d.ts +23 -0
  56. package/typings/pdf_render/pdf_coloredbrick.d.ts +9 -0
  57. package/typings/pdf_render/pdf_comment.d.ts +8 -0
  58. package/typings/pdf_render/pdf_composite.d.ts +26 -0
  59. package/typings/pdf_render/pdf_custom.d.ts +8 -0
  60. package/typings/pdf_render/pdf_description.d.ts +6 -0
  61. package/typings/pdf_render/pdf_dropdown.d.ts +11 -0
  62. package/typings/pdf_render/pdf_empty.d.ts +9 -0
  63. package/typings/pdf_render/pdf_html.d.ts +9 -0
  64. package/typings/pdf_render/pdf_image.d.ts +11 -0
  65. package/typings/pdf_render/pdf_link.d.ts +9 -0
  66. package/typings/pdf_render/pdf_radioitem.d.ts +34 -0
  67. package/typings/pdf_render/pdf_rankingitem.d.ts +9 -0
  68. package/typings/pdf_render/pdf_rowline.d.ts +17 -0
  69. package/typings/pdf_render/pdf_text.d.ts +11 -0
  70. package/typings/pdf_render/pdf_textbold.d.ts +7 -0
  71. package/typings/pdf_render/pdf_textbox.d.ts +8 -0
  72. package/typings/pdf_render/pdf_textfield.d.ts +28 -0
  73. package/typings/pdf_render/pdf_titlepanel.d.ts +8 -0
  74. package/typings/survey.d.ts +152 -0
package/survey.pdf.min.js CHANGED
@@ -1,26 +1,2 @@
1
- /*!
2
- * surveyjs - SurveyJS PDF library v2.0.0-rc.2
3
- * Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
4
- * License: MIT (http://www.opensource.org/licenses/mit-license.php)
5
- */
6
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("survey-core"),require("jspdf")):"function"==typeof define&&define.amd?define("SurveyPDF",["survey-core","jspdf"],e):"object"==typeof exports?exports.SurveyPDF=e(require("survey-core"),require("jspdf")):t.SurveyPDF=e(t.Survey,t.jspdf)}(this,function(t,e){return function(t){function e(i){if(n[i])return n[i].exports;var r=n[i]={i:i,l:!1,exports:{}};return t[i].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=14)}([function(t,e,n){"use strict";function i(t,e){function n(){this.constructor=t}if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");s(t,e),t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)}function r(t,e,n,i){function r(t){return t instanceof n?t:new n(function(e){e(t)})}return new(n||(n=Promise))(function(n,o){function a(t){try{c(i.next(t))}catch(t){o(t)}}function s(t){try{c(i.throw(t))}catch(t){o(t)}}function c(t){t.done?n(t.value):r(t.value).then(a,s)}c((i=i.apply(t,e||[])).next())})}function o(t,e){function n(t){return function(e){return i([t,e])}}function i(n){if(r)throw new TypeError("Generator is already executing.");for(;c;)try{if(r=1,o&&(a=2&n[0]?o.return:n[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,n[1])).done)return a;switch(o=0,a&&(n=[2&n[0],a.value]),n[0]){case 0:case 1:a=n;break;case 4:return c.label++,{value:n[1],done:!1};case 5:c.label++,o=n[1],n=[0];continue;case 7:n=c.ops.pop(),c.trys.pop();continue;default:if(a=c.trys,!(a=a.length>0&&a[a.length-1])&&(6===n[0]||2===n[0])){c=0;continue}if(3===n[0]&&(!a||n[1]>a[0]&&n[1]<a[3])){c.label=n[1];break}if(6===n[0]&&c.label<a[1]){c.label=a[1],a=n;break}if(a&&c.label<a[2]){c.label=a[2],c.ops.push(n);break}a[2]&&c.ops.pop(),c.trys.pop();continue}n=e.call(t,c)}catch(t){n=[6,t],o=0}finally{r=a=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,a,s,c={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return s={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s}function a(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}e.a=i,n.d(e,"e",function(){return c}),e.b=r,e.c=o,e.d=a;var s=function(t,e){return(s=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])})(t,e)},c=function(){return c=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++){e=arguments[n];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])}return t},c.apply(this,arguments)}},function(t,e,n){"use strict";var i=n(0),r=n(6),o=(n.n(r),n(14)),a=n(8),s=n(2),c=n(4),l=n(13),u=n(34),h=n(60),f=n(26),d=n(30),p=n(28),g=n(29),m=n(12),v=n(16),y=n(5),b=n(35);n.d(e,"a",function(){return x});var x=function(){function t(){}return t.parseWidth=function(t,e,n,i){if(void 0===n&&(n=1),0===t.indexOf("calc"))return e/n;var r,o=parseFloat(t),a=t.replace(/[^A-Za-z%]/g,"")||i;switch(a){case"pt":r=1;break;case"mm":r=72/25.4;break;case"cm":r=72/2.54;break;case"in":r=72;break;case"px":r=.75;break;case"pc":case"em":r=12;break;case"ex":r=6;break;default:case"%":r=e/100}return Math.min(o*r,e)},t.pxToPt=function(e){return"string"==typeof e?(isNaN(Number(e))||(e+="px"),t.parseWidth(e,Number.MAX_VALUE)):72*e/96},t.mergeRects=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n={xLeft:t[0].xLeft,xRight:t[0].xRight,yTop:t[0].yTop,yBot:t[0].yBot};return t.forEach(function(t){n.xLeft=Math.min(n.xLeft,t.xLeft),n.xRight=Math.max(n.xRight,t.xRight),n.yTop=Math.min(n.yTop,t.yTop),n.yBot=Math.max(n.yBot,t.yBot)}),n},t.createPoint=function(t,e,n){return void 0===e&&(e=!0),void 0===n&&(n=!1),{xLeft:e?t.xLeft:t.xRight,yTop:n?t.yTop:t.yBot}},t.createRect=function(t,e,n){return{xLeft:t.xLeft,xRight:t.xLeft+e,yTop:t.yTop,yBot:t.yTop+n}},t.createHeaderRect=function(t){return{xLeft:0,xRight:t.paperWidth,yTop:0,yBot:t.margins.top}},t.createFooterRect=function(t){return{xLeft:0,xRight:t.paperWidth,yTop:t.paperHeight-t.margins.bot,yBot:t.paperHeight}},t.chooseHtmlFont=function(t){return t.useCustomFontInHtml?t.fontName:this.STANDARD_FONT},t.generateCssTextRule=function(t,e,n){return'"font-size: '.concat(t,"pt; font-weight: ").concat(e,"; font-family: ").concat(n,"; color: ").concat(this.TEXT_COLOR,';"')},t.createHtmlContainerBlock=function(t,e,n){var i=this.chooseHtmlFont(e);return'<div class="__surveypdf_html" style='.concat(this.generateCssTextRule(e.fontSize,e.fontStyle,i),">")+"<style>.__surveypdf_html p { margin: 0; line-height: ".concat(e.fontSize,"pt } body { margin: 0; }</style>").concat(t,"</div>")},t.splitHtmlRect=function(t,e){var r=[],o=e.height,a=t.doc.getFontSize();e.yBot=e.yTop+a;var s=Math.floor(o/a)-1;r.push(e);for(var c=this.createPoint(e),l=0;l<s;l++)r.push(new m.a(this.createRect(c,e.width,a))),c.yTop+=a;var u=o-(s+1)*a;return u>0&&r.push(new m.a(this.createRect(c,e.width,u))),new(y.a.bind.apply(y.a,n.i(i.d)([void 0],r,!1)))},t.createPlainTextFlat=function(t,e,n,i,r){var o=this,a=n.doc.splitTextToSize(i,n.paperWidth-n.margins.right-t.xLeft),s=this.clone(t),c=new y.a;return a.forEach(function(t){var i=n.measureText(t);c.addBrick(new r(e,n,o.createRect(s,i.width,i.height),t)),s.yTop+=i.height}),c},t.createTextFlat=function(t,e,r,o,a){return n.i(i.b)(this,void 0,void 0,function(){var s,c;return n.i(i.c)(this,function(n){switch(n.label){case 0:return"string"!=typeof o&&this.hasHtml(o)?[3,1]:[2,this.createPlainTextFlat(t,e,r,"string"==typeof o?o:this.getLocString(o),a)];case 1:return s=this.splitHtmlRect,c=[r],[4,this.createHTMLFlat(t,e,r,this.createHtmlContainerBlock(this.getLocString(o),r,"standard"))];case 2:return[2,s.apply(this,c.concat([n.sent()]))]}})})},t.hasHtml=function(t){var e=/<\/?[a-z][\s\S]*>/i;return t.hasHtml&&(e.test(t.renderedText)||e.test(t.renderedHtml))},t.getHtmlMargins=function(t,e){var n=t.paperWidth-e.xLeft-t.margins.right;return{top:t.margins.top,bottom:t.margins.bot,width:n>t.unitWidth?n:t.unitWidth}},t.createHTMLRect=function(e,n,i,r){var o=n.paperHeight-n.margins.bot-n.margins.top,a=(n.helperDoc.getNumberOfPages()-1)*(n.fontSize*Math.floor(o/n.fontSize))+r-i.top+t.HTML_TAIL_TEXT_SCALE*n.fontSize,s=n.helperDoc.getNumberOfPages();n.helperDoc.addPage();for(var c=0;c<s;c++)n.helperDoc.deletePage(1);return t.createRect(e,i.width,a)},t.createHTMLFlat=function(e,r,o,a){return n.i(i.b)(this,void 0,void 0,function(){var s;return n.i(i.c)(this,function(n){switch(n.label){case 0:return s=this.getHtmlMargins(o,e),[4,new Promise(function(n){o.helperDoc.fromHTML(a,e.xLeft,s.top,{pagesplit:!0,width:s.width},function(i){var c=t.createHTMLRect(e,o,s,i.y);n(new p.a(r,o,c,a))},s)})];case 1:return[2,n.sent()]}})})},t.generateFontFace=function(t,e,n){return"@font-face { font-family: ".concat(t,"; ")+"src: url(data:application/font-woff;charset=utf-8;base64,".concat(e,") format('woff'); ")+"font-weight: ".concat(n,"; }")},t.generateFontFaceWithItalicStyle=function(t,e,n){return"@font-face { font-family: ".concat(t,"; ")+"src: url(data:application/font-woff;charset=utf-8;base64,".concat(e,") format('woff'); ")+"font-weight: ".concat(n,"; font-style: italic}")},t.htmlToXml=function(t){var e=document.implementation.createHTMLDocument("");return e.write(t.replace(/\#/g,"%23")),e.documentElement.setAttribute("xmlns",e.documentElement.namespaceURI),e.body.style.margin="unset",(new XMLSerializer).serializeToString(e.body).replace(/%23/g,"#")},t.createSvgContent=function(t,e,n){var i=this,r=document.createElement("style");r.innerHTML=".__surveypdf_html p { margin: unset; line-height: 22px; } body { margin: unset; }",document.body.appendChild(r);var o=document.createElement("div");o.className="__surveypdf_html",o.style.display="block",o.style.position="fixed",o.style.top="-10000px",o.style.left="-10000px",o.style.width=e/72*96+"px",o.style.boxSizing="initial",o.style.color="initial",o.style.fontFamily="initial",o.style.font="initial",o.style.lineHeight="initial",o.insertAdjacentHTML("beforeend",t),document.body.appendChild(o);var s=o.offsetWidth,c=o.offsetHeight;o.remove(),r.remove();var l="";return n.useCustomFontInHtml?l="<defs><style>".concat(this.generateFontFace(n.fontName,n.base64Normal,"normal"))+" ".concat(this.generateFontFace(n.fontName,n.base64Bold,"bold"),"</style></defs>"):Object.keys(a.b.customFonts).forEach(function(t){var e=a.b.customFonts[t];Object.keys(e).forEach(function(n){l+="".concat("normal"===n||"bold"===n?i.generateFontFace(t,e[n],n):i.generateFontFaceWithItalicStyle(t,e[n],"italic"===n?"normal":"bold"))}),l="<defs><style>"+l+"</style></defs>"}),{svg:'<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(s,'px" height="').concat(c,'px">')+l+"<style>.__surveypdf_html p { margin: unset; line-height: 22px; }</style>"+'<foreignObject width="'.concat(s,'px" height="').concat(c,'px">')+this.htmlToXml(t)+"</foreignObject></svg>",divWidth:s,divHeight:c}},t.setCanvas=function(e,n,i,r){e.width=n*t.HTML_TO_IMAGE_QUALITY,e.height=i*t.HTML_TO_IMAGE_QUALITY;var o=e.getContext("2d");o.scale(t.HTML_TO_IMAGE_QUALITY,t.HTML_TO_IMAGE_QUALITY),o.fillStyle=t.BACKGROUND_COLOR,o.fillRect(0,0,n,i),o.drawImage(r,0,0)},t.htmlToImage=function(e,r,o){return n.i(i.b)(this,void 0,void 0,function(){var a,s,c,l,u,h;return n.i(i.c)(this,function(n){return a=t.createSvgContent(e,r,o),s=a.svg,c=a.divWidth,l=a.divHeight,u="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(s))),h=new Image,h.crossOrigin="anonymous",h.src=u,[2,new Promise(function(e){h.onload=function(){var n=document.createElement("canvas");t.setCanvas(n,c,l,h);var i=n.toDataURL("image/jpeg",t.HTML_TO_IMAGE_QUALITY);n.remove(),e({url:i,aspect:c/l})},h.onerror=function(){e({url:"data:,",aspect:r/this.EPSILON})}})]})})},t.createBoldTextFlat=function(t,e,r,o){return n.i(i.b)(this,void 0,void 0,function(){var a;return n.i(i.c)(this,function(n){switch(n.label){case 0:return r.fontStyle="bold",[4,this.createTextFlat(t,e,r,o,l.a)];case 1:return a=n.sent(),r.fontStyle="normal",[2,a]}})})},t.createTitleFlat=function(t,e,r){return n.i(i.b)(this,void 0,void 0,function(){var o,a,s,c,l,u,h,f,d,p,g;return n.i(i.c)(this,function(n){switch(n.label){case 0:return o=new y.a,(a=this.clone(t),s=r.fontSize,r.fontSize*=this.TITLE_FONT_SCALE,e.no)?(c=e.no+" ",l=void 0,this.hasHtml(e.locTitle)?(r.fontStyle="bold",r.pushMargins(),r.margins.right=r.paperWidth-r.margins.left-r.measureText(c,"bold").width,[4,this.createHTMLFlat(a,e,r,this.createHtmlContainerBlock(c,r,"standard"))]):[3,2]):[3,5];case 1:return l=n.sent(),r.popMargins(),r.fontStyle="normal",[3,4];case 2:return[4,this.createBoldTextFlat(a,e,r,c)];case 3:l=n.sent(),n.label=4;case 4:o.addBrick(l),a.xLeft=l.xRight,n.label=5;case 5:return r.pushMargins(),r.margins.left=a.xLeft,[4,this.createBoldTextFlat(a,e,r,e.locTitle)];case 6:return u=n.sent(),(o.addBrick(u),r.popMargins(),e.isRequired)?(h=e.requiredText,this.hasHtml(e.locTitle)?(a=this.createPoint(u.unfold()[0],!1,!1),r.fontStyle="bold",r.pushMargins(),r.margins.right=r.paperWidth-r.margins.left-r.measureText(h,"bold").width,d=(f=o).addBrick,[4,this.createHTMLFlat(a,e,r,this.createHtmlContainerBlock(h,r,"standard"))]):[3,8]):[3,10];case 7:return d.apply(f,[n.sent()]),r.popMargins(),r.fontStyle="normal",[3,10];case 8:return a=this.createPoint(u.unfold().pop(),!1,!0),g=(p=o).addBrick,[4,this.createBoldTextFlat(a,e,r,h)];case 9:g.apply(p,[n.sent()]),n.label=10;case 10:return r.fontSize=s,[2,o]}})})},t.createTitleSurveyPanelFlat=function(t,e,r,o){return n.i(i.b)(this,void 0,void 0,function(){var a,s;return n.i(i.c)(this,function(n){switch(n.label){case 0:return a=e.fontSize,e.fontSize=a*o,e.fontStyle="bold",[4,this.createTextFlat(t,null,e,r,u.a)];case 1:return s=n.sent(),e.fontStyle="normal",e.fontSize=a,[2,s]}})})},t.createTitleSurveyFlat=function(t,e,r){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(n){switch(n.label){case 0:return[4,this.createTitleSurveyPanelFlat(t,e,r,this.TITLE_SURVEY_FONT_SIZE_SCALE)];case 1:return[2,n.sent()]}})})},t.createTitlePanelFlat=function(t,e,r,o){return void 0===o&&(o=!1),n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(n){switch(n.label){case 0:return[4,this.createTitleSurveyPanelFlat(t,e,r,o?this.TITLE_PAGE_FONT_SIZE_SCALE:this.TITLE_PANEL_FONT_SIZE_SCALE)];case 1:return[2,n.sent()]}})})},t.createDescFlat=function(t,e,r,o){return n.i(i.b)(this,void 0,void 0,function(){var a,s;return n.i(i.c)(this,function(n){switch(n.label){case 0:return a=r.fontSize,r.fontSize=a*this.DESCRIPTION_FONT_SIZE_SCALE,[4,this.createTextFlat(t,e,r,o,h.a)];case 1:return s=n.sent(),r.fontSize=a,[2,s]}})})},t.getReadonlyRenderAs=function(t,e){return"auto"===t.readonlyRenderAs?e.readonlyRenderAs:t.readonlyRenderAs},t.createCommentFlat=function(e,r,o,a,s){var c,l,u;return void 0===s&&(s={}),n.i(i.b)(this,void 0,void 0,function(){var h,d,p,g,m;return n.i(i.c)(this,function(n){switch(n.label){case 0:return h=this.createTextFieldRect(e,o,null!==(c=s.rows)&&void 0!==c?c:1),(null!==(l=s.readOnly)&&void 0!==l?l:t.shouldRenderReadOnly(r,o))?(p=null!==(u=s.value)&&void 0!==u?u:this.getQuestionOrCommentValue(r,a),[4,this.createReadOnlyTextFieldTextFlat(e,o,r,p)]):[3,2];case 1:d=n.sent(),g=o.unitHeight*this.VALUE_READONLY_PADDING_SCALE,d.yBot+g>h.yBot&&(h.yBot=d.yBot+g),n.label=2;case 2:return m=new f.a(r,o,h,a,s.index),null!==s.readOnly&&void 0!==s.readOnly&&(m.isReadOnly=s.readOnly),d&&(m.textBrick=d),[2,m]}})})},t.getQuestionOrCommentValue=function(t,e){return void 0===e&&(e=!0),e?void 0!==t.value&&null!==t.value?t.value:"":void 0!==t.comment&&null!==t.comment?t.comment:""},t.getQuestionOrCommentDisplayValue=function(e,n){return void 0===n&&(n=!0),n?e.displayValue:t.getQuestionOrCommentValue(e,n)},Object.defineProperty(t,"hasDocument",{get:function(){return"undefined"!=typeof document},enumerable:!1,configurable:!0}),t.getImageBase64=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e;return n.i(i.c)(this,function(n){return e=new Image,e.crossOrigin="anonymous",[2,new Promise(function(n){e.onload=function(){var t=document.createElement("canvas"),i=t.getContext("2d");t.height=e.naturalHeight,t.width=e.naturalWidth,i.drawImage(e,0,0);var r=t.toDataURL();n(r)},e.onerror=function(){n("")},e.src=t})]})})},t.getImageLink=function(e,r,o){return n.i(i.b)(this,void 0,void 0,function(){var a,s,c,l;return n.i(i.c)(this,function(n){switch(n.label){case 0:return a=96/72,this.shouldConvertImageToPng?[4,t.getImageBase64(r.link)]:[3,2];case 1:return c=n.sent(),[3,3];case 2:c=r.link,n.label=3;case 3:return s=c,"function"==typeof XMLSerializer&&o?(l="<div style='overflow: hidden; width: ".concat(r.width*a,"px; height: ").concat(r.height*a,"px;'>\n <img src='").concat(s,"' style='object-fit: ").concat(r.objectFit,"; width: 100%; height: 100%;'/>\n </div>"),[4,t.htmlToImage(l,r.width,e)]):[3,5];case 4:s=n.sent().url,n.label=5;case 5:return[2,s]}})})},t.createImageFlat=function(e,r,o,a,s){return n.i(i.b)(this,void 0,void 0,function(){var c,l,u;return n.i(i.c)(this,function(n){switch(n.label){case 0:return t.inBrowser?(a.objectFit=r&&r.imageFit?r.imageFit:a.objectFit||"contain",(null!==s&&void 0!==s?s:o.applyImageFit)&&a.width>o.paperWidth-o.margins.left-o.margins.right&&(c=o.paperWidth-o.margins.left-o.margins.right,a.height*=c/a.width,a.width=c),u="<img src='".concat,[4,t.getImageLink(o,a,null!==s&&void 0!==s?s:o.applyImageFit)]):[3,2];case 1:return l=u.apply("<img src='",[n.sent(),"' width='"]).concat(a.width,"' height='").concat(a.height,"'/>"),[2,new p.a(r,o,this.createRect(e,a.width,a.height),l,!0)];case 2:return[2,new g.a(r,o,a.link,e,a.width,a.height)]}})})},t.canPreviewImage=function(t,e,n){return t.canPreviewImage(e)},t.getImageSize=function(e){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(n){switch(n.label){case 0:return t.inBrowser?[3,2]:[4,new Promise(function(t){return t({width:void 0,height:void 0})})];case 1:return[2,n.sent()];case 2:return[4,new Promise(function(t){var n=new Image;n.src=e,n.onload=function(){return t({width:n.width,height:n.height})},n.onerror=function(){return t(null)}})];case 3:return[2,n.sent()]}})})},t.createRowlineFlat=function(t,e,n,i){var r=void 0===n?e.paperWidth-e.margins.right:t.xLeft+n;return r=r>t.xLeft?r:t.xLeft+this.EPSILON,new v.a(e,{xLeft:t.xLeft,xRight:r,yTop:t.yTop+this.EPSILON,yBot:t.yTop+this.EPSILON},void 0===i?null:i)},t.createLinkFlat=function(t,e,r,o,a){return n.i(i.b)(this,void 0,void 0,function(){var s,l,u=this;return n.i(i.c)(this,function(n){switch(n.label){case 0:return[4,this.createTextFlat(t,e,r,o,c.a)];case 1:return s=n.sent(),l=new y.a,s.unfold().forEach(function(t){l.addBrick(new d.a(t,a));var e=u.createPoint(l);l.addBrick(u.createRowlineFlat(e,r,l.width,d.a.COLOR))}),[2,l]}})})},t.createAcroformRect=function(t){return[t.xLeft,t.yTop,t.xRight-t.xLeft,t.yBot-t.yTop]},t.createTextFieldRect=function(t,e,n){void 0===n&&(n=1);var i=e.paperWidth-t.xLeft-e.margins.right;i=Math.max(i,e.unitWidth);var r=e.unitHeight*n;return this.createRect(t,i,r)},t.createReadOnlyTextFieldTextFlat=function(t,e,r,o){return n.i(i.b)(this,void 0,void 0,function(){var a,s;return n.i(i.c)(this,function(n){switch(n.label){case 0:return a=e.unitWidth*this.VALUE_READONLY_PADDING_SCALE,t.yTop+=a,t.xLeft+=a,e.pushMargins(t.xLeft,e.margins.right+a),[4,this.createTextFlat(t,r,e,o.toString(),c.a)];case 1:return s=n.sent(),e.popMargins(),[2,s]}})})},t.renderFlatBorders=function(t,e){var r,o,a,s,c,l;if(this.FORM_BORDER_VISIBLE){e.rounded=null===(a=e.rounded)||void 0===a||a,e.outside=null!==(s=e.outside)&&void 0!==s&&s;var u=Math.min(e.width,e.height),h=this.getBorderWidth(t),f=t.unitHeight*this.VISIBLE_BORDER_SCALE*this.BORDER_SCALE,d=e.outside?(u+h)/u-f/u:(u-h)/u+f/u,p=t.doc.getDrawColor();t.doc.setDrawColor(e.formBorderColor),t.doc.setLineWidth(f);var g=this.scaleRect(e,d);if(e.dashStyle){var m=e.dashStyle,v=2*(Math.abs(g.yTop-g.yBot)+Math.abs(g.xLeft-g.xRight)),y=m.dashArray[0]+(null!==(c=m.dashArray[1])&&void 0!==c?c:m.dashArray[0]),b=m.dashArray[0]+v%y/Math.floor(v/y);t.doc.setLineDashPattern([b,null!==(l=m.dashArray[1])&&void 0!==l?l:m.dashArray[0]],m.dashPhase)}if((r=t.doc).rect.apply(r,this.createAcroformRect(g)),e.rounded){var x=t.unitHeight*this.UNVISIBLE_BORDER_SCALE*this.BORDER_SCALE,T=1-x/u,_=this.RADIUS_SCALE*x;t.doc.setDrawColor(this.BACKGROUND_COLOR),t.doc.setLineWidth(x),(o=t.doc).roundedRect.apply(o,n.i(i.d)(n.i(i.d)([],this.createAcroformRect(this.scaleRect(e,T)),!1),[_,_],!1))}e.dashStyle&&t.doc.setLineDashPattern([]),t.doc.setDrawColor(p)}},t.getLocString=function(t){return this.hasHtml(t)?t.renderedHtml:t.renderedText||t.renderedHtml},t.getDropdownQuestionValue=function(t){var e=t;return e.isOtherSelected?e.otherText:t.displayValue?t.displayValue:e.showOptionsCaption?e.optionsCaption:""},t.getContentQuestion=function(t){return t.contentQuestion?t.contentQuestion:t},t.getContentQuestionTypeRenderAs=function(t,e){var n=t.renderAs;if("boolean"===t.getType()&&e.options.useLegacyBooleanRendering&&(n="checkbox"),"default"!==n){var i="".concat(t.getType(),"-").concat(n);if(s.a.getInstance().isTypeRegistered(i))return i}return t.getType()},t.getContentQuestionType=function(t,e){return t.customWidget?t.customWidget.pdfQuestionType:t.contentQuestion?"custom_model":this.getContentQuestionTypeRenderAs(t,e)},t.getRatingMinWidth=function(t){return t.measureText(this.RATING_MIN_WIDTH).width},t.getRatingItemText=function(t,e,n){var i=new r.LocalizableString(n.owner,n.useMarkdown);return i.text=this.getLocString(n),0===e&&t.minRateDescription?i.text=t.locMinRateDescription.text+" "+this.getLocString(n):e===t.visibleRateValues.length-1&&t.maxRateDescription&&(i.text=this.getLocString(n)+" "+t.locMaxRateDescription.text),i},t.getPageAvailableWidth=function(t){return t.paperWidth-t.margins.left-t.margins.right},t.getImagePickerAvailableWidth=function(t){var e=this.getPageAvailableWidth(t)-(this.IMAGEPICKER_COUNT-1)*t.unitHeight;return e>0?e:t.unitHeight},t.getColumnWidth=function(t,e){return(this.getPageAvailableWidth(t)-(e-1)*t.unitWidth*this.GAP_BETWEEN_COLUMNS)/e},t.setColumnMargins=function(t,e,n){var i=this.getColumnWidth(t,e);t.margins.left=t.margins.left+n*(i+t.unitWidth*this.GAP_BETWEEN_COLUMNS),t.margins.right=t.margins.right+(e-n-1)*(i+t.unitWidth*this.GAP_BETWEEN_COLUMNS)},t.moveRect=function(t,e,n){return void 0===e&&(e=t.xLeft),void 0===n&&(n=t.yTop),{xLeft:e,yTop:n,xRight:e+t.xRight-t.xLeft,yBot:n+t.yBot-t.yTop}},t.scaleRect=function(t,e){var n=Math.min(t.xRight-t.xLeft,t.yBot-t.yTop)*(1-e)/2;return{xLeft:t.xLeft+n,yTop:t.yTop+n,xRight:t.xRight-n,yBot:t.yBot-n}},t.getBorderWidth=function(t){return 2*t.unitWidth*this.BORDER_SCALE},t.formScale=function(t,e){var n=Math.min(e.width,e.height);return(n-this.getBorderWidth(t))/n},t.generateQuestionFlats=function(t,e,r,a){return n.i(i.b)(this,void 0,void 0,function(){var c,l,u,h;return n.i(i.c)(this,function(f){switch(f.label){case 0:return c=this.getContentQuestionType(r,t),l=s.a.getInstance().create(t,r,e,c),[4,l.generateFlats(a)];case 1:return u=f.sent(),h=new b.c(a,u,r,e,s.a.getInstance(),o),r.customWidget&&r.customWidget.isFit(r)&&r.customWidget.pdfRender&&t.onRenderQuestion.unshift(r.customWidget.pdfRender),[4,t.onRenderQuestion.fire(t,h)];case 2:return f.sent(),[2,n.i(i.d)([],h.bricks,!0)]}})})},t.isFontExist=function(t,e){return t.doc.internal.getFont(e).fontName===e},t.isCustomFont=function(t,e){return t.doc.internal.getFont(e).encoding===this.CUSTOM_FONT_ENCODING},t.fixFont=function(t){this.isCustomFont(t,t.fontName)&&(t.doc.text("load font",0,0),t.doc.deletePage(1),t.addPage())},t.clone=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},t.shouldRenderReadOnly=function(e,n,i){return(!!e&&e.isReadOnly||i)&&"acroform"!==t.getReadonlyRenderAs(e,n)||(null===n||void 0===n?void 0:n.compress)},t.isSizeEmpty=function(t){return!t||"auto"===t},t.isHeightEmpty=function(t){return this.isSizeEmpty(t)||"100%"==t},t.getCorrectedImageSize=function(e,r){return n.i(i.b)(this,void 0,void 0,function(){var o,a,s,c,l,u,h,f,d,p;return n.i(i.c)(this,function(n){switch(n.label){case 0:return o=r.imageWidth,a=r.imageLink,s=r.imageHeight,c=r.defaultImageWidth,l=r.defaultImageHeight,o="number"==typeof o?o.toString():o,s="number"==typeof s?s.toString():s,u=o&&t.parseWidth(o,t.getPageAvailableWidth(e),1,"px"),h=s&&t.parseWidth(s,t.getPageAvailableWidth(e),1,"px"),c="number"==typeof c?c.toString():c,l="number"==typeof l?l.toString():l,f=c&&t.parseWidth(c,t.getPageAvailableWidth(e),1,"px"),d=l&&t.parseWidth(l,t.getPageAvailableWidth(e),1,"px"),t.isSizeEmpty(o)||t.isHeightEmpty(s)?[4,t.getImageSize(a)]:[3,2];case 1:p=n.sent(),t.isSizeEmpty(o)?t.isHeightEmpty(s)?p&&p.height&&p.width&&(h=t.parseWidth(p.height.toString(),t.getPageAvailableWidth(e),1,"px"),u=t.parseWidth(p.width.toString(),t.getPageAvailableWidth(e),1,"px")):p&&p.height&&(u=p.width*h/p.height):p&&p.width&&(h=p.height*u/p.width),n.label=2;case 2:return[2,{width:u||f||0,height:h||d||0}]}})})},t.EPSILON=2.220446049250313e-15,t.TITLE_SURVEY_FONT_SIZE_SCALE=1.7,t.TITLE_PAGE_FONT_SIZE_SCALE=1.3,t.TITLE_PANEL_FONT_SIZE_SCALE=1.3,t.DESCRIPTION_FONT_SIZE_SCALE=2/3,t.OTHER_ROWS_COUNT=2,t.RATING_MIN_WIDTH=3,t.RATING_MIN_HEIGHT=2,t.RATING_COLUMN_WIDTH=5,t.MATRIX_COLUMN_WIDTH=5,t.IMAGEPICKER_COUNT=4,t.IMAGEPICKER_RATIO=4/3,t.MULTIPLETEXT_TEXT_PERS=Math.E/10,t.HTML_TAIL_TEXT_SCALE=.24,t.SELECT_ITEM_FLAT_SCALE=.95,t.GAP_BETWEEN_ROWS=.25,t.GAP_BETWEEN_COLUMNS=1.5,t.GAP_BETWEEN_ITEM_TEXT=.25,t.FORM_BORDER_VISIBLE=!0,t.BORDER_SCALE=.1,t.VISIBLE_BORDER_SCALE=.8,t.UNVISIBLE_BORDER_SCALE=.2,t.RADIUS_SCALE=3,t.TITLE_FONT_SCALE=1.1,t.VALUE_READONLY_PADDING_SCALE=.3,t.HTML_TO_IMAGE_QUALITY=1,t.FORM_BORDER_COLOR="#9f9f9f",t.TEXT_COLOR="#404040",t.BACKGROUND_COLOR="#FFFFFF",t.TITLE_LOCATION_MATRIX="matrix",t.STANDARD_FONT="helvetica",t.CUSTOM_FONT_ENCODING="Identity-H",t.inBrowser="function"==typeof Image,t.shouldConvertImageToPng=!0,t}()},function(t,e,n){"use strict";var i=n(3),r=n(21);n.d(e,"a",function(){return o});var o=function(){function t(){this.questions={}}return t.getInstance=function(){return t.instance},t.prototype.register=function(t,e){this.questions[t]=e},t.prototype.isTypeRegistered=function(t){return!!this.questions[t]},t.prototype.getRenderer=function(t){return this.questions[t]},t.prototype.create=function(t,e,n,o){var a,s=void 0===o?e.getType():o,c=this.getRenderer(s);return c||(c=(null===(a=e.customWidget)||void 0===a?void 0:a.pdfRender)?i.a:r.a),new c(t,e,n)},t.register=function(t,e){this.getInstance().register(t,e)},t.getRenderer=function(t){return this.getInstance().getRenderer(t)},t.instance=new t,t}()},function(t,e,n){"use strict";var i=n(0),r=n(6),o=(n.n(r),n(10)),a=n(4),s=n(5),c=n(1);n.d(e,"a",function(){return l});var l=function(){function t(t,e,n){this.survey=t,this.controller=n,this.question=e}return t.prototype.generateFlatTitle=function(t){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(e){switch(e.label){case 0:return[4,c.a.createTitleFlat(t,this.question,this.controller)];case 1:return[2,e.sent()]}})})},t.prototype.generateFlatDescription=function(t){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(e){switch(e.label){case 0:return[4,c.a.createDescFlat(t,this.question,this.controller,this.question.locDescription)];case 1:return[2,e.sent()]}})})},t.prototype.generateFlatHeader=function(e){return n.i(i.b)(this,void 0,void 0,function(){var r,o,a,l,u;return n.i(i.c)(this,function(n){switch(n.label){case 0:return[4,this.generateFlatTitle(e)];case 1:return r=n.sent(),(o=new s.a(r),this.question.hasDescriptionUnderTitle)?(a=c.a.createPoint(r,!0,!1),a.yTop+=t.DESC_GAP_SCALE*this.controller.unitHeight,a.xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,u=(l=o).addBrick,[4,this.generateFlatDescription(a)]):[3,3];case 2:u.apply(l,[n.sent()]),n.label=3;case 3:return[2,o]}})})},t.prototype.generateFlatsComment=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,l,u;return n.i(i.c)(this,function(n){switch(n.label){case 0:return e=this.question.locCommentText,[4,c.a.createTextFlat(t,this.question,this.controller,e,a.a)];case 1:return r=n.sent(),o=c.a.createPoint(r),o.yTop+=this.controller.unitHeight*c.a.GAP_BETWEEN_ROWS,l=s.a.bind,u=[void 0,r],[4,c.a.createCommentFlat(o,this.question,this.controller,!1,{rows:c.a.OTHER_ROWS_COUNT})];case 2:return[2,new(l.apply(s.a,u.concat([n.sent()])))]}})})},t.prototype.generateFlatsComposite=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e;return n.i(i.c)(this,function(n){switch(n.label){case 0:return e=this.question.contentPanel,e?[4,o.a.generateFlatsPanel(this.survey,this.controller,e,t)]:[3,2];case 1:return[2,n.sent()];case 2:return this.question=c.a.getContentQuestion(this.question),[4,this.generateFlatsContent(t)];case 3:return[2,n.sent()]}})})},t.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(t){return[2,null]})})},t.prototype.generateFlatsContentWithOptionalElements=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,a,s,l,u,h=this;return n.i(i.c)(this,function(n){switch(n.label){case 0:return e=[],[4,this.generateFlatsComposite(t)];case 1:return r=n.sent(),(e.push.apply(e,r),o=function(){var n=c.a.clone(t);return null!==r&&0!==r.length&&(n.yTop=c.a.mergeRects.apply(c.a,e).yBot+h.controller.unitHeight*c.a.GAP_BETWEEN_ROWS),n},this.question.hasComment)?(s=(a=e).push,[4,this.generateFlatsComment(o())]):[3,3];case 2:s.apply(a,[n.sent()]),n.label=3;case 3:return this.question.hasDescriptionUnderInput?(u=(l=e).push,[4,this.generateFlatDescription(o())]):[3,5];case 4:u.apply(l,[n.sent()]),n.label=5;case 5:return[2,e]}})})},t.prototype.generateFlats=function(e){return n.i(i.b)(this,void 0,void 0,function(){var r,o,a,s,l,u,h,u,h,f,d,p,l,u,h,u,g,m,v;return n.i(i.c)(this,function(n){switch(n.label){case 0:switch(this.controller.pushMargins(),this.controller.margins.left+=this.controller.measureText(this.question.indent).width,r={xLeft:e.xLeft+this.controller.measureText(this.question.indent).width,yTop:e.yTop},o=[],a=this.question.getTitleLocation(),a=this.question.hasTitle?a:"hidden",s=a){case"top":case"default":return[3,1];case"bottom":return[3,4];case"left":return[3,7];case"hidden":case c.a.TITLE_LOCATION_MATRIX:return[3,10]}return[3,10];case 1:return[4,this.generateFlatHeader(r)];case 2:return l=n.sent(),u=c.a.createPoint(l),u.xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,l.addBrick(c.a.createRowlineFlat(c.a.createPoint(l),this.controller)),u.yTop+=this.controller.unitHeight*t.CONTENT_GAP_VERT_SCALE+c.a.EPSILON,this.controller.pushMargins(),this.controller.margins.left+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,[4,this.generateFlatsContentWithOptionalElements(u)];case 3:return h=n.sent(),this.controller.popMargins(),null!==h&&0!==h.length&&l.addBrick(h.shift()),o.push(l),o.push.apply(o,h),[3,12];case 4:return u=c.a.clone(r),this.controller.pushMargins(),u.xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,this.controller.margins.left+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,[4,this.generateFlatsContentWithOptionalElements(u)];case 5:return h=n.sent(),this.controller.popMargins(),o.push.apply(o,h),f=r,0!==o.length&&(f.yTop=o[o.length-1].yBot),f.yTop+=this.controller.unitHeight*t.CONTENT_GAP_VERT_SCALE,p=(d=o).push,[4,this.generateFlatHeader(f)];case 6:return p.apply(d,[n.sent()]),[3,12];case 7:return this.controller.pushMargins(this.controller.margins.left,this.controller.paperWidth-this.controller.margins.left-c.a.getPageAvailableWidth(this.controller)*c.a.MULTIPLETEXT_TEXT_PERS),[4,this.generateFlatHeader(r)];case 8:return l=n.sent(),u=c.a.createPoint(l,!1,!0),this.controller.popMargins(),u.xLeft+=this.controller.unitWidth*t.CONTENT_GAP_HOR_SCALE,this.controller.margins.left=u.xLeft,[4,this.generateFlatsContentWithOptionalElements(u)];case 9:return h=n.sent(),null!==h&&0!==h.length&&l.addBrick(h.shift()),o.push(l),o.push.apply(o,h),[3,12];case 10:return u=c.a.clone(r),this.controller.pushMargins(),a!==c.a.TITLE_LOCATION_MATRIX&&(u.xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,this.controller.margins.left+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE),m=(g=o.push).apply,v=[o],[4,this.generateFlatsContentWithOptionalElements(u)];case 11:return m.apply(g,v.concat([n.sent()])),this.controller.popMargins(),[3,12];case 12:return this.controller.popMargins(),[2,o]}})})},Object.defineProperty(t.prototype,"shouldRenderAsComment",{get:function(){return c.a.shouldRenderReadOnly(this.question,this.controller)},enumerable:!1,configurable:!0}),t.CONTENT_GAP_VERT_SCALE=.5,t.CONTENT_GAP_HOR_SCALE=1,t.CONTENT_INDENT_SCALE=1,t.DESC_GAP_SCALE=.0625,t}();r.Serializer.addProperty("question",{name:"readonlyRenderAs",default:"auto",choices:["auto","text","acroform"],visible:!1})},function(t,e,n){"use strict";var i=n(0),r=n(7);n.d(e,"a",function(){return o});var o=function(t){function e(e,n,i,r){var o=t.call(this,e,n,i)||this;return o.text=r,o.align={isInputRtl:!1,isOutputRtl:n.isRTL,align:n.isRTL?"right":"left",baseline:"middle"},o}return n.i(i.a)(e,t),e.prototype.escapeText=function(){for(;this.text.indexOf("\t")>-1;)this.text=this.text.replace("\t",Array(5).join(String.fromCharCode(160)));return this.text},e.prototype.renderInteractive=function(){return n.i(i.b)(this,void 0,void 0,function(){var t,e,r;return n.i(i.c)(this,function(n){return t=this.alignPoint(this),e=this.controller.fontSize,this.controller.fontSize=this.fontSize,r=this.controller.doc.getTextColor(),this.controller.doc.setTextColor(this.textColor),this.controller.doc.text(this.escapeText(),t.xLeft,t.yTop,this.align),this.controller.doc.setTextColor(r),this.controller.fontSize=e,[2]})})},e.prototype.alignPoint=function(t){return{xLeft:this.controller.isRTL?t.xRight:t.xLeft,yTop:t.yTop+(t.yBot-t.yTop)/2}},e}(r.a)},function(t,e,n){"use strict";var i=n(0),r=n(1);n.d(e,"a",function(){return o});var o=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.bricks=[],this.isPageBreak=!1,this._xLeft=0,this._xRight=0,this._yTop=0,this._yBot=0,this.addBrick.apply(this,t)}return Object.defineProperty(t.prototype,"xLeft",{get:function(){return this._xLeft},set:function(t){this.shift(t-this.xLeft,0,0,0),this._xLeft=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xRight",{get:function(){return this._xRight},set:function(t){this.shift(0,t-this.xRight,0,0),this._xRight=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yTop",{get:function(){return this._yTop},set:function(t){this.shift(0,0,t-this.yTop,0),this._yTop=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yBot",{get:function(){return this._yBot},set:function(t){this.shift(0,0,0,t-this.yBot),this._yBot=t},enumerable:!1,configurable:!0}),t.prototype.shift=function(t,e,n,i){this.bricks.forEach(function(r){r.xLeft+=t,r.xRight+=e,r.yTop+=n,r.yBot+=i})},Object.defineProperty(t.prototype,"width",{get:function(){return this.xRight-this.xLeft},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.yBot-this.yTop},enumerable:!1,configurable:!0}),t.prototype.render=function(){return n.i(i.b)(this,void 0,void 0,function(){var t;return n.i(i.c)(this,function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.bricks.length?[4,this.bricks[t].render()]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}})})},Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this.bricks.length},enumerable:!1,configurable:!0}),t.prototype.addBrick=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0!=e.length){(t=this.bricks).push.apply(t,e);var i=r.a.mergeRects.apply(r.a,this.bricks);this._xLeft=i.xLeft,this._xRight=i.xRight,this._yTop=i.yTop,this._yBot=i.yBot}},t.prototype.unfold=function(){var t=[];return this.bricks.forEach(function(e){t.push.apply(t,e.unfold())}),t},t.prototype.translateX=function(t){this.bricks.forEach(function(e){return e.translateX(t)});var e=t(this.xLeft,this.xRight);this._xLeft=e.xLeft,this._xRight=e.xRight},t}()},function(e,n){e.exports=t},function(t,e,n){"use strict";var i=n(0),r=n(8),o=n(1);n.d(e,"a",function(){return a});var a=function(){function t(t,e,n){this.question=t,this.controller=e,this.textColor=o.a.TEXT_COLOR,this.formBorderColor=o.a.FORM_BORDER_COLOR,this.isPageBreak=!1,this.xLeft=n.xLeft,this.xRight=n.xRight,this.yTop=n.yTop,this.yBot=n.yBot,this.fontSize=e?e.fontSize:r.b.FONT_SIZE}return Object.defineProperty(t.prototype,"xLeft",{get:function(){return this._xLeft},set:function(t){this.setXLeft(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xRight",{get:function(){return this._xRight},set:function(t){this.setXRight(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yTop",{get:function(){return this._yTop},set:function(t){this.setYTop(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yBot",{get:function(){return this._yBot},set:function(t){this.setYBottom(t)},enumerable:!1,configurable:!0}),t.prototype.translateX=function(t){var e=t(this.xLeft,this.xRight);this.xLeft=e.xLeft,this.xRight=e.xRight},Object.defineProperty(t.prototype,"width",{get:function(){return this.xRight-this.xLeft},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.yBot-this.yTop},enumerable:!1,configurable:!0}),t.prototype.getShouldRenderReadOnly=function(){return o.a.shouldRenderReadOnly(this.question,this.controller)},t.prototype.render=function(){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(t){switch(t.label){case 0:return this.getShouldRenderReadOnly()?[4,this.renderReadOnly()]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,this.renderInteractive()];case 3:t.sent(),t.label=4;case 4:return this.afterRenderCallback&&this.afterRenderCallback(),[2]}})})},t.prototype.renderInteractive=function(){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(t){return[2]})})},t.prototype.renderReadOnly=function(){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(t){switch(t.label){case 0:return[4,this.renderInteractive()];case 1:return t.sent(),[2]}})})},t.prototype.unfold=function(){return[this]},t.prototype.getCorrectedText=function(t){return this.controller.isRTL?(t||"").split("").reverse().join(""):t},t.prototype.setXLeft=function(t){this._xLeft=t},t.prototype.setXRight=function(t){this._xRight=t},t.prototype.setYTop=function(t){this._yTop=t},t.prototype.setYBottom=function(t){this._yBot=t},t}()},function(t,e,n){"use strict";var i=n(0),r=n(18),o=(n.n(r),n(1)),a=n(58),s=n(62),c=(n.n(s),n(63));n.n(c);n.d(e,"a",function(){return l}),n.d(e,"b",function(){return u});var l=function(){function t(e){var n=this;this._base64Normal=void 0,this._base64Bold=void 0,void 0===e.orientation?void 0===e.format||e.format[0]<e.format[1]?this._orientation="p":this._orientation="l":this._orientation=e.orientation,this._format=e.format||"a4",Array.isArray(this._format)&&(this._format=this._format.map(function(e){return e*t.MM_TO_PT})),this._fontSize=e.fontSize||t.FONT_SIZE,e.fontName?this._fontName=e.fontName:t.SEGOE_BOLD||t.SEGOE_NORMAL?this._fontName="segoe":this._fontName=o.a.STANDARD_FONT,void 0===e.fontName||void 0===e.base64Normal&&void 0===e.base64Bold?"segoe"===this.fontName&&(this._base64Normal=t.SEGOE_NORMAL,this._base64Bold=t.SEGOE_BOLD):(this._base64Normal=e.base64Normal||e.base64Bold,this._base64Bold=e.base64Bold||e.base64Normal),this._margins=o.a.clone(e.margins),void 0===this._margins&&(this._margins={}),void 0===this._margins.top&&(this._margins.top=10),void 0===this._margins.bot&&(this._margins.bot=10),void 0===this._margins.left&&(this._margins.left=10),void 0===this._margins.right&&(this._margins.right=10),Object.keys(this._margins).forEach(function(e){n._margins[e]=n._margins[e]*t.MM_TO_PT}),this._htmlRenderAs=e.htmlRenderAs||"auto",this._matrixRenderAs=e.matrixRenderAs||"auto",this._readonlyRenderAs=e.readonlyRenderAs||"auto",this._compress=e.compress||!1,this._applyImageFit=e.applyImageFit||!1,this._useLegacyBooleanRendering=e.useLegacyBooleanRendering||!1,this._isRTL=e.isRTL||!1,this._tagboxSelectedChoicesOnly=e.tagboxSelectedChoicesOnly||!1}return Object.defineProperty(t.prototype,"leftTopPoint",{get:function(){return{xLeft:this.margins.left,yTop:this.margins.top}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontName",{get:function(){return this._fontName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"base64Normal",{get:function(){return this._base64Normal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"base64Bold",{get:function(){return this._base64Bold},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useCustomFontInHtml",{get:function(){return this._useCustomFontInHtml},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"margins",{get:function(){return this._margins},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){return this._format},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orientation",{get:function(){return this._orientation},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"htmlRenderAs",{get:function(){return this._htmlRenderAs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"matrixRenderAs",{get:function(){return this._matrixRenderAs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readonlyRenderAs",{get:function(){return this._readonlyRenderAs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"compress",{get:function(){return this._compress},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"applyImageFit",{get:function(){return this._applyImageFit},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useLegacyBooleanRendering",{get:function(){return this._useLegacyBooleanRendering},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRTL",{get:function(){return this._isRTL},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagboxSelectedChoicesOnly",{get:function(){return this._tagboxSelectedChoicesOnly},enumerable:!1,configurable:!0}),t.MM_TO_PT=72/25.4,t.FONT_SIZE=14,t}(),u=function(t){function e(i){void 0===i&&(i={});var s=t.call(this,i)||this,c={orientation:s.orientation,unit:"pt",format:s.format,compress:s.compress};return s._doc=new r.jsPDF(c),void 0===s.base64Normal||o.a.isFontExist(s,s.fontName)||(e.addFont(s.fontName,s.base64Normal,"normal"),e.addFont(s.fontName,s.base64Bold,"bold"),s._doc=new r.jsPDF(c)),n.i(a.a)(s._doc),s._useCustomFontInHtml=i.useCustomFontInHtml&&o.a.isFontExist(s,s.fontName),s._helperDoc=new r.jsPDF(c),s._doc.setFont(s.fontName),s._helperDoc.setFont(s.fontName),s._doc.setFontSize(s.fontSize),s._helperDoc.setFontSize(s.fontSize),s._fontStyle="normal",s.marginsStack=[],s}return n.i(i.a)(e,t),e.addFont=function(t,n,i){var o=e.customFonts[t];o||(o={},e.customFonts[t]=o),o[i]=n;var a=function(){var n=e.customFonts[t];if(n&&n[i]){var r="".concat(t,"-").concat(i,".ttf");this.addFileToVFS(r,n[i]),this.addFont(r,t,i)}};r.jsPDF.API.events.push(["addFonts",a])},Object.defineProperty(e.prototype,"doc",{get:function(){return this._doc},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"helperDoc",{get:function(){return this._helperDoc},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){this._fontName=t,this._doc.setFont(t),this._helperDoc.setFont(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize=t,this._doc.setFontSize(t),this._helperDoc.setFontSize(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle=t,this._doc.setFont(this._fontName,t),this._helperDoc.setFont(this._fontName,t)},enumerable:!1,configurable:!0}),e.prototype.measureText=function(t,e,n){var i=this;void 0===t&&(t=1),void 0===e&&(e=this._fontStyle),void 0===n&&(n=this._fontSize);var r=this._helperDoc.getFontSize();this._helperDoc.setFontSize(n),this._helperDoc.setFont(this._fontName,e);var a=this._helperDoc.getLineHeight()/this._helperDoc.internal.scaleFactor,s=0;return"number"==typeof t?s=a*t:(t="string"==typeof t?t:o.a.getLocString(t),s=t.split("").reduce(function(t,e){return t+i._helperDoc.getTextWidth(e)},0)),this._helperDoc.setFontSize(r),this._helperDoc.setFont(this._fontName,"normal"),{width:s,height:a}},Object.defineProperty(e.prototype,"unitWidth",{get:function(){return this.measureText().width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unitHeight",{get:function(){return this.measureText().height},enumerable:!1,configurable:!0}),e.prototype.pushMargins=function(t,e){this.marginsStack.push({left:this.margins.left,right:this.margins.right}),void 0!==t&&(this.margins.left=t),void 0!==e&&(this.margins.right=e)},e.prototype.popMargins=function(){var t=this.marginsStack.pop();this.margins.left=t.left,this.margins.right=t.right},Object.defineProperty(e.prototype,"paperWidth",{get:function(){return this.doc.internal.pageSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paperHeight",{get:function(){return this.doc.internal.pageSize.height},enumerable:!1,configurable:!0}),e.prototype.getNumberOfPages=function(){return this.doc.getNumberOfPages()},e.prototype.addPage=function(){this.doc.addPage()},e.prototype.getCurrentPageIndex=function(){return this.doc.getCurrentPageInfo().pageNumber-1},e.prototype.setPage=function(t){this.doc.setPage(t+1)},e.customFonts={},e}(l)},function(t,e,n){"use strict";var i=n(0),r=n(2),o=n(31),a=n(15);n.d(e,"a",function(){return s});var s=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n.i(i.a)(e,t),e.prototype.isItemSelected=function(t,e){return void 0===e?t===this.question.otherItem?this.question.isOtherSelected:t.value===this.question.value||void 0!==this.question.isItemSelected&&this.question.isItemSelected(t):e},e.prototype.generateFlatItem=function(t,e,r,a,s,c){void 0===c&&(c={}),0===r?(this.radioGroupWrap=new o.b(this.question.id+(void 0===a?"":a),this.controller,n.i(i.e)({readOnly:this.question.isReadOnly,question:this.question},c)),this.question.pdfRadioGroupWrap=this.radioGroupWrap):void 0===this.radioGroupWrap&&(this.radioGroupWrap=this.question.pdfRadioGroupWrap);var l=this.isItemSelected(e,s);return new o.a(this.controller,t,{question:this.question,index:r,checked:l,item:e},this.radioGroupWrap)},e}(a.a);r.a.getInstance().register("radiogroup",s),r.a.getInstance().register("buttongroup",s)},function(t,e,n){"use strict";var i=n(0),r=n(6),o=(n.n(r),n(5)),a=n(16),s=n(1),c=n(35),l=n(14);n.d(e,"a",function(){return u});var u=function(){function t(){}return t.generateFlatsPanel=function(t,e,r,o){return n.i(i.b)(this,void 0,void 0,function(){var a,u,h,f,d,p;return n.i(i.c)(this,function(g){switch(g.label){case 0:return a=[],u=s.a.clone(o),e.pushMargins(),e.margins.left+=e.measureText(r.innerIndent).width,u.xLeft+=e.measureText(r.innerIndent).width,f=(h=a.push).apply,d=[a],[4,this.generateFlatsPagePanel(t,e,r,u)];case 1:return f.apply(h,d.concat([g.sent()])),e.popMargins(),p=new c.a(o,a,r,e,l.FlatRepository.getInstance(),l),[4,t.onRenderPanel.fire(t,p)];case 2:return g.sent(),[2,n.i(i.d)([],p.bricks,!0)]}})})},t.generateFlatsPagePanel=function(e,a,c,l){return n.i(i.b)(this,void 0,void 0,function(){var u,h,f,d,p,g,m,v,y,b,x,T,_,F,w,R,C,P,E,O,S,L,B;return n.i(i.c)(this,function(n){switch(n.label){case 0:return c.isVisible?(c.onFirstRendering(),u=[],h=s.a.clone(l),"page"!==c.getType()||e.showPageTitles?(f=new o.a,c.title?c instanceof r.PanelModel&&c.no?[4,s.a.createTitlePanelFlat(h,a,c.no,"page"===c.getType())]:[3,2]:[3,4]):[3,7]):[2];case 1:d=n.sent(),f.addBrick(d),h.xLeft=d.xRight+a.measureText(" ").width,n.label=2;case 2:return[4,s.a.createTitlePanelFlat(h,a,c.locTitle,"page"===c.getType())];case 3:p=n.sent(),f.addBrick(p),h=s.a.createPoint(p),n.label=4;case 4:return c.description?(c.title&&(h.yTop+=a.unitWidth*t.PANEL_DESC_GAP_SCALE),[4,s.a.createDescFlat(h,null,a,c.locDescription)]):[3,6];case 5:g=n.sent(),f.addBrick(g),h=s.a.createPoint(g),n.label=6;case 6:f.isEmpty||(m=s.a.createPoint(f),f.addBrick(s.a.createRowlineFlat(m,a)),u.push(f),h.yTop+=a.unitHeight*t.PANEL_CONT_GAP_SCALE+s.a.EPSILON),n.label=7;case 7:v=0,y=c.rows,n.label=8;case 8:if(!(v<y.length))return[3,16];if(b=y[v],!b.visible)return[3,15];a.pushMargins(),x=s.a.getPageAvailableWidth(a),T=a.margins.left,_=[],F=b.elements.filter(function(t){return t.isVisible}),w=0,n.label=9;case 9:return w<F.length?(R=F[w],R.isVisible?(C=s.a.parseWidth(R.renderWidth,x-(F.length-1)*a.unitWidth,F.length),a.margins.left=T+(0!==w?a.unitWidth:0),a.margins.right=a.paperWidth-a.margins.left-C,h.xLeft=a.margins.left,T=a.margins.left+C,R instanceof r.PanelModel?(E=(P=_.push).apply,O=[_],[4,this.generateFlatsPanel(e,a,R,h)]):[3,11]):[3,13]):[3,14];case 10:return E.apply(P,O.concat([n.sent()])),[3,13];case 11:return L=(S=_.push).apply,B=[_],[4,s.a.generateQuestionFlats(e,a,R,h)];case 12:L.apply(S,B.concat([n.sent()])),n.label=13;case 13:return w++,[3,9];case 14:a.popMargins(),h.xLeft=a.margins.left,0!==_.length&&(h.yTop=s.a.mergeRects.apply(s.a,_).yBot,h.xLeft=l.xLeft,h.yTop+=a.unitHeight*t.QUES_GAP_VERT_SCALE,u.push.apply(u,_),u.push(s.a.createRowlineFlat(h,a)),h.yTop+=s.a.EPSILON),n.label=15;case 15:return v++,[3,8];case 16:return[2,u]}})})},t.popRowlines=function(t){for(;t.length>0&&t[t.length-1]instanceof a.a;)t.pop()},t.generateFlatTitle=function(e,r,a){return n.i(i.b)(this,void 0,void 0,function(){var c,l,u,h;return n.i(i.c)(this,function(n){switch(n.label){case 0:return c=new o.a,e.showTitle?e.title?[4,s.a.createTitleSurveyFlat(a,r,e.locTitle)]:[3,2]:[3,4];case 1:l=n.sent(),c.addBrick(l),a=s.a.createPoint(l),n.label=2;case 2:return e.description?(e.title&&(a.yTop+=r.unitWidth*t.PANEL_DESC_GAP_SCALE),h=(u=c).addBrick,[4,s.a.createDescFlat(a,null,r,e.locDescription)]):[3,4];case 3:h.apply(u,[n.sent()]),n.label=4;case 4:return[2,c]}})})},t.generateFlatLogoImage=function(t,e,r){return n.i(i.b)(this,void 0,void 0,function(){var o,a,c,l;return n.i(i.c)(this,function(n){switch(n.label){case 0:return o=s.a.getLocString(t.locLogo),[4,s.a.getCorrectedImageSize(e,{imageLink:o,imageHeight:t.logoHeight,imageWidth:t.logoWidth,defaultImageWidth:"300px",defaultImageHeight:"200px"})];case 1:return a=n.sent(),[4,s.a.createImageFlat(r,null,e,{link:o,width:a.width,height:a.height})];case 2:return c=n.sent(),l=0,"right"===t.logoPosition?l=s.a.getPageAvailableWidth(e)-c.width:"left"!==t.logoPosition&&(l=s.a.getPageAvailableWidth(e)/2-c.width/2),c.xLeft+=l,c.xRight+=l,[2,c]}})})},t.generateFlats=function(e,r){return n.i(i.b)(this,void 0,void 0,function(){var o,a,u,h,a,u,a,a,f,u,d,p,g,m,v,y,b,x;return n.i(i.c)(this,function(T){switch(T.label){case 0:return o=[],e.hasLogo?[3,2]:[4,this.generateFlatTitle(e,r,r.leftTopPoint)];case 1:return a=T.sent(),a.isEmpty||o.push([a]),[3,11];case 2:return e.isLogoBefore?[4,this.generateFlatLogoImage(e,r,r.leftTopPoint)]:[3,5];case 3:return u=T.sent(),o.push([u]),h=s.a.createPoint(u,"top"===e.logoPosition,"top"!==e.logoPosition),"top"!==e.logoPosition?(r.pushMargins(),h.xLeft+=r.unitWidth,r.margins.left+=u.width+r.unitWidth):(h.xLeft=r.leftTopPoint.xLeft,h.yTop+=r.unitHeight/2),[4,this.generateFlatTitle(e,r,h)];case 4:return a=T.sent(),"top"!==e.logoPosition&&r.popMargins(),a.isEmpty||o[0].push(a),[3,11];case 5:return"right"!==e.logoPosition?[3,8]:[4,this.generateFlatLogoImage(e,r,r.leftTopPoint)];case 6:return u=T.sent(),o.push([u]),r.pushMargins(),r.margins.right+=u.width+r.unitWidth,[4,this.generateFlatTitle(e,r,r.leftTopPoint)];case 7:return a=T.sent(),a.isEmpty||o[0].unshift(a),r.popMargins(),[3,11];case 8:return[4,this.generateFlatTitle(e,r,r.leftTopPoint)];case 9:return a=T.sent(),f=r.leftTopPoint,a.isEmpty||(o.push([a]),f=s.a.createPoint(a),f.yTop+=r.unitHeight/2),[4,this.generateFlatLogoImage(e,r,f)];case 10:u=T.sent(),0!==o.length?o[0].push(u):o.push([u]),T.label=11;case 11:d=r.leftTopPoint,0!==o.length&&(d.yTop=s.a.createPoint(s.a.mergeRects.apply(s.a,o[0])).yTop,o[0].push(s.a.createRowlineFlat(d,r)),d.yTop+=r.unitHeight*t.PANEL_CONT_GAP_SCALE+s.a.EPSILON),p=0,T.label=12;case 12:return p<e.visiblePages.length?(e.currentPage=e.visiblePages[p],g=[],v=(m=g.push).apply,y=[g],[4,this.generateFlatsPagePanel(e,r,e.visiblePages[p],d)]):[3,16];case 13:return v.apply(m,y.concat([T.sent()])),b=new c.b(d,g,e.visiblePages[p],r,l.FlatRepository.getInstance(),l),[4,e.onRenderPage.fire(e,b)];case 14:T.sent(),g=n.i(i.d)([],b.bricks,!0),0===p&&0!==o.length?(x=o[0]).push.apply(x,g):o.push(g),this.popRowlines(o[o.length-1]),d.yTop=r.leftTopPoint.yTop,T.label=15;case 15:return p++,[3,12];case 16:return[2,o]}})})},t.QUES_GAP_VERT_SCALE=1.5,t.PANEL_CONT_GAP_SCALE=1,t.PANEL_DESC_GAP_SCALE=.25,t}()},function(t,e,n){"use strict";var i=n(0),r=n(7),o=n(4),a=n(1);n.d(e,"a",function(){return s});var s=function(t){function e(e,n,i,r){var o=t.call(this,r.question,e,n)||this;return o.fieldName=i,o.context=r,o.question=o.context.question,o.textColor=o.formBorderColor,o}return n.i(i.a)(e,t),e.prototype.getShouldRenderReadOnly=function(){return this.context.readOnly&&"acroform"!==a.a.getReadonlyRenderAs(this.question,this.controller)||this.controller.compress},e.prototype.renderInteractive=function(){var t;return n.i(i.b)(this,void 0,void 0,function(){var r,o,s;return n.i(i.c)(this,function(n){return r=new this.controller.doc.AcroFormCheckBox,o=a.a.formScale(this.controller,this),s={},s.maxFontSize=this.height*o*e.FONT_SIZE_SCALE,s.caption=e.CHECKMARK_READONLY_SYMBOL,s.textAlign="center",s.fieldName=this.fieldName,s.readOnly=this.context.readOnly,s.color=this.formBorderColor,s.value=!!this.context.checked&&"On",s.AS=this.context.checked?"/On":"/Off",s.context=this.context,s.Rect=a.a.createAcroformRect(a.a.scaleRect(this,o)),this.controller.doc.addField(r),null===(t=this.question.survey)||void 0===t||t.getUpdatedCheckItemAcroformOptions(s),r.maxFontSize=s.maxFontSize,r.caption=s.caption,r.textAlign=s.textAlign,r.fieldName=s.fieldName,r.readOnly=s.readOnly,r.color=s.color,r.value=s.value,r.AS=s.AS,r.Rect=s.Rect,a.a.renderFlatBorders(this.controller,this),[2]})})},e.prototype.renderReadOnly=function(){return n.i(i.b)(this,void 0,void 0,function(){var t,r,s,c,l;return n.i(i.c)(this,function(n){switch(n.label){case 0:return a.a.renderFlatBorders(this.controller,this),this.context.checked?(t=a.a.createPoint(this,!0,!0),r=this.controller.fontName,this.controller.fontName=e.CHECKMARK_READONLY_FONT,s=this.controller.fontSize,this.controller.fontSize=s*e.CHECKMARK_READONLY_FONT_SIZE_SCALE,c=this.controller.measureText(e.CHECKMARK_READONLY_SYMBOL),t.xLeft+=this.width/2-c.width/2,t.yTop+=this.height/2-c.height/2,[4,a.a.createTextFlat(t,this.question,this.controller,e.CHECKMARK_READONLY_SYMBOL,o.a)]):[3,3];case 1:return l=n.sent(),l.unfold()[0].textColor=this.textColor,this.controller.fontSize=s,[4,l.render()];case 2:n.sent(),this.controller.fontName=r,n.label=3;case 3:return[2]}})})},e.FONT_SIZE_SCALE=.7,e.CHECKMARK_READONLY_SYMBOL="3",e.CHECKMARK_READONLY_FONT="zapfdingbats",e.CHECKMARK_READONLY_FONT_SIZE_SCALE=1-Math.E/10,e}(r.a)},function(t,e,n){"use strict";var i=n(0),r=n(7),o=n(1);n.d(e,"a",function(){return a});var a=function(t){function e(e,n,i){void 0===n&&(n=null),void 0===i&&(i=!1);var r=t.call(this,null,n,e)||this;return r.controller=n,r.isBorderVisible=!1,r.isBorderVisible=i,r}return n.i(i.a)(e,t),e.prototype.resizeBorder=function(t){var e=t?1:-1,n=this.controller.doc.getFontSize()*o.a.VALUE_READONLY_PADDING_SCALE;this.xLeft-=e*n,this.xRight+=e*n,this.yBot+=e*n},e.prototype.renderInteractive=function(){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(t){return this.isBorderVisible&&(this.resizeBorder(!0),o.a.renderFlatBorders(this.controller,this),this.resizeBorder(!1)),[2]})})},e}(r.a)},function(t,e,n){"use strict";var i=n(0),r=n(4);n.d(e,"a",function(){return o});var o=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return n.i(i.a)(e,t),e.prototype.renderInteractive=function(){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(e){switch(e.label){case 0:return this.controller.fontStyle="bold",[4,t.prototype.renderInteractive.call(this)];case 1:return e.sent(),this.controller.fontStyle="normal",[2]}})})},e}(r.a)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=n(55);n.d(e,"SurveyPDF",function(){return i.a});var r=n(1);n.d(e,"SurveyHelper",function(){return r.a});var o=n(8);n.d(e,"DocOptions",function(){return o.a}),n.d(e,"DocController",function(){return o.b});var a=n(2);n.d(e,"FlatRepository",function(){return a.a});var s=n(3);n.d(e,"FlatQuestion",function(){return s.a});var c=n(21);n.d(e,"FlatQuestionDefault",function(){return c.a});var l=n(36);n.d(e,"FlatBoolean",function(){return l.a});var u=n(37);n.d(e,"FlatCheckbox",function(){return u.a});var h=n(39);n.d(e,"FlatCustomModel",function(){return h.a});var f=n(38);n.d(e,"FlatComment",function(){return f.a});var d=n(40);n.d(e,"FlatDropdown",function(){return d.a});var p=n(41);n.d(e,"FlatExpression",function(){return p.a});var g=n(42);n.d(e,"FlatFile",function(){return g.a});var m=n(43);n.d(e,"FlatHTML",function(){return m.a});var v=n(44);n.d(e,"FlatImage",function(){return v.a});var y=n(45);n.d(e,"FlatImagePicker",function(){return y.a});var b=n(49);n.d(e,"FlatPanelDynamic",function(){return b.a});var x=n(9);n.d(e,"FlatRadiogroup",function(){return x.a});var T=n(50);n.d(e,"FlatRanking",function(){return T.a});var _=n(51);n.d(e,"FlatRating",function(){return _.a});var F=n(15);n.d(e,"FlatSelectBase",function(){return F.a});var w=n(52);n.d(e,"FlatSignaturePad",function(){return w.a});var R=n(53);n.d(e,"FlatTextbox",function(){return R.a});var C=n(10);n.d(e,"FlatSurvey",function(){return C.a});var P=n(46);n.d(e,"FlatMatrix",function(){return P.a});var E=n(22);n.d(e,"FlatMatrixMultiple",function(){return E.a});var O=n(47);n.d(e,"FlatMatrixDynamic",function(){return O.a});var S=n(48);n.d(e,"FlatMultipleText",function(){return S.a});var L=n(23);n.d(e,"PagePacker",function(){return L.a});var B=n(20);n.d(e,"EventHandler",function(){return B.a});var A=n(19);n.d(e,"HorizontalAlign",function(){return A.a}),n.d(e,"VerticalAlign",function(){return A.b}),n.d(e,"DrawCanvas",function(){return A.c});var N=n(7);n.d(e,"PdfBrick",function(){return N.a});var I=n(24);n.d(e,"BooleanItemBrick",function(){return I.a});var M=n(25);n.d(e,"CheckboxItemBrick",function(){return M.a});var W=n(11);n.d(e,"CheckItemBrick",function(){return W.a});var k=n(26);n.d(e,"CommentBrick",function(){return k.a});var q=n(5);n.d(e,"CompositeBrick",function(){return q.a});var H=n(54);n.d(e,"CustomBrick",function(){return H.a});var D=n(27);n.d(e,"DropdownBrick",function(){return D.a});var j=n(12);n.d(e,"EmptyBrick",function(){return j.a});var z=n(28);n.d(e,"HTMLBrick",function(){return z.a});var G=n(29);n.d(e,"ImageBrick",function(){return G.a});var V=n(30);n.d(e,"LinkBrick",function(){return V.a});var U=n(31);n.d(e,"RadioItemBrick",function(){return U.a});var Y=n(32);n.d(e,"RankingItemBrick",function(){return Y.a});var Q=n(16);n.d(e,"RowlineBrick",function(){return Q.a});var X=n(33);n.d(e,"TextFieldBrick",function(){return X.a});var K=n(13);n.d(e,"TextBoldBrick",function(){return K.a});var Z=n(17);n.d(e,"TextBoxBrick",function(){return Z.a});var J=n(4);n.d(e,"TextBrick",function(){return J.a});var $=n(34);n.d(e,"TitlePanelBrick",function(){return $.a});var tt=n(6);n.n(tt);n.i(tt.checkLibraryVersion)("".concat("2.0.0-rc.2"),"survey-pdf")},function(t,e,n){"use strict";var i=n(0),r=n(3),o=n(4),a=n(5),s=n(1);n.d(e,"a",function(){return c});var c=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n.i(i.a)(e,t),e.prototype.generateFlatComposite=function(t,e,r){return n.i(i.b)(this,void 0,void 0,function(){var c,l,u,h,f,d,p,g,m;return n.i(i.c)(this,function(n){switch(n.label){case 0:return c=new a.a,(l=s.a.createRect(t,this.controller.unitWidth,this.controller.unitHeight),u=this.generateFlatItem(s.a.moveRect(s.a.scaleRect(l,s.a.SELECT_ITEM_FLAT_SCALE),t.xLeft),e,r),c.addBrick(u),h=s.a.clone(t),h.xLeft=u.xRight+this.controller.unitWidth*s.a.GAP_BETWEEN_ITEM_TEXT,null===e.locText.renderedHtml)?[3,2]:(d=(f=c).addBrick,[4,s.a.createTextFlat(h,this.question,this.controller,e.locText,o.a)]);case 1:d.apply(f,[n.sent()]),n.label=2;case 2:return e===this.question.otherItem&&(e.value===this.question.value||void 0!==this.question.isOtherSelected&&this.question.isOtherSelected)?(p=s.a.createPoint(c),p.yTop+=this.controller.unitHeight*s.a.GAP_BETWEEN_ROWS,m=(g=c).addBrick,[4,s.a.createCommentFlat(p,this.question,this.controller,!1,{index:r,rows:s.a.OTHER_ROWS_COUNT})]):[3,4];case 3:m.apply(g,[n.sent()]),n.label=4;case 4:return[2,c]}})})},e.prototype.getVisibleChoices=function(){return this.question.visibleChoices},e.prototype.getColCount=function(){return this.question.colCount},e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,a;return n.i(i.c)(this,function(n){switch(n.label){case 0:return e=this.getColCount(),r=this.getVisibleChoices(),o=e,0==e?(o=Math.floor(s.a.getPageAvailableWidth(this.controller)/this.controller.measureText(s.a.MATRIX_COLUMN_WIDTH).width)||1,r.length<o&&(o=r.length)):e>1&&(o=s.a.getColumnWidth(this.controller,e)<this.controller.measureText(s.a.MATRIX_COLUMN_WIDTH).width?1:e),1!=o?[3,2]:[4,this.generateVerticallyItems(t,r)];case 1:return a=n.sent(),[3,4];case 2:return[4,this.generateHorisontallyItems(t,o)];case 3:a=n.sent(),n.label=4;case 4:return[2,a]}})})},e.prototype.generateVerticallyItems=function(t,e){return n.i(i.b)(this,void 0,void 0,function(){var r,o,a,c;return n.i(i.c)(this,function(n){switch(n.label){case 0:r=s.a.clone(t),o=[],a=0,n.label=1;case 1:return a<e.length?[4,this.generateFlatComposite(r,e[a],a)]:[3,4];case 2:c=n.sent(),r.yTop=c.yBot+s.a.GAP_BETWEEN_ROWS*this.controller.unitHeight,o.push(c),n.label=3;case 3:return a++,[3,1];case 4:return[2,o]}})})},e.prototype.generateHorisontallyItems=function(t,e){return n.i(i.b)(this,void 0,void 0,function(){var r,o,c,l,u,h,f;return n.i(i.c)(this,function(n){switch(n.label){case 0:r=this.getVisibleChoices(),o=s.a.clone(t),c=[],l=new a.a,u=0,n.label=1;case 1:return u<r.length?(this.controller.pushMargins(this.controller.margins.left,this.controller.margins.right),s.a.setColumnMargins(this.controller,e,u%e),o.xLeft=this.controller.margins.left,[4,this.generateFlatComposite(o,r[u],u)]):[3,4];case 2:h=n.sent(),l.addBrick(h),this.controller.popMargins(),u%e!=e-1&&u!==r.length-1||(f=s.a.createRowlineFlat(s.a.createPoint(l),this.controller),o.yTop=f.yBot+s.a.GAP_BETWEEN_ROWS*this.controller.unitHeight,c.push(l,f),l=new a.a),n.label=3;case 3:return u++,[3,1];case 4:return[2,c]}})})},e}(r.a)},function(t,e,n){"use strict";var i=n(0);n.d(e,"a",function(){return r});var r=function(){function t(t,e,n){this.controller=t,this.color=n,this.isPageBreak=!1,this.xLeft=e.xLeft,this.xRight=e.xRight,this.yTop=e.yTop,this.yBot=e.yBot}return Object.defineProperty(t.prototype,"width",{get:function(){return this.xRight-this.xLeft},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.yBot-this.yTop},enumerable:!1,configurable:!0}),t.prototype.render=function(){return n.i(i.b)(this,void 0,void 0,function(){var t;return n.i(i.c)(this,function(e){return null!==this.color&&(t=this.controller.doc.getDrawColor(),this.controller.doc.setDrawColor(this.color),this.controller.doc.line(this.xLeft,this.yTop,this.xRight,this.yTop),this.controller.doc.setDrawColor(t)),[2]})})},t.prototype.unfold=function(){return[this]},t.prototype.translateX=function(t){},t}()},function(t,e,n){"use strict";var i=n(0),r=n(33),o=n(1);n.d(e,"a",function(){return a});var a=function(t){function e(e,n,i,r,a,s){void 0===r&&(r=!0),void 0===a&&(a=!1),void 0===s&&(s=0);var c=t.call(this,e,n,i,r,e.id+(r?"":"_comment"+s),o.a.getQuestionOrCommentValue(e,r),r&&e.locPlaceHolder?o.a.getLocString(e.locPlaceHolder):"",e.isReadOnly,a,e.inputType)||this;return c.isQuestion=r,c.isMultiline=a,c}return n.i(i.a)(e,t),e}(r.a)},function(t,n){t.exports=e},function(t,e,n){"use strict";var i=n(0),r=n(8),o=n(4),a=n(13),s=n(1);n.d(e,"a",function(){return c}),n.d(e,"b",function(){return l}),n.d(e,"c",function(){return u});var c;!function(t){t.NotSet="notset",t.Left="left",t.Center="center",t.Right="right"}(c||(c={}));var l;!function(t){t.NotSet="notset",t.Top="top",t.Middle="middle",t.Bottom="bottom"}(l||(l={}));var u=function(){function t(t,e,n,i,r){this.packs=t,this.controller=e,this._rect=n,this._countPages=i,this._pageNumber=r}return Object.defineProperty(t.prototype,"pageCount",{get:function(){return this._countPages},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"countPages",{get:function(){return this._countPages},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageNumber",{get:function(){return this._pageNumber},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rect",{get:function(){return this._rect},enumerable:!1,configurable:!0}),t.prototype.alignRect=function(t,e){void 0===t.margins?t.margins={left:0,right:0,top:0,bot:0}:(void 0===t.margins.left&&(t.margins.left=0),void 0===t.margins.right&&(t.margins.right=0),void 0===t.margins.top&&(t.margins.top=0),void 0===t.margins.bot&&(t.margins.bot=0)),void 0===t.rect&&(void 0!==t.horizontalAlign&&t.horizontalAlign!==c.NotSet||(t.horizontalAlign=c.Center),void 0!==t.verticalAlign&&t.verticalAlign!==l.NotSet||(t.verticalAlign=l.Middle));var n=s.a.clone(this.rect);if(void 0!==t.horizontalAlign)switch(t.horizontalAlign){case c.Left:n.xLeft=this.rect.xLeft+t.margins.left,n.xRight=Math.min(this.rect.xRight-t.margins.right,this.rect.xLeft+t.margins.left+e.width);break;case c.Center:n.xLeft=Math.max(this.rect.xLeft+t.margins.left,(this.rect.xLeft+this.rect.xRight-e.width)/2),n.xRight=Math.min(this.rect.xRight-t.margins.right,(this.rect.xLeft+this.rect.xRight+e.width)/2);break;case c.Right:n.xLeft=Math.max(this.rect.xLeft+t.margins.left,this.rect.xRight-t.margins.right-e.width),n.xRight=this.rect.xRight-t.margins.right}else n.xLeft=t.rect.xLeft||this.rect.xLeft,n.xRight=t.rect.xRight||this.rect.xRight;if(void 0!==t.verticalAlign)switch(t.verticalAlign){case l.Top:n.yTop=this.rect.yTop+t.margins.top,n.yBot=Math.min(this.rect.yBot-t.margins.bot,this.rect.yTop+t.margins.top+e.height);break;case l.Middle:n.yTop=Math.max(this.rect.yTop+t.margins.top,(this.rect.yTop+this.rect.yBot-e.height)/2),n.yBot=Math.min(this.rect.yBot-t.margins.bot,(this.rect.yTop+this.rect.yBot+e.height)/2);break;case l.Bottom:n.yTop=Math.max(this.rect.yTop+t.margins.top,this.rect.yBot-t.margins.bot-e.height),n.yBot=this.rect.yBot-t.margins.bot}else n.yTop=t.rect.yTop||this.rect.yTop,n.yBot=t.rect.yBot||this.rect.yBot;return n},t.prototype.drawText=function(t){t=s.a.clone(t),void 0===t.fontSize&&(t.fontSize=r.a.FONT_SIZE),void 0===t.isBold&&(t.isBold=!1);var e=this.controller.measureText(t.text,t.isBold?"bold":"normal",t.fontSize),n=this.alignRect(t,e);t.isBold?this.packs.push(new a.a(null,this.controller,n,t.text)):this.packs.push(new o.a(null,this.controller,n,t.text)),this.packs[this.packs.length-1].fontSize=t.fontSize},t.prototype.drawImage=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,a;return n.i(i.c)(this,function(n){switch(n.label){case 0:return t=s.a.clone(t),void 0===t.width&&(t.width=this.rect.xRight-this.rect.xLeft),void 0===t.height&&(t.height=this.rect.yBot-this.rect.yTop),e={width:t.width,height:t.height},r=this.alignRect(t,e),this.controller.pushMargins(0,0),a=(o=this.packs).push,[4,s.a.createImageFlat(s.a.createPoint(r,!0,!0),null,this.controller,{link:t.base64,width:r.xRight-r.xLeft,height:r.yBot-r.yTop,objectFit:t.imageFit},!!t.imageFit||this.controller.applyImageFit)];case 1:return a.apply(o,[n.sent()]),this.controller.popMargins(),[2]}})})},t}()},function(t,e,n){"use strict";var i=n(0),r=n(6),o=(n.n(r),n(19)),a=n(1);n.d(e,"b",function(){return s}),n.d(e,"a",function(){return c});var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.i(i.a)(e,t),e.prototype.unshift=function(t){this.hasFunc(t)||(null==this.callbacks&&(this.callbacks=new Array),this.callbacks.unshift(t))},e.prototype.fire=function(t,e){return n.i(i.b)(this,void 0,void 0,function(){var r;return n.i(i.c)(this,function(n){switch(n.label){case 0:if(null==this.callbacks)return[2];r=0,n.label=1;case 1:return r<this.callbacks.length?[4,this.callbacks[r](t,e)]:[3,4];case 2:n.sent(),n.label=3;case 3:return r++,[3,1];case 4:return[2]}})})},e}(r.EventBase),c=function(){function t(){}return t.process_header_events=function(t,e,r){return n.i(i.b)(this,void 0,void 0,function(){var s;return n.i(i.c)(this,function(n){switch(n.label){case 0:t.haveCommercialLicense||t.onRenderHeader.add(function(t,e){e.drawText({text:"SurveyJS PDF | Please purchase a SurveyJS PDF developer license to use it in your app | https://surveyjs.io/Buy",fontSize:10})}),s=0,n.label=1;case 1:return s<r.length?[4,t.onRenderHeader.fire(t,new o.c(r[s],e,a.a.createHeaderRect(e),r.length,s+1))]:[3,5];case 2:return n.sent(),[4,t.onRenderFooter.fire(t,new o.c(r[s],e,a.a.createFooterRect(e),r.length,s+1))];case 3:n.sent(),n.label=4;case 4:return s++,[3,1];case 5:return[2]}})})},t}()},function(t,e,n){"use strict";var i=n(0),r=n(1),o=n(4),a=n(3);n.d(e,"a",function(){return s});var s=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n.i(i.a)(e,t),e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e;return n.i(i.c)(this,function(n){switch(n.label){case 0:return[4,r.a.createTextFlat(t,this.question,this.controller,"".concat(this.question.displayValue),o.a)];case 1:return e=n.sent(),[2,[e]]}})})},e}(a.a)},function(t,e,n){"use strict";var i=n(0),r=n(6),o=(n.n(r),n(3)),a=n(2),s=n(4),c=n(5),l=n(1),u=n(10);n.d(e,"a",function(){return h});var h=function(t){function e(e,n,i,r){void 0===r&&(r=!0);var o=t.call(this,e,n,i)||this;return o.survey=e,o.isMultiple=r,o.question=n,o}return n.i(i.a)(e,t),Object.defineProperty(e.prototype,"visibleRows",{get:function(){return this.visibleRowsValue||(this.visibleRowsValue=this.question.renderedTable.rows.filter(function(t){return t.visible})),this.visibleRowsValue},enumerable:!1,configurable:!0}),e.prototype.generateFlatsCellTitle=function(t,e){return n.i(i.b)(this,void 0,void 0,function(){var r,o,a;return n.i(i.c)(this,function(n){switch(n.label){case 0:return r=new c.a,a=(o=r).addBrick,[4,l.a.createTextFlat(t,this.question,this.controller,e,s.a)];case 1:return a.apply(o,[n.sent()]),[2,r]}})})},e.prototype.generateFlatsCell=function(t,e,r,o){return void 0===o&&(o=!0),n.i(i.b)(this,void 0,void 0,function(){var u,h,f,d,p,g,m,v,y,b;return n.i(i.c)(this,function(n){switch(n.label){case 0:return u=new c.a,e.hasQuestion?"footer"!=r||e.question.isAnswered?[3,1]:[3,4]:[3,5];case 1:return o&&e.isChoice?(h=a.a.getInstance().create(this.survey,e.question,this.controller,e.question.getType()),f=l.a.moveRect(l.a.scaleRect(l.a.createRect(t,this.controller.unitHeight,this.controller.unitHeight),l.a.SELECT_ITEM_FLAT_SCALE),t.xLeft),u.addBrick(h.generateFlatItem(f,e.item,e.choiceIndex)),[3,4]):[3,2];case 2:return e.question.titleLocation=l.a.TITLE_LOCATION_MATRIX,p=(d=u.addBrick).apply,g=[u],[4,l.a.generateQuestionFlats(this.survey,this.controller,e.question,t)];case 3:p.apply(d,g.concat([n.sent()])),n.label=4;case 4:return[3,9];case 5:return e.hasTitle?"header"!=r?[3,7]:(v=(m=u).addBrick,[4,l.a.createBoldTextFlat(t,this.question,this.controller,e.locTitle)]):[3,9];case 6:return v.apply(m,[n.sent()]),[3,9];case 7:return b=(y=u).addBrick,[4,l.a.createTextFlat(t,this.question,this.controller,e.locTitle,s.a)];case 8:b.apply(y,[n.sent()]),n.label=9;case 9:return[2,u]}})})},Object.defineProperty(e.prototype,"hasDetailPanel",{get:function(){var t=this;return this.visibleRows.some(function(e){return e.row&&t.question.hasDetailPanel(e.row)})},enumerable:!1,configurable:!0}),e.prototype.ignoreCell=function(t,e,n,i){return void 0===i&&(i=!0),!(i||"footer"!=n||!t.hasQuestion||t.question.isAnswered)||!(t.hasQuestion||t.hasTitle||this.isMultiple&&(this.hasDetailPanel?1==e:0==e))},e.prototype.getRowLocation=function(t){return t===this.question.renderedTable.headerRow?"header":this.question.renderedTable.footerRow===t?"footer":void 0},e.prototype.generateFlatsRowHorisontal=function(t,e,r){return n.i(i.b)(this,void 0,void 0,function(){var o,a,s,u,h,f,d;return n.i(i.c)(this,function(n){switch(n.label){case 0:o=new c.a,a=l.a.clone(t),s=this.controller.paperWidth-this.controller.margins.left+this.controller.unitWidth*l.a.GAP_BETWEEN_COLUMNS,this.controller.pushMargins(),u=0,h=this.getRowLocation(e),f=0,n.label=1;case 1:return f<e.cells.length?this.ignoreCell(e.cells[f],f,h)?[3,3]:(this.controller.margins.left=this.controller.paperWidth-s+this.controller.unitWidth*l.a.GAP_BETWEEN_COLUMNS,this.controller.margins.right=this.controller.paperWidth-this.controller.margins.left-r[u],s=this.controller.margins.right,a.xLeft=this.controller.margins.left,[4,this.generateFlatsCell(a,e.cells[f],h)]):[3,4];case 2:d=n.sent(),d.isEmpty||o.addBrick(d),u++,n.label=3;case 3:return f++,[3,1];case 4:return this.controller.popMargins(),[2,o]}})})},e.prototype.generateFlatsRowVertical=function(t,r){var o,a;return n.i(i.b)(this,void 0,void 0,function(){var s,u,h,f,d,p,g,m;return n.i(i.c)(this,function(n){switch(n.label){case 0:s=new c.a,u=l.a.clone(t),h=this.getRowLocation(r),f=0,n.label=1;case 1:return f<r.cells.length?this.ignoreCell(r.cells[f],f,h,!1)?[3,5]:this.question.renderedTable.showHeader&&(!this.isMultiple||f>0)&&(null===(a=null===(o=r.cells[f].cell)||void 0===o?void 0:o.column)||void 0===a?void 0:a.locTitle)?(p=(d=s).addBrick,[4,this.generateFlatsCellTitle(u,r.cells[f].cell.column.locTitle)]):[3,3]:[3,6];case 2:p.apply(d,[n.sent()]),u.yTop=s.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,n.label=3;case 3:return m=(g=s).addBrick,[4,this.generateFlatsCell(u,r.cells[f],h,!1)];case 4:m.apply(g,[n.sent()]),u.yTop=s.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,n.label=5;case 5:return f++,[3,1];case 6:return[2,s]}})})},e.prototype.getAvalableWidth=function(t){return l.a.getPageAvailableWidth(this.controller)-(t-1)*this.controller.unitWidth*l.a.GAP_BETWEEN_COLUMNS},e.prototype.calculateColumnWidth=function(t,e){for(var n=this,i=this.getAvalableWidth(e),r=i,o=e,a=[],s=[],c=t[0].cells.filter(function(t,e){return!n.ignoreCell(t,e)}),u=0;u<e;u++){var h=l.a.parseWidth(c[u].width,i,e)||0;r-=h,0!==h?o--:s.push(c[u]),a.push(h)}if(0===o)return a;var f=this.controller.measureText(l.a.MATRIX_COLUMN_WIDTH).width;return s.sort(function(t,n){var r=l.a.parseWidth(t.minWidth,i,e)||0;return(l.a.parseWidth(n.minWidth,i,e)||0)>r?1:-1}).forEach(function(t){var n=r/o,s=l.a.parseWidth(t.minWidth,i,e)||0;s>n&&s>f&&(r-=s,o--),a[c.indexOf(t)]=Math.max(f,s,n)}),a},e.prototype.generateOneRow=function(t,e,r,o){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(n){switch(n.label){case 0:return r?[4,this.generateFlatsRowHorisontal(t,e,o)]:[3,2];case 1:return[2,n.sent()];case 2:return[4,this.generateFlatsRowVertical(t,e)];case 3:return[2,n.sent()]}})})},e.prototype.generateFlatsRows=function(t,r,o,a){return n.i(i.b)(this,void 0,void 0,function(){var s,h,f,d,p,g,m,v,y,b;return n.i(i.c)(this,function(n){switch(n.label){case 0:s=l.a.clone(t),h=[],f=0,n.label=1;case 1:return f<r.length?[4,this.generateOneRow(s,r[f],a,this.calculateColumnWidth(r,o))]:[3,6];case 2:if(d=n.sent(),d.isEmpty&&(!r[f].row||!r[f].row.hasPanel))return[3,5];if(d.isEmpty||(f!==r.length-1&&(s.yTop=d.yBot,d.addBrick(l.a.createRowlineFlat(s,this.controller))),h.push(d),s.yTop=d.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight),!r[f].row||!r[f].row.hasPanel)return[3,5];for(r[f].row.showDetailPanel(),p=r[f].row.detailPanel,g=0;g<p.questions.length;g++)p.questions[g].id+="_"+f;return[4,u.a.generateFlatsPanel(this.survey,this.controller,p,s)];case 3:return m=n.sent(),v=new c.a,v.addBrick.apply(v,m),s.yTop=v.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,h.push(v),f!==r.length-1&&this.question.renderedTable.showHeader&&a?[4,this.generateOneRow(s,r[0],a,this.calculateColumnWidth(r,o))]:[3,5];case 4:y=n.sent(),b=v.yBot,y.isEmpty||(b=y.yBot,h.push(y)),s.yTop=b+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,n.label=5;case 5:return f++,[3,1];case 6:return[2,h]}})})},e.prototype.calculateIsWide=function(t,e){var n=[];if(t.showHeader&&n.push(t.headerRow),n.push.apply(n,this.visibleRows),0===n.length)return!0;var i=this.calculateColumnWidth(n,e).reduce(function(t,e){return t+=e},0);return"list"!==this.question.renderAs&&"list"!==this.controller.matrixRenderAs&&Math.floor(i)<=Math.floor(this.getAvalableWidth(e))},e.prototype.getRowsToRender=function(t,e,n){var i=[],r=this.visibleRows;return t.showHeader&&n&&i.push(t.headerRow),i.push.apply(i,r),t.hasRemoveRows&&e&&i.pop(),t.showFooter&&i.push(t.footerRow),i},e.prototype.getColCount=function(t,e){var n=this;return e[0]?e[0].cells.filter(function(t,e){return!n.ignoreCell(t,e)}).length:t.showHeader&&t.headerRow?t.headerRow.cells.length:t.showFooter&&t.footerRow?t.footerRow.cells.length:0},e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,a,s;return n.i(i.c)(this,function(n){switch(n.label){case 0:return e=this.question.renderedTable,(r="vertical"===this.question.columnLayout,0!==(o=this.getColCount(e,this.visibleRows))||this.hasDetailPanel)?(a=this.calculateIsWide(e,o),a||(this.question.isMobile=!0,r=!1,e=this.question.renderedTable,this.visibleRowsValue=void 0,o=this.getColCount(e,this.visibleRows)),s=this.getRowsToRender(e,r,a),[4,this.generateFlatsRows(t,s,o,a)]):[2,[new c.a(l.a.createRowlineFlat(t,this.controller))]];case 1:return[2,n.sent()]}})})},e.GAP_BETWEEN_ROWS=.5,e}(o.a);r.Serializer.removeProperty("matrixdropdown","renderAs"),r.Serializer.addProperty("matrixdropdown",{name:"renderAs",default:"auto",visible:!1,choices:["auto","list"]}),a.a.getInstance().register("matrixdropdown",h)},function(t,e,n){"use strict";var i=n(56),r=n.n(i),o=n(1);n.d(e,"a",function(){return a});var a=function(){function t(){}return t.findBotInterval=function(t,e,n,i){var r=t.search(e,n);return r.push({pageIndex:0,xLeft:i.margins.left,xRight:i.margins.left,yBot:i.margins.top,absBot:i.margins.top}),r.reduce(function(t,i){return Math.abs(i.xRight-e)<o.a.EPSILON||Math.abs(i.xLeft-n)<o.a.EPSILON?t:i.pageIndex<t.pageIndex?t:i.pageIndex>t.pageIndex?i:i.yBot>t.yBot?i:t},r[r.length-1])},t.addPack=function(t,e,n){for(var i=t.length;i<=e;i++)t.push([]);t[e].push(n)},t.pack=function(e,n){var i=n.paperHeight-n.margins.top-n.margins.bot,a=[];e.forEach(function(t){a.push([]),t.forEach(function(t){var e;t.height>i+o.a.EPSILON?(e=a[a.length-1]).push.apply(e,t.unfold()):a[a.length-1].push(t)})}),a.forEach(function(t){t.sort(function(t,e){return t.yTop<e.yTop?-1:t.yTop>e.yTop?1:t.xLeft>e.xLeft?1:t.xLeft<e.xLeft?-1:0})});var s=0,c=[],l=n.paperHeight-n.margins.bot;return a.forEach(function(e){var i=new r.a,a=0;e.forEach(function(e){var r=t.findBotInterval(i,e.xLeft,e.xRight,n),u=r.pageIndex,h=r.yBot,f=r.absBot,d=e.height;e.yTop=h+e.yTop-f,(Math.abs(e.yTop-n.margins.top)>o.a.EPSILON&&e.yTop+d>l+o.a.EPSILON||e.isPageBreak)&&(e.yTop=n.margins.top,u++,a=Math.max(a,u)),i.insert(e.xLeft,e.xRight,{pageIndex:u,xLeft:e.xLeft,xRight:e.xRight,yBot:e.yTop+d,absBot:e.yBot}),e.yBot=e.yTop+d,t.addPack(c,s+u,e)}),s+=a+1}),c},t}()},function(t,e,n){"use strict";var i=n(0),r=n(11);n.d(e,"a",function(){return o});var o=function(t){function e(e,n,i){return t.call(this,n,i,e.id,{question:e,readOnly:e.isReadOnly,checked:e.checkedValue})||this}return n.i(i.a)(e,t),e}(r.a)},function(t,e,n){"use strict";var i=n(0),r=n(11);n.d(e,"a",function(){return o});var o=function(t){function e(e,n,i,r,o){return t.call(this,n,i,e.id+"index"+o,{question:e,readOnly:e.isReadOnly||!r.isEnabled,item:r,checked:e.isItemSelected(r),index:o})||this}return n.i(i.a)(e,t),e}(r.a)},function(t,e,n){"use strict";var i=n(0),r=n(6),o=(n.n(r),n(17));n.d(e,"a",function(){return a});var a=function(t){function e(e,n,i,r,o){void 0===o&&(o=0);var a=t.call(this,e,n,i,r,!0,o)||this;return a.controller=n,a}return n.i(i.a)(e,t),e.prototype.shouldRenderFlatBorders=function(){return this.isQuestion&&"comment"!==this.question.getType()?t.prototype.shouldRenderFlatBorders.call(this):"textarea"===r.settings.readOnlyCommentRenderMode},e}(o.a)},function(t,e,n){"use strict";var i=n(0),r=n(7),o=n(1);n.d(e,"a",function(){return a});var a=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.controller=n,r.question=e,r}return n.i(i.a)(e,t),e.prototype.renderInteractive=function(){return n.i(i.b)(this,void 0,void 0,function(){var t,e,r=this;return n.i(i.c)(this,function(n){return t=new this.controller.doc.AcroFormComboBox,t.fieldName=this.question.id,t.Rect=o.a.createAcroformRect(o.a.scaleRect(this,o.a.formScale(this.controller,this))),t.edit=!1,t.color=this.textColor,e=[],this.question.showOptionsCaption&&e.push(this.getCorrectedText(this.question.optionsCaption)),this.question.visibleChoices.forEach(function(t){e.push(r.getCorrectedText(o.a.getLocString(t.locText)))}),t.setOptions(e),t.fontName=this.controller.fontName,t.fontSize=this.fontSize,t.readOnly=this.question.isReadOnly,t.isUnicode=o.a.isCustomFont(this.controller,t.fontName),t.V=this.getCorrectedText(o.a.getDropdownQuestionValue(this.question)),this.controller.doc.addField(t),o.a.renderFlatBorders(this.controller,this),[2]})})},e}(r.a)},function(t,e,n){"use strict";var i=n(0),r=n(7);n.d(e,"a",function(){return o});var o=function(t){function e(e,n,i,r,o){void 0===o&&(o=!1);var a=t.call(this,e,n,i)||this;return a.html=r,a.margins=o?{top:0,bottom:0}:{top:n.margins.top,bottom:n.margins.bot},a}return n.i(i.a)(e,t),e.prototype.renderInteractive=function(){return n.i(i.b)(this,void 0,void 0,function(){var t,e=this;return n.i(i.c)(this,function(n){switch(n.label){case 0:return t=this.controller.fontSize,this.controller.fontSize=this.fontSize,[4,new Promise(function(t){e.controller.doc.fromHTML(e.html,e.xLeft,e.yTop,{width:e.width,pagesplit:!0},function(){[].slice.call(document.querySelectorAll(".sjs-pdf-hidden-html-div")).forEach(function(t){t.parentNode.removeChild(t)}),t()},e.margins)})];case 1:return n.sent(),this.controller.fontSize=t,[2]}})})},e}(r.a)},function(t,e,n){"use strict";var i=n(0),r=n(7);n.d(e,"a",function(){return o});var o=function(t){function e(e,n,i,r,o,a){var s=t.call(this,e,n,{xLeft:r.xLeft,xRight:r.xLeft+(o||0),yTop:r.yTop,yBot:r.yTop+(a||0)})||this;return s.image=i,s.originalWidth=o,s.originalHeight=a,s.isPageBreak=void 0===s.originalHeight,s}return n.i(i.a)(e,t),e.prototype.renderInteractive=function(){return n.i(i.b)(this,void 0,void 0,function(){var t=this;return n.i(i.c)(this,function(e){switch(e.label){case 0:return[4,new Promise(function(e){try{t.controller.doc.addImage(t.image,"PNG",t.xLeft,t.yTop,t.originalWidth,t.originalHeight)}finally{e()}})];case 1:return e.sent(),[2]}})})},e}(r.a)},function(t,e,n){"use strict";var i=n(0),r=n(4),o=n(1);n.d(e,"a",function(){return a});var a=function(t){function e(n,i){var r=t.call(this,n.question,n.controller,n,n.text)||this;return r.link=i,r.textColor=e.COLOR,r}return n.i(i.a)(e,t),e.prototype.renderInteractive=function(){return n.i(i.b)(this,void 0,void 0,function(){var r,a,s;return n.i(i.c)(this,function(n){switch(n.label){case 0:return r=this.controller.doc.getTextColor(),this.controller.doc.setTextColor(o.a.BACKGROUND_COLOR),a=this.controller.unitHeight*(this.controller.doc.getLineHeightFactor()-e.SCALE_FACTOR_MAGIC),s=this.yTop+(this.yBot-this.yTop)-a,this.controller.doc.textWithLink(this.text,this.xLeft,s,{url:this.link}),[4,t.prototype.renderInteractive.call(this)];case 1:return n.sent(),this.controller.doc.setTextColor(r),[2]}})})},e.prototype.renderReadOnly=function(){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(e){switch(e.label){case 0:return"text"!==o.a.getReadonlyRenderAs(this.question,this.controller)?[2,this.renderInteractive()]:[4,t.prototype.renderInteractive.call(this)];case 1:return e.sent(),[2]}})})},e.SCALE_FACTOR_MAGIC=.955,e.COLOR="#0000EE",e}(r.a)},function(t,e,n){"use strict";var i=n(0),r=n(7),o=n(4),a=n(1);n.d(e,"b",function(){return s}),n.d(e,"a",function(){return c});var s=function(){function t(t,e,n){this.name=t,this.controller=e,this.context=n}return t.prototype.addToPdf=function(t){var e;this._radioGroup=new this.controller.doc.AcroFormRadioButton;var n={};n.fieldName=this.name,n.readOnly=this.readOnly,n.color=t,n.context=this.context,null===(e=this.context.question.survey)||void 0===e||e.getUpdatedRadioGroupWrapOptions(n),this._radioGroup.fieldName=n.fieldName,this._radioGroup.readOnly=n.readOnly,this._radioGroup.color=n.color,this._radioGroup.value="",this.controller.doc.addField(this._radioGroup)},Object.defineProperty(t.prototype,"radioGroup",{get:function(){return this._radioGroup},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readOnly",{get:function(){return this.context.readOnly},enumerable:!1,configurable:!0}),t}(),c=function(t){function e(e,n,i,r){var o=t.call(this,i.question,e,n)||this;return o.context=i,o.radioGroupWrap=r,o.textColor=o.formBorderColor,o}return n.i(i.a)(e,t),e.prototype.getShouldRenderReadOnly=function(){return this.radioGroupWrap.readOnly&&"acroform"!==a.a.getReadonlyRenderAs(this.question,this.controller)||this.controller.compress},e.prototype.renderInteractive=function(){var t;return n.i(i.b)(this,void 0,void 0,function(){var e,r,o;return n.i(i.c)(this,function(n){return 0==this.context.index&&this.radioGroupWrap.addToPdf(this.formBorderColor),e={},e.fieldName=this.radioGroupWrap.name+"index"+this.context.index,r=a.a.formScale(this.controller,this),e.Rect=a.a.createAcroformRect(a.a.scaleRect(this,r)),e.color=this.formBorderColor,e.appearance=this.controller.doc.AcroForm.Appearance.RadioButton.Circle,e.radioGroup=this.radioGroupWrap.radioGroup,e.context=this.context,null===(t=this.context.question.survey)||void 0===t||t.getUpdatedRadioItemAcroformOptions(e),o=this.radioGroupWrap.radioGroup.createOption(e.fieldName),this.context.checked?(e.AS||(o.AS="/"+e.fieldName),this.radioGroupWrap.radioGroup.value||(this.radioGroupWrap.radioGroup.value=e.fieldName)):e.AS||(e.AS="/Off"),o.Rect=e.Rect,o.color=e.color,a.a.renderFlatBorders(this.controller,this),this.radioGroupWrap.radioGroup.setAppearance(e.appearance),[2]})})},e.prototype.renderReadOnly=function(){return n.i(i.b)(this,void 0,void 0,function(){var t,r,s,c,l;return n.i(i.c)(this,function(n){switch(n.label){case 0:return a.a.renderFlatBorders(this.controller,this),this.context.checked?(t=a.a.createPoint(this,!0,!0),r=this.controller.fontSize,s=this.controller.fontName,this.controller.fontName=e.RADIOMARKER_READONLY_FONT,this.controller.fontSize=r*e.RADIOMARKER_READONLY_FONT_SIZE_SCALE,c=this.controller.measureText(e.RADIOMARKER_READONLY_SYMBOL),t.xLeft+=this.width/2-c.width/2,t.yTop+=this.height/2-c.height/2,[4,a.a.createTextFlat(t,this.question,this.controller,e.RADIOMARKER_READONLY_SYMBOL,o.a)]):[3,3];case 1:return l=n.sent(),l.unfold()[0].textColor=this.textColor,[4,l.render()];case 2:n.sent(),this.controller.fontSize=r,this.controller.fontName=s,n.label=3;case 3:return[2]}})})},e.RADIOMARKER_READONLY_SYMBOL="l",e.RADIOMARKER_READONLY_FONT="zapfdingbats",e.RADIOMARKER_READONLY_FONT_SIZE_SCALE=1-(2+Math.E)/10,e}(r.a)},function(t,e,n){"use strict";var i=n(0),r=n(7),o=n(4),a=n(11),s=n(1);n.d(e,"a",function(){return c});var c=function(t){function e(e,n,i,r){var o=t.call(this,e,n,i)||this;return o.mark=r,o.question=e,o.textColor=o.formBorderColor,o}return n.i(i.a)(e,t),e.prototype.renderInteractive=function(){return n.i(i.b)(this,void 0,void 0,function(){var t,e,r,c;return n.i(i.c)(this,function(n){switch(n.label){case 0:return s.a.renderFlatBorders(this.controller,this),t=s.a.createPoint(this,!0,!0),e=this.controller.fontSize,this.controller.fontSize=e*a.a.CHECKMARK_READONLY_FONT_SIZE_SCALE,r=this.controller.measureText(this.mark),t.xLeft+=this.width/2-r.width/2,t.yTop+=this.height/2-r.height/2,[4,s.a.createTextFlat(t,this.question,this.controller,this.mark,o.a)];case 1:return c=n.sent(),c.unfold()[0].textColor=this.textColor,this.controller.fontSize=e,[4,c.render()];case 2:return n.sent(),[2]}})})},e}(r.a)},function(t,e,n){"use strict";var i=n(0),r=n(6),o=(n.n(r),n(7)),a=n(1),s=n(5);n.d(e,"a",function(){return c});var c=function(t){function e(e,n,i,r,o,a,s,c,l,u){var h=t.call(this,e,n,i)||this;return h.isQuestion=r,h.fieldName=o,h.value=a,h.placeholder=s,h.isReadOnly=c,h.isMultiline=l,h.inputType=u,h.question=e,h}return n.i(i.a)(e,t),e.prototype.renderColorQuestion=function(){var t=this.controller.doc.getFillColor();this.controller.doc.setFillColor(this.question.value||"black"),this.controller.doc.rect(this.xLeft,this.yTop,this.width,this.height,"F"),this.controller.doc.setFillColor(t)},e.prototype.renderInteractive=function(){return n.i(i.b)(this,void 0,void 0,function(){var t,e;return n.i(i.c)(this,function(n){return"color"===this.inputType?(this.renderColorQuestion(),[2]):(t="password"===this.inputType?new this.controller.doc.AcroFormPasswordField:new this.controller.doc.AcroFormTextField,t.fieldName=this.fieldName,t.fontName=this.controller.fontName,t.fontSize=this.fontSize,t.isUnicode=a.a.isCustomFont(this.controller,t.fontName),"password"!==this.inputType?(t.V=" "+this.getCorrectedText(this.value),t.DV=" "+this.getCorrectedText(this.placeholder)):t.value="",t.multiline=this.isMultiline,t.readOnly=this.isReadOnly,t.color=this.textColor,e=a.a.formScale(this.controller,this),t.maxFontSize=this.controller.fontSize*e,t.Rect=a.a.createAcroformRect(a.a.scaleRect(this,e)),this.controller.doc.addField(t),a.a.renderFlatBorders(this.controller,this),[2])})})},e.prototype.shouldRenderFlatBorders=function(){return"input"===r.settings.readOnlyTextRenderMode},e.prototype.getShouldRenderReadOnly=function(){return a.a.shouldRenderReadOnly(this.question,this.controller,this.isReadOnly)},Object.defineProperty(e.prototype,"textBrick",{get:function(){return this._textBrick},set:function(t){var e=this;this._textBrick=t;var n=t.unfold(),i=n.length,r=0,o={},c=function(t){if(e.shouldRenderFlatBorders()){r++;var n=e.controller.getCurrentPageIndex();if(o[n]||(o[n]=[]),o[n].push(t),r>=i){var c=Object.keys(o),l=1==c.length;c.forEach(function(t){var i=new s.a;o[t].forEach(function(t){i.addBrick(t)});var r=e.controller.unitHeight*a.a.VALUE_READONLY_PADDING_SCALE,c={xLeft:e.xLeft,xRight:e.xRight,width:e.width,yTop:l?e.yTop:i.yTop-r,yBot:l?e.yBot:i.yBot+r,height:l?e.height:i.height+2*r,formBorderColor:e.formBorderColor};e.controller.setPage(Number(t)),a.a.renderFlatBorders(e.controller,c),e.controller.setPage(n)})}}};n.forEach(function(t){t.afterRenderCallback=c.bind(e,t)})},enumerable:!1,configurable:!0}),e.prototype.renderReadOnly=function(){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(t){switch(t.label){case 0:return this.controller.pushMargins(this.xLeft,this.controller.paperWidth-this.xRight),"color"!==this.inputType?[3,1]:(this.renderColorQuestion(),[3,3]);case 1:return[4,this.textBrick.render()];case 2:t.sent(),t.label=3;case 3:return this.controller.popMargins(),[2]}})})},e.prototype.unfold=function(){return this.getShouldRenderReadOnly()&&"color"!==this.inputType?this.textBrick.unfold():t.prototype.unfold.call(this)},e.prototype.translateX=function(t){var e=t(this.xLeft,this.xRight);this._xLeft=e.xLeft,this._xRight=e.xRight,this.textBrick&&this.textBrick.translateX(t)},e.prototype.setXLeft=function(e){var n=e-this._xLeft;t.prototype.setXLeft.call(this,e),this.textBrick&&(this.textBrick.xLeft=this.textBrick.xLeft+n)},e.prototype.setXRight=function(e){var n=e-this._xRight;t.prototype.setXRight.call(this,e),this.textBrick&&(this.textBrick.xRight=this.textBrick.xRight+n)},e.prototype.setYTop=function(e){var n=e-this._yTop;t.prototype.setYTop.call(this,e),this.textBrick&&(this.textBrick.yTop=this.textBrick.yTop+n)},e.prototype.setYBottom=function(e){var n=e-this._yBot;t.prototype.setYBottom.call(this,e),this.textBrick&&(this.textBrick.yBot=this.textBrick.yBot+n)},e}(o.a)},function(t,e,n){"use strict";var i=n(0),r=n(13),o=n(1);n.d(e,"a",function(){return a});var a=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return n.i(i.a)(e,t),e.prototype.renderInteractive=function(){return n.i(i.b)(this,void 0,void 0,function(){var e;return n.i(i.c)(this,function(n){switch(n.label){case 0:return e=this.controller.fontSize,this.controller.fontSize=e*o.a.TITLE_PANEL_FONT_SIZE_SCALE,[4,t.prototype.renderInteractive.call(this)];case 1:return n.sent(),this.controller.fontSize=e,[2]}})})},e}(r.a)},function(t,e,n){"use strict";var i=n(0);n.d(e,"c",function(){return o}),n.d(e,"a",function(){return a}),n.d(e,"b",function(){return s});var r=function(){function t(t,e,n,i,r){this.point=t,this.bricks=e,this.controller=n,this.repository=i,this.module=r}return t}(),o=function(t){function e(e,n,i,r,o,a){var s=t.call(this,e,n,r,o,a)||this;return s.question=i,s}return n.i(i.a)(e,t),e}(r),a=function(t){function e(e,n,i,r,o,a){var s=t.call(this,e,n,r,o,a)||this;return s.panel=i,s}return n.i(i.a)(e,t),e}(r),s=function(t){function e(e,n,i,r,o,a){var s=t.call(this,e,n,r,o,a)||this;return s.page=i,s}return n.i(i.a)(e,t),e}(r)},function(t,e,n){"use strict";var i=n(0),r=n(6),o=(n.n(r),n(3)),a=n(2),s=n(4),c=n(24),l=n(5),u=n(1),h=n(9);n.d(e,"a",function(){return f});var f=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n.i(i.a)(e,t),e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,a,h,f,d;return n.i(i.c)(this,function(n){switch(n.label){case 0:return e=new l.a,(r=this.controller.unitHeight,o=new c.a(this.question,this.controller,u.a.moveRect(u.a.scaleRect(u.a.createRect(t,r,r),u.a.SELECT_ITEM_FLAT_SCALE),t.xLeft)),e.addBrick(o),a=u.a.clone(t),a.xLeft=o.xRight+this.controller.unitWidth*u.a.GAP_BETWEEN_ITEM_TEXT,null===(h=this.question.isIndeterminate?null:this.question.checkedValue?this.question.locLabelTrue:this.question.locLabelFalse)||null===h.renderedHtml)?[3,2]:(d=(f=e).addBrick,[4,u.a.createTextFlat(a,this.question,this.controller,h,s.a)]);case 1:d.apply(f,[n.sent()]),n.label=2;case 2:return[2,[e]]}})})},e}(o.a),d=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.buildItems(),r}return n.i(i.a)(e,t),e.prototype.buildItems=function(){var t=this.question,e=new r.ItemValue(void 0!==t.valueFalse&&t.valueFalse),n=new r.ItemValue(void 0===t.valueTrue||t.valueTrue);e.locOwner=t,e.setLocText(t.locLabelFalse),n.locOwner=t,n.setLocText(t.locLabelTrue),this.items=[e,n]},e.prototype.getVisibleChoices=function(){return this.items},e.prototype.getColCount=function(){return 0},e}(h.a);a.a.getInstance().register("boolean",d),a.a.getInstance().register("boolean-checkbox",f)},function(t,e,n){"use strict";var i=n(0),r=n(15),o=n(2),a=n(25);n.d(e,"a",function(){return s});var s=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n.i(i.a)(e,t),e.prototype.generateFlatItem=function(t,e,n){return new a.a(this.question,this.controller,t,e,n)},e}(r.a),c=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n.i(i.a)(e,t),e.prototype.getVisibleChoices=function(){return this.controller.tagboxSelectedChoicesOnly?this.question.selectedChoices:t.prototype.getVisibleChoices.call(this)},e}(s);o.a.getInstance().register("tagbox",c),o.a.getInstance().register("checkbox",s)},function(t,e,n){"use strict";var i=n(0),r=n(3),o=n(2),a=n(1);n.d(e,"a",function(){return s});var s=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n.i(i.a)(e,t),e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(e){switch(e.label){case 0:return[4,a.a.createCommentFlat(t,this.question,this.controller,!0,{rows:this.question.rows})];case 1:return[2,[e.sent()]]}})})},e}(r.a);o.a.getInstance().register("comment",s)},function(t,e,n){"use strict";var i=n(0),r=n(3),o=n(2);n.d(e,"a",function(){return a});var a=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r}return n.i(i.a)(e,t),e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e;return n.i(i.c)(this,function(n){return e=o.a.getInstance().create(this.survey,this.question,this.controller,this.question.getType()),[2,e.generateFlatsContent(t)]})})},e}(r.a);o.a.getInstance().register("custom_model",a)},function(t,e,n){"use strict";var i=n(0),r=n(3),o=n(2),a=n(27),s=n(5),c=n(1);n.d(e,"a",function(){return l});var l=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n.i(i.a)(e,t),e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,l,u,h;return n.i(i.c)(this,function(n){switch(n.label){case 0:return this.shouldRenderAsComment?[3,1]:(r=new a.a(this.question,this.controller,c.a.createTextFieldRect(t,this.controller)),[3,3]);case 1:return[4,c.a.createCommentFlat(t,this.question,this.controller,!0,{value:c.a.getDropdownQuestionValue(this.question)})];case 2:r=n.sent(),n.label=3;case 3:return e=r,(o=new s.a(e),this.question.isOtherSelected)?(l=c.a.createPoint(o),l.yTop+=this.controller.unitHeight*c.a.GAP_BETWEEN_ROWS,h=(u=o).addBrick,[4,c.a.createCommentFlat(l,this.question,this.controller,!1,{rows:c.a.OTHER_ROWS_COUNT})]):[3,5];case 4:h.apply(u,[n.sent()]),n.label=5;case 5:return[2,[o]]}})})},e}(r.a);o.a.getInstance().register("dropdown",l)},function(t,e,n){"use strict";var i=n(0),r=n(3),o=n(2),a=n(1);n.d(e,"a",function(){return s});var s=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n.i(i.a)(e,t),e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(e){switch(e.label){case 0:return[4,a.a.createCommentFlat(t,this.question,this.controller,!0,{value:this.question.displayValue,readOnly:!0})];case 1:return[2,[e.sent()]]}})})},e}(r.a);o.a.getInstance().register("expression",s)},function(t,e,n){"use strict";var i=n(0),r=n(3),o=n(2),a=n(4),s=n(5),c=n(1);n.d(e,"a",function(){return l});var l=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n.i(i.a)(e,t),e.prototype.generateFlatItem=function(t,r){return n.i(i.b)(this,void 0,void 0,function(){var o,a,l,u,h;return n.i(i.c)(this,function(n){switch(n.label){case 0:return a=s.a.bind,[4,c.a.createLinkFlat(t,this.question,this.controller,void 0===r.name?"image":r.name,r.content)];case 1:return o=new(a.apply(s.a,[void 0,n.sent()])),c.a.canPreviewImage(this.question,r,r.content)?(l=c.a.createPoint(o),l.yTop+=this.controller.unitHeight*e.IMAGE_GAP_SCALE,h=(u=o).addBrick,[4,c.a.createImageFlat(l,this.question,this.controller,{link:r.content,width:r.imageSize.width,height:r.imageSize.height,objectFit:e.DEFAULT_IMAGE_FIT})]):[3,3];case 2:h.apply(u,[n.sent()]),n.label=3;case 3:return[2,o]}})})},e.prototype.addLine=function(t,e,n){n!==this.question.previewValue.length-1&&(t[t.length-1].addBrick(c.a.createRowlineFlat(e,this.controller)),e.yTop+=c.a.EPSILON,t.push(new s.a))},e.prototype.getImagePreviewContentWidth=function(t){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(n){return[2,Math.max(t.imageSize.width,e.TEXT_MIN_SCALE*this.controller.unitWidth)]})})},e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,l,u,h,f,d,p,g,g;return n.i(i.c)(this,function(m){switch(m.label){case 0:return 0!==this.question.previewValue.length?[3,2]:[4,c.a.createTextFlat(t,this.question,this.controller,this.question.noFileChosenCaption,a.a)];case 1:return[2,[m.sent()]];case 2:e=[new s.a],r=c.a.clone(t),o=r.yTop,l=0,m.label=3;case 3:return l<this.question.previewValue.length?(u=n.i(i.e)({},this.question.previewValue[l]),(h=c.a.canPreviewImage(this.question,u,u.content))?(f=u,[4,c.a.getCorrectedImageSize(this.controller,{imageWidth:this.question.imageWidth,imageHeight:this.question.imageHeight,imageLink:this.question.previewValue[l].content,defaultImageWidth:200,defaultImageHeight:150})]):[3,5]):[3,12];case 4:f.imageSize=m.sent(),m.label=5;case 5:return d=this.controller.paperWidth-this.controller.margins.right-r.xLeft,h?[4,this.getImagePreviewContentWidth(u)]:[3,8];case 6:return p=m.sent(),d<p&&(r.xLeft=t.xLeft,r.yTop=o,this.addLine(e,r,l)),this.controller.pushMargins(r.xLeft,this.controller.paperWidth-r.xLeft-p),[4,this.generateFlatItem(r,u)];case 7:return g=m.sent(),e[e.length-1].addBrick(g),r.xLeft+=g.width,o=Math.max(o,g.yBot),this.controller.popMargins(),[3,10];case 8:return d<this.controller.unitWidth&&(r.xLeft=t.xLeft,r.yTop=o,this.addLine(e,r,l)),[4,this.generateFlatItem(r,u)];case 9:g=m.sent(),e[e.length-1].addBrick(g),r.xLeft+=g.xRight-g.xLeft,o=Math.max(o,g.yBot),m.label=10;case 10:r.xLeft+=this.controller.unitWidth,m.label=11;case 11:return l++,[3,3];case 12:return[2,e]}})})},e.IMAGE_GAP_SCALE=.195,e.TEXT_MIN_SCALE=5,e.DEFAULT_IMAGE_FIT="contain",e}(r.a);o.a.getInstance().register("file",l)},function(t,e,n){"use strict";var i=n(0),r=n(6),o=(n.n(r),n(3)),a=n(2),s=n(1),c=n(12);n.d(e,"a",function(){return l});var l=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r}return n.i(i.a)(e,t),e.prototype.chooseRender=function(t){return/<[^>]*style[^<]*>/.test(t)||/<[^>]*table[^<]*>/.test(t)||/&\w+;/.test(t)?"image":"standard"},e.prototype.correctHtml=function(t){return e.correctHtmlRules.forEach(function(e){t=t.replace(e.searchRegExp,e.replaceString)}),t},e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,a,l,u,h,f,d,p;return n.i(i.c)(this,function(n){switch(n.label){case 0:return e=this.question.renderAs,s.a.hasDocument?("auto"===e&&(e=this.controller.htmlRenderAs),"auto"===e&&(e=this.chooseRender(s.a.getLocString(this.question.locHtml))),r=s.a.createHtmlContainerBlock(s.a.getLocString(this.question.locHtml),this.controller,e),"image"!==e?[3,3]:(o=s.a.getPageAvailableWidth(this.controller),[4,s.a.htmlToImage(r,o,this.controller)])):[2,[new c.a(s.a.createRect(t,0,0))]];case 1:return a=n.sent(),l=a.url,u=a.aspect,h=o/u,[4,s.a.createImageFlat(t,this.question,this.controller,{link:l,width:o,height:h})];case 2:return[2,[n.sent()]];case 3:return d=(f=s.a).splitHtmlRect,p=[this.controller],[4,s.a.createHTMLFlat(t,this.question,this.controller,this.correctHtml(r))];case 4:return[2,[d.apply(f,p.concat([n.sent()]))]]}})})},e.correctHtmlRules=[{searchRegExp:/(<\/?br\s*?\/?\s*?>\s*){2,}/g,replaceString:"<br>"}],e}(o.a);r.Serializer.removeProperty("html","renderAs"),r.Serializer.addProperty("html",{name:"renderAs",default:"auto",visible:!1,choices:["auto","standard","image"]}),a.a.getInstance().register("html",l)},function(t,e,n){"use strict";var i=n(0),r=n(3),o=n(2),a=n(1);n.d(e,"a",function(){return s});var s=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n.i(i.a)(e,t),e.prototype.getCorrectImageSize=function(){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(t){switch(t.label){case 0:return[4,a.a.getCorrectedImageSize(this.controller,{imageWidth:this.question.imageWidth,imageHeight:this.question.imageHeight,imageLink:this.question.imageLink})];case 1:return[2,t.sent()]}})})},e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e;return n.i(i.c)(this,function(n){switch(n.label){case 0:return[4,this.getCorrectImageSize()];case 1:return e=n.sent(),[4,a.a.createImageFlat(t,this.question,this.controller,{link:this.question.imageLink,width:e.width,height:e.height})];case 2:return[2,[n.sent()]]}})})},e}(r.a);o.a.getInstance().register("image",s)},function(t,e,n){"use strict";var i=n(0),r=n(3),o=n(2),a=n(4),s=n(9),c=n(11),l=n(5),u=n(1);n.d(e,"a",function(){return h});var h=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n.i(i.a)(e,t),e.prototype.generateFlatItem=function(t,e,r){return n.i(i.b)(this,void 0,void 0,function(){var o,s,h,f,d,p,g;return n.i(i.c)(this,function(n){switch(n.label){case 0:return o=u.a.getPageAvailableWidth(this.controller),[4,u.a.createImageFlat(t,this.question,this.controller,{link:e.imageLink,width:o,height:o/u.a.IMAGEPICKER_RATIO})];case 1:return s=n.sent(),h=new l.a(s),f=u.a.createPoint(h),this.question.showLabel?[4,u.a.createTextFlat(f,this.question,this.controller,e.text||e.value,a.a)]:[3,3];case 2:d=n.sent(),h.addBrick(d),f=u.a.createPoint(d),n.label=3;case 3:return p=this.controller.unitHeight,g=u.a.createRect(f,o,p),this.question.multiSelect?h.addBrick(new c.a(this.controller,g,this.question.id+"index"+r,{readOnly:this.question.isReadOnly||!e.isEnabled,question:this.question,item:e,checked:-1!==this.question.value.indexOf(e.value),index:r})):h.addBrick(this.radio.generateFlatItem(g,e,r)),[2,h]}})})},e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,a,c,h,f,d,p,g,m,v;return n.i(i.c)(this,function(n){switch(n.label){case 0:this.radio=this.question.multiSelect?null:new s.a(this.survey,this.question,this.controller),e=[new l.a],r=u.a.getImagePickerAvailableWidth(this.controller)/u.a.IMAGEPICKER_COUNT,o=~~(u.a.getPageAvailableWidth(this.controller)/r)||1,a=this.question.visibleChoices.length,o=o<=a?o:a,c=~~Math.ceil(a/o),h=u.a.clone(t),f=0,n.label=1;case 1:if(!(f<c))return[3,7];d=h.yTop,this.controller.pushMargins(),p=this.controller.margins.left,g=0,n.label=2;case 2:return g<o?(m=f*o+g)==a?[3,5]:(this.controller.margins.left=p,this.controller.margins.right=this.controller.paperWidth-p-r,p=this.controller.paperWidth-this.controller.margins.right+this.controller.unitWidth,h.xLeft=this.controller.margins.left,[4,this.generateFlatItem(h,this.question.visibleChoices[m],m)]):[3,5];case 3:v=n.sent(),e[e.length-1].addBrick(v),d=Math.max(d,v.yBot),n.label=4;case 4:return g++,[3,2];case 5:this.controller.popMargins(),h.xLeft=t.xLeft,h.yTop=d,f!==c-1&&(e[e.length-1].addBrick(u.a.createRowlineFlat(h,this.controller)),h.yTop+=u.a.EPSILON,e.push(new l.a)),n.label=6;case 6:return f++,[3,1];case 7:return[2,e]}})})},e}(r.a);o.a.getInstance().register("imagepicker",h)},function(t,e,n){"use strict";var i=n(0),r=n(6),o=(n.n(r),n(3)),a=n(9),s=n(2),c=n(4),l=n(5),u=n(1);n.d(e,"a",function(){return h});var h=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n.i(i.a)(e,t),e.prototype.generateFlatsHeader=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,a,s,c;return n.i(i.c)(this,function(h){switch(h.label){case 0:e=[],r=u.a.clone(t),this.question.hasRows&&(r.xLeft+=this.rowTitleWidth+this.controller.unitWidth*u.a.GAP_BETWEEN_COLUMNS),o=0,h.label=1;case 1:return o<this.question.visibleColumns.length?(this.controller.pushMargins(),this.controller.margins.left=r.xLeft,this.controller.margins.right+=u.a.getPageAvailableWidth(this.controller)-this.columnWidth,s=(a=e).push,[4,u.a.createBoldTextFlat(r,this.question,this.controller,this.question.visibleColumns[o].locText)]):[3,4];case 2:s.apply(a,[h.sent()]),r.xLeft+=this.columnWidth+this.controller.unitWidth*u.a.GAP_BETWEEN_COLUMNS,this.controller.popMargins(),h.label=3;case 3:return o++,[3,1];case 4:return c=new(l.a.bind.apply(l.a,n.i(i.d)([void 0],e,!1))),[2,[c,u.a.createRowlineFlat(u.a.createPoint(c),this.controller)]]}})})},e.prototype.generateFlatsRows=function(t,r){return n.i(i.b)(this,void 0,void 0,function(){var o,a,s,c,l;return n.i(i.c)(this,function(n){switch(n.label){case 0:o=[],a=u.a.clone(t),s=0,n.label=1;case 1:return s<this.question.visibleRows.length?(c="row"+s,[4,new f(this.survey,this.question,this.controller,this.question.visibleRows[s],s,c,0==s,r,this.rowTitleWidth,this.columnWidth).generateFlatsContent(a)]):[3,4];case 2:l=n.sent(),a=u.a.createPoint(u.a.mergeRects.apply(u.a,l)),a.yTop+=this.controller.unitHeight*e.GAP_BETWEEN_ROWS,o.push.apply(o,l),n.label=3;case 3:return s++,[3,1];case 4:return[2,o]}})})},e.prototype.calculateColumnsWidthes=function(){var t=u.a.getPageAvailableWidth(this.controller);this.question.hasRows&&this.question.rowTitleWidth?(this.controller.pushMargins(),this.rowTitleWidth=u.a.parseWidth(this.question.rowTitleWidth,t),this.controller.margins.left+=this.rowTitleWidth+this.controller.unitWidth*u.a.GAP_BETWEEN_COLUMNS,this.columnWidth=u.a.getColumnWidth(this.controller,this.question.visibleColumns.length),this.controller.popMargins()):this.columnWidth=this.rowTitleWidth=u.a.getColumnWidth(this.controller,this.question.visibleColumns.length+(this.question.hasRows?1:0))},e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var r,o,a,s,c,l,h;return n.i(i.c)(this,function(n){switch(n.label){case 0:return this.calculateColumnsWidthes(),r="list"===this.question.renderAs||"list"===this.controller.matrixRenderAs||this.columnWidth<this.controller.measureText(u.a.MATRIX_COLUMN_WIDTH).width,o=u.a.clone(t),a=[],r||!this.question.showHeader||0==this.question.visibleColumns.length?[3,2]:[4,this.generateFlatsHeader(o)];case 1:s=n.sent(),o=u.a.createPoint(u.a.mergeRects.apply(u.a,s)),o.yTop+=e.GAP_BETWEEN_ROWS*this.controller.unitHeight,a.push.apply(a,s),n.label=2;case 2:return l=(c=a.push).apply,h=[a],[4,this.generateFlatsRows(o,r)];case 3:return l.apply(c,h.concat([n.sent()])),[2,a]}})})},e.GAP_BETWEEN_ROWS=.5,e}(o.a),f=function(t){function e(e,n,i,r,o,a,s,c,l,u){void 0===s&&(s=!1),void 0===c&&(c=!1);var h=t.call(this,e,n,i)||this;return h.survey=e,h.controller=i,h.row=r,h.rowIndex=o,h.key=a,h.isFirst=s,h.isVertical=c,h.rowTitleWidth=l,h.columnWidth=u,h.questionMatrix=n,h}return n.i(i.a)(e,t),e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e;return n.i(i.c)(this,function(n){switch(n.label){case 0:return this.isVertical?[4,this.generateFlatsVerticallyCells(t)]:[3,2];case 1:return e=n.sent(),[3,4];case 2:return[4,this.generateFlatsHorizontallyCells(t)];case 3:e=n.sent(),n.label=4;case 4:return[2,e]}})})},e.prototype.generateTextComposite=function(t,e,r){return n.i(i.b)(this,void 0,void 0,function(){var o,a,s,h,f;return n.i(i.c)(this,function(n){switch(n.label){case 0:return o=u.a.clone(t),a=this.row.value==e.value,s=u.a.createRect(o,u.a.getPageAvailableWidth(this.controller),this.controller.unitHeight),h=this.generateFlatItem(s,e,r,this.key,a,{row:this.row,rowIndex:this.rowIndex}),o.yTop=h.yBot+this.controller.unitHeight*u.a.GAP_BETWEEN_ITEM_TEXT,[4,u.a.createTextFlat(o,this.questionMatrix,this.controller,this.questionMatrix.getCellDisplayLocText(this.row.name,e),c.a)];case 1:return f=n.sent(),[2,new l.a(h,f)]}})})},e.prototype.generateItemCompoiste=function(t,e,r){return n.i(i.b)(this,void 0,void 0,function(){var o,a,s,h,f;return n.i(i.c)(this,function(n){switch(n.label){case 0:return o=u.a.clone(t),a=this.row.value==e.value,s=u.a.createRect(o,this.controller.unitHeight,this.controller.unitHeight),h=this.generateFlatItem(u.a.moveRect(u.a.scaleRect(s,u.a.SELECT_ITEM_FLAT_SCALE),s.xLeft),e,r,this.key,a,{row:this.row,rowIndex:this.rowIndex}),o.xLeft=h.xRight+this.controller.unitWidth*u.a.GAP_BETWEEN_ITEM_TEXT,[4,u.a.createTextFlat(o,this.questionMatrix,this.controller,e.locText,c.a)];case 1:return f=n.sent(),[2,new l.a(h,f)]}})})},e.prototype.generateFlatsHorizontallyCells=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,a,s,h,f,d,p,g,m;return n.i(i.c)(this,function(v){switch(v.label){case 0:return e=[],(r=u.a.clone(t),this.questionMatrix.hasRows)?(this.controller.pushMargins(),r.xLeft=this.controller.margins.left,this.controller.margins.right+=u.a.getPageAvailableWidth(this.controller)-this.rowTitleWidth,a=(o=e).push,[4,u.a.createTextFlat(r,this.questionMatrix,this.controller,this.row.locText,c.a)]):[3,2];case 1:a.apply(o,[v.sent()]),r.xLeft+=this.rowTitleWidth+this.controller.unitWidth*u.a.GAP_BETWEEN_COLUMNS,this.controller.popMargins(),v.label=2;case 2:s=0,v.label=3;case 3:return s<this.questionMatrix.visibleColumns.length?(h=this.questionMatrix.visibleColumns[s],f=this.row.value==h.value,this.controller.pushMargins(),this.controller.margins.left=r.xLeft,this.controller.margins.right+=u.a.getPageAvailableWidth(this.controller)-this.columnWidth,this.questionMatrix.hasCellText?(p=(d=e).push,[4,this.generateTextComposite(r,h,s)]):[3,5]):[3,8];case 4:return p.apply(d,[v.sent()]),[3,6];case 5:g=u.a.createRect(r,this.controller.unitHeight,this.controller.unitHeight),e.push(this.generateFlatItem(u.a.moveRect(u.a.scaleRect(g,u.a.SELECT_ITEM_FLAT_SCALE),r.xLeft),h,s,this.key,f,{row:this.row,rowIndex:this.rowIndex})),v.label=6;case 6:r.xLeft+=this.columnWidth+this.controller.unitWidth*u.a.GAP_BETWEEN_COLUMNS,this.controller.popMargins(),v.label=7;case 7:return s++,[3,3];case 8:return m=new(l.a.bind.apply(l.a,n.i(i.d)([void 0],e,!1))),[2,[m,u.a.createRowlineFlat(u.a.createPoint(m),this.controller)]]}})})},e.prototype.generateFlatsVerticallyCells=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,a,s,h,f,d;return n.i(i.c)(this,function(p){switch(p.label){case 0:return e=[],r=u.a.clone(t),this.questionMatrix.hasRows?[4,u.a.createTextFlat(r,this.questionMatrix,this.controller,this.row.locText,c.a)]:[3,2];case 1:a=p.sent(),r.yTop=a.yBot+o.a.CONTENT_GAP_VERT_SCALE*this.controller.unitHeight,e.push(a),p.label=2;case 2:return this.generateFlatComposite=this.questionMatrix.hasCellText?this.generateTextComposite:this.generateItemCompoiste,h=(s=e.push).apply,f=[e],[4,this.generateVerticallyItems(r,this.questionMatrix.visibleColumns)];case 3:return h.apply(s,f.concat([p.sent()])),d=new(l.a.bind.apply(l.a,n.i(i.d)([void 0],e,!1))),[2,[d,u.a.createRowlineFlat(u.a.createPoint(d),this.controller)]]}})})},e}(a.a);r.Serializer.removeProperty("matrix","renderAs"),r.Serializer.addProperty("matrix",{name:"renderAs",default:"auto",visible:!1,choices:["auto","list"]}),s.a.getInstance().register("matrix",h)},function(t,e,n){"use strict";var i=n(0),r=n(6),o=(n.n(r),n(2)),a=n(22);n.d(e,"a",function(){return s});var s=function(t){function e(e,n,i){var r=t.call(this,e,n,i,!1)||this;return r.survey=e,r}return n.i(i.a)(e,t),e}(a.a);r.Serializer.removeProperty("matrixdynamic","renderAs"),r.Serializer.addProperty("matrixdynamic",{name:"renderAs",default:"auto",visible:!1,choices:["auto","list"]}),o.a.getInstance().register("matrixdynamic",s)},function(t,e,n){"use strict";var i=n(0),r=n(3),o=n(2),a=n(5),s=n(1);n.d(e,"a",function(){return c});var c=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n.i(i.a)(e,t),e.prototype.getVisibleRows=function(){return this.question.getRows().filter(function(t){return t.isVisible})},e.prototype.generateFlatItem=function(t,e,r,c){return n.i(i.b)(this,void 0,void 0,function(){var e,r,l,u,h,f,d,p;return n.i(i.c)(this,function(n){switch(n.label){case 0:return e=s.a.getPageAvailableWidth(this.controller),this.controller.pushMargins(),this.controller.margins.right=this.controller.paperWidth-this.controller.margins.left-e*s.a.MULTIPLETEXT_TEXT_PERS,l=a.a.bind,[4,s.a.createBoldTextFlat(t,this.question,this.controller,c.locTitle)];case 1:return r=new(l.apply(a.a,[void 0,n.sent()])),this.controller.popMargins(),u=o.a.getInstance().create(this.survey,c.editor,this.controller,"text"),h=s.a.createTextFieldRect({xLeft:t.xLeft+e*s.a.MULTIPLETEXT_TEXT_PERS,yTop:t.yTop},this.controller),d=(f=r.addBrick).apply,p=[r],[4,u.generateFlatsContent(h)];case 2:return d.apply(f,p.concat([n.sent()])),[2,r]}})})},e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var r,o,c,l,u,h,f;return n.i(i.c)(this,function(n){switch(n.label){case 0:r=[],o=s.a.clone(t),c=this.getVisibleRows(),l=0,n.label=1;case 1:if(!(l<c.length))return[3,7];r.push(new a.a),u=o.yTop,this.controller.pushMargins(),h=0,n.label=2;case 2:return h<c[l].cells.length?(this.controller.pushMargins(),s.a.setColumnMargins(this.controller,this.question.colCount,h),o.xLeft=this.controller.margins.left,[4,this.generateFlatItem(o,l,h,c[l].cells[h].item)]):[3,5];case 3:f=n.sent(),r[r.length-1].addBrick(f),u=Math.max(u,f.yBot),this.controller.popMargins(),n.label=4;case 4:return h++,[3,2];case 5:this.controller.popMargins(),o.xLeft=t.xLeft,o.yTop=u,r[r.length-1].addBrick(s.a.createRowlineFlat(o,this.controller)),o.yTop+=s.a.EPSILON,o.yTop+=this.controller.unitHeight*e.ROWS_GAP_SCALE,n.label=6;case 6:return l++,[3,1];case 7:return[2,r]}})})},e.ROWS_GAP_SCALE=.195,e}(r.a);o.a.getInstance().register("multipletext",c)},function(t,e,n){"use strict";var i=n(0),r=n(10),o=n(3),a=n(2),s=n(1);n.d(e,"a",function(){return c});var c=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n.i(i.a)(e,t),e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var o,a,c,l,u,h;return n.i(i.c)(this,function(n){switch(n.label){case 0:o=[],a=s.a.clone(t),c=0,l=this.question.panels,n.label=1;case 1:return c<l.length?(u=l[c],[4,r.a.generateFlatsPanel(this.survey,this.controller,u,a)]):[3,4];case 2:h=n.sent(),0!==h.length&&(a.yTop=s.a.mergeRects.apply(s.a,h).yBot,a.yTop+=this.controller.unitHeight*e.GAP_BETWEEN_PANELS,o.push.apply(o,h)),n.label=3;case 3:return c++,[3,1];case 4:return[2,o]}})})},e.GAP_BETWEEN_PANELS=.75,e}(o.a);a.a.getInstance().register("paneldynamic",c)},function(t,e,n){"use strict";var i=n(0),r=n(3),o=n(2),a=n(4),s=n(32),c=n(5),l=n(1),u=n(59);n.d(e,"a",function(){return h});var h=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n.i(i.a)(e,t),e.prototype.generateFlatComposite=function(t,e,r,o){return void 0===o&&(o=!1),n.i(i.b)(this,void 0,void 0,function(){var u,h,f,d,p;return n.i(i.c)(this,function(n){switch(n.label){case 0:return u=l.a.createRect(t,this.controller.unitWidth,this.controller.unitHeight),h=l.a.moveRect(l.a.scaleRect(u,l.a.SELECT_ITEM_FLAT_SCALE),t.xLeft),f=new s.a(this.question,this.controller,h,o?"-":this.question.getNumberByIndex(r)),d=l.a.clone(t),d.xLeft=f.xRight+this.controller.unitWidth*l.a.GAP_BETWEEN_ITEM_TEXT,[4,l.a.createTextFlat(d,this.question,this.controller,e.locText,a.a)];case 1:return p=n.sent(),[2,new c.a(f,p)]}})})},e.prototype.generateChoicesColumn=function(t,e,r){return void 0===r&&(r=!1),n.i(i.b)(this,void 0,void 0,function(){var o,a,s,c;return n.i(i.c)(this,function(n){switch(n.label){case 0:o=l.a.clone(t),a=[],s=0,n.label=1;case 1:return s<e.length?[4,this.generateFlatComposite(o,e[s],s,r)]:[3,4];case 2:c=n.sent(),o.yTop=c.yBot+l.a.GAP_BETWEEN_ROWS*this.controller.unitHeight,a.push(c),n.label=3;case 3:return s++,[3,1];case 4:return[2,a]}})})},e.prototype.generateSelectToRankItemsVertically=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,a,s,c,h,f,d;return n.i(i.c)(this,function(n){switch(n.label){case 0:return e=l.a.clone(t),(r=[],0===this.question.rankingChoices.length)?[3,2]:(a=(o=r.push).apply,s=[r],[4,this.generateChoicesColumn(e,this.question.rankingChoices)]);case 1:a.apply(o,s.concat([n.sent()])),e.yTop=r[r.length-1].yBot+l.a.GAP_BETWEEN_ROWS*this.controller.unitHeight*2,n.label=2;case 2:return c=l.a.createRect({xLeft:e.xLeft,yTop:e.yTop-l.a.GAP_BETWEEN_ROWS*this.controller.unitHeight-.5},this.controller.paperWidth-this.controller.margins.right-e.xLeft,1),r.push(new u.a(this.controller,c,l.a.FORM_BORDER_COLOR)),f=(h=r.push).apply,d=[r],[4,this.generateChoicesColumn(e,this.question.unRankingChoices,!0)];case 3:return f.apply(h,d.concat([n.sent()])),[2,r]}})})},e.prototype.generateSelectToRankItemsHorizontally=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,a,s,h,f,d,p,g,m,v,y;return n.i(i.c)(this,function(n){switch(n.label){case 0:e=2,r=l.a.clone(t),o=[],a=Math.max(this.question.unRankingChoices.length,this.question.rankingChoices.length),s=new c.a,h=0,n.label=1;case 1:if(!(h<a))return[3,8];f=0,d=0,p=[this.question.unRankingChoices[h],this.question.rankingChoices[h]],n.label=2;case 2:return d<p.length?(g=p[d])?(this.controller.pushMargins(this.controller.margins.left,this.controller.margins.right),l.a.setColumnMargins(this.controller,e,f),r.xLeft=this.controller.margins.left,[4,this.generateFlatComposite(r,g,h,0==f)]):[3,4]:[3,6];case 3:m=n.sent(),s.addBrick(m),this.controller.popMargins(),n.label=4;case 4:f++,n.label=5;case 5:return d++,[3,2];case 6:v=l.a.createRowlineFlat(l.a.createPoint(s),this.controller),o.push(s,v),y=l.a.createRect({xLeft:this.controller.margins.left+l.a.getPageAvailableWidth(this.controller)/2-.5,yTop:r.yTop},0,0),s.addBrick(new u.a(this.controller,y,l.a.FORM_BORDER_COLOR,1,v.yBot-r.yTop+(h!==a-1?l.a.GAP_BETWEEN_ROWS*this.controller.unitHeight:0))),r.yTop=v.yBot+l.a.GAP_BETWEEN_ROWS*this.controller.unitHeight,s=new c.a,n.label=7;case 7:return h++,[3,1];case 8:return[2,o]}})})},e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(e){return this.question.selectToRankEnabled?"vertical"==this.question.selectToRankAreasLayout?[2,this.generateSelectToRankItemsVertically(t)]:[2,this.generateSelectToRankItemsHorizontally(t)]:[2,this.generateChoicesColumn(t,this.question.rankingChoices)]})})},e}(r.a);o.a.getInstance().register("ranking",h)},function(t,e,n){"use strict";var i=n(0),r=n(9),o=n(2),a=n(4),s=n(5),c=n(1);n.d(e,"a",function(){return l});var l=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.questionRating=n,r}return n.i(i.a)(e,t),e.prototype.generateFlatHorisontalComposite=function(t,e,r){return n.i(i.b)(this,void 0,void 0,function(){var o,a,l,u,h,f,d;return n.i(i.c)(this,function(n){switch(n.label){case 0:return o=c.a.getRatingItemText(this.questionRating,r,e.locText),this.controller.pushMargins(),a=this.controller.unitWidth/2,this.controller.margins.left+=a,this.controller.margins.right+=a,l=c.a.clone(t),l.xLeft+=a,h=s.a.bind,[4,c.a.createBoldTextFlat(l,this.questionRating,this.controller,o)];case 1:return u=new(h.apply(s.a,[void 0,n.sent()])),this.controller.popMargins(),f=u.width,f<c.a.getRatingMinWidth(this.controller)?(u.xLeft+=(c.a.getRatingMinWidth(this.controller)-f)/2-a,f=c.a.getRatingMinWidth(this.controller)):f+=this.controller.unitWidth,d=c.a.createPoint(u),d.xLeft=t.xLeft,u.addBrick(this.generateFlatItem(c.a.createRect(d,f,this.controller.unitHeight),e,r,void 0,this.question.value==e.value)),[2,u]}})})},e.prototype.generateFlatComposite=function(t,e,r){return n.i(i.b)(this,void 0,void 0,function(){var o,l,u,h,f,d,p,g;return n.i(i.c)(this,function(n){switch(n.label){case 0:return o=new s.a,(l=c.a.createRect(t,this.controller.unitHeight,this.controller.unitHeight),u=this.generateFlatItem(c.a.moveRect(c.a.scaleRect(l,c.a.SELECT_ITEM_FLAT_SCALE),t.xLeft),e,r,void 0,this.question.value==e.value),o.addBrick(u),h=c.a.clone(t),h.xLeft=u.xRight+this.controller.unitWidth*c.a.GAP_BETWEEN_ITEM_TEXT,f=c.a.getRatingItemText(this.questionRating,r,e.locText),d=null==f)?[3,2]:(g=(p=o).addBrick,[4,c.a.createTextFlat(h,this.question,this.controller,f,a.a)]);case 1:d=g.apply(p,[n.sent()]),n.label=2;case 2:return[2,o]}})})},e.prototype.generateHorisontallyItems=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,a,l;return n.i(i.c)(this,function(n){switch(n.label){case 0:e=[new s.a],r=c.a.clone(t),o=0,n.label=1;case 1:return o<this.questionRating.visibleRateValues.length?[4,this.generateFlatHorisontalComposite(r,this.questionRating.visibleRateValues[o],o)]:[3,4];case 2:a=n.sent(),e[e.length-1].addBrick(a),l=this.controller.paperWidth-this.controller.margins.right-a.xRight,c.a.getRatingMinWidth(this.controller)<=l+c.a.EPSILON?r.xLeft=a.xRight:(r.xLeft=t.xLeft,r.yTop=a.yBot,o!==this.questionRating.visibleRateValues.length-1&&(e[e.length-1].addBrick(c.a.createRowlineFlat(r,this.controller)),r.yTop+=c.a.EPSILON,e.push(new s.a))),n.label=3;case 3:return o++,[3,1];case 4:return[2,e]}})})},e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o;return n.i(i.c)(this,function(n){for(e=!1,r=0;r<this.questionRating.visibleRateValues.length;r++)o=c.a.getRatingItemText(this.questionRating,r,this.questionRating.visibleRateValues[r].locText),this.controller.measureText(o).width>this.controller.measureText(c.a.RATING_COLUMN_WIDTH).width&&(e=!0);return[2,e?this.generateVerticallyItems(t,this.questionRating.visibleRateValues):this.generateHorisontallyItems(t)]})})},e}(r.a);o.a.getInstance().register("rating",l)},function(t,e,n){"use strict";var i=n(0),r=n(3),o=n(2),a=n(1),s=n(12),c=n(5);n.d(e,"a",function(){return l});var l=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n.i(i.a)(e,t),e.prototype.generateBackgroundImage=function(t){return n.i(i.b)(this,void 0,void 0,function(){return n.i(i.c)(this,function(e){switch(e.label){case 0:return[4,a.a.createImageFlat(t,this.question,this.controller,{link:this.question.backgroundImage,width:a.a.pxToPt(this.question.signatureWidth),height:a.a.pxToPt(this.question.signatureHeight),objectFit:"cover"},!0)];case 1:return[2,e.sent()]}})})},e.prototype.getSignImageUrl=function(){return this.question.storeDataAsText||!this.question.loadedData?this.question.value:this.question.loadedData},e.prototype.generateSign=function(t){return n.i(i.b)(this,void 0,void 0,function(){var r,o,c,l=this;return n.i(i.c)(this,function(n){switch(n.label){case 0:return r=a.a.pxToPt(this.question.signatureWidth),o=a.a.pxToPt(this.question.signatureHeight),this.question.value?[4,a.a.createImageFlat(t,this.question,this.controller,{link:this.getSignImageUrl(),width:r,height:o},!1)]:[3,2];case 1:return c=n.sent(),[3,3];case 2:c=new s.a(a.a.createRect(t,r,o)),n.label=3;case 3:return"none"!==e.BORDER_STYLE&&(c.afterRenderCallback=function(){var t={height:c.width,width:c.width,yTop:c.yTop,yBot:c.yBot,xLeft:c.xLeft,xRight:c.xRight,formBorderColor:c.formBorderColor,rounded:!1,outside:!0,dashStyle:"dashed"==e.BORDER_STYLE?{dashArray:[5],dashPhase:0}:void 0};a.a.renderFlatBorders(l.controller,t)}),[2,c]}})})},e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,a,s;return n.i(i.c)(this,function(n){switch(n.label){case 0:return e=new c.a,this.question.backgroundImage?(o=(r=e).addBrick,[4,this.generateBackgroundImage(t)]):[3,2];case 1:o.apply(r,[n.sent()]),n.label=2;case 2:return s=(a=e).addBrick,[4,this.generateSign(t)];case 3:return s.apply(a,[n.sent()]),[2,[e]]}})})},e.BORDER_STYLE="dashed",e}(r.a);o.a.getInstance().register("signaturepad",l)},function(t,e,n){"use strict";var i=n(0),r=n(3),o=n(2),a=n(17),s=n(1);n.d(e,"a",function(){return c});var c=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n.i(i.a)(e,t),e.prototype.generateFlatsContent=function(t){return n.i(i.b)(this,void 0,void 0,function(){var r;return n.i(i.c)(this,function(n){switch(n.label){case 0:return this.shouldRenderAsComment?[4,s.a.createCommentFlat(t,this.question,this.controller,!0,{rows:e.MULTILINE_TEXT_ROWS_COUNT})]:(r=s.a.createTextFieldRect(t,this.controller),[2,[new a.a(this.question,this.controller,r)]]);case 1:return[2,[n.sent()]]}})})},e.MULTILINE_TEXT_ROWS_COUNT=1,e}(r.a);o.a.getInstance().register("text",c)},function(t,e,n){"use strict";var i=n(0),r=n(7);n.d(e,"a",function(){return o});var o=function(t){function e(e,n,i){var r=t.call(this,e,n,i(n.helperDoc,e,0,0))||this;return r.renderFunc=i,r}return n.i(i.a)(e,t),e.prototype.renderInteractive=function(){return n.i(i.b)(this,void 0,void 0,function(){var t=this;return n.i(i.c)(this,function(e){switch(e.label){case 0:return[4,new Promise(function(e){t.renderFunc(t.controller.doc,t.question,t.xLeft,t.yTop),e()})];case 1:return e.sent(),[2]}})})},e}(r.a)},function(t,e,n){"use strict";var i=n(0),r=n(6),o=(n.n(r),n(8)),a=n(10),s=n(23),c=n(20),l=n(1);n.d(e,"a",function(){return u});var u=function(t){function e(e,n){var i=t.call(this,e)||this;return i.onRenderHeader=new c.b,i.onRenderFooter=new c.b,i.onRenderQuestion=new c.b,i.onRenderPanel=new c.b,i.onRenderPage=new c.b,i.onDocControllerCreated=new r.EventBase,i.onRenderCheckItemAcroform=new c.b,i.onRenderRadioGroupWrapAcroform=new c.b,i.onRenderRadioItemAcroform=new c.b,void 0===n&&(n={}),i.options=l.a.clone(n),i}return n.i(i.a)(e,t),Object.defineProperty(e.prototype,"haveCommercialLicense",{get:function(){var t=r.hasLicense;return!!t&&t(2)},set:function(t){console.error("As of v1.9.101, the haveCommercialLicense property is not supported. To activate your license, use the setLicenseKey(key) method as shown on the following page: https://surveyjs.io/remove-alert-banner")},enumerable:!1,configurable:!0}),e.prototype.waitForQuestionIsReady=function(t){return new Promise(function(e){if(t.isReady)e();else{var n=function(i,r){r.isReady&&(t.onReadyChanged.remove(n),e())};t.onReadyChanged.add(n)}})},e.prototype.waitForCoreIsReady=function(){return n.i(i.b)(this,void 0,void 0,function(){var t,e,r,o,a,s,c;return n.i(i.c)(this,function(n){switch(n.label){case 0:t=0,e=this.getAllQuestions(),n.label=1;case 1:if(!(t<e.length))return[3,9];if(r=e[t],!r.contentPanel)return[3,6];o=[],r.contentPanel.addQuestionsToList(o),a=0,s=o,n.label=2;case 2:return a<s.length?(c=s[a],[4,this.waitForQuestionIsReady(c)]):[3,5];case 3:n.sent(),n.label=4;case 4:return a++,[3,2];case 5:return[3,8];case 6:return[4,this.waitForQuestionIsReady(l.a.getContentQuestion(r))];case 7:n.sent(),n.label=8;case 8:return t++,[3,1];case 9:return[2]}})})},e.prototype.getUpdatedCheckItemAcroformOptions=function(t){this.onRenderCheckItemAcroform.fire(this,t)},e.prototype.getUpdatedRadioGroupWrapOptions=function(t){this.onRenderRadioGroupWrapAcroform.fire(this,t)},e.prototype.getUpdatedRadioItemAcroformOptions=function(t){this.onRenderRadioItemAcroform.fire(this,t)},e.prototype.correctBricksPosition=function(t,e){t.isRTL&&e.forEach(function(e){e.forEach(function(e){e.translateX(function(e,n){var i=t.paperWidth-e-n;return{xLeft:e+i,xRight:n+i}})})})},e.prototype.renderSurvey=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e,r,o,l;return n.i(i.c)(this,function(n){switch(n.label){case 0:return this.visiblePages.forEach(function(t){return t.onFirstRendering()}),[4,this.waitForCoreIsReady()];case 1:return n.sent(),[4,a.a.generateFlats(this,t)];case 2:return e=n.sent(),this.correctBricksPosition(t,e),r=s.a.pack(e,t),[4,c.a.process_header_events(this,t,r)];case 3:n.sent(),o=0,n.label=4;case 4:if(!(o<r.length))return[3,9];l=0,n.label=5;case 5:return l<r[o].length?(t.getNumberOfPages()===o&&t.addPage(),t.setPage(o),[4,r[o][l].render()]):[3,8];case 6:n.sent(),n.label=7;case 7:return l++,[3,5];case 8:return o++,[3,4];case 9:return[2]}})})},e.prototype.save=function(t){return void 0===t&&(t="survey_result.pdf"),n.i(i.b)(this,void 0,void 0,function(){var r,a,s=this;return n.i(i.c)(this,function(n){switch(n.label){case 0:return e.currentlySaving?[3,2]:(r=new o.b(this.options),this.onDocControllerCreated.fire(this,{controller:r}),e.currentlySaving=!0,l.a.fixFont(r),[4,this.renderSurvey(r)]);case 1:return n.sent(),a=r.doc.save(t,{returnPromise:!0}),a.then(function(){e.currentlySaving=!1;var t=e.saveQueue.shift();t&&t()}),[2,a];case 2:e.saveQueue.push(function(){s.save(t)}),n.label=3;case 3:return[2]}})})},e.prototype.raw=function(t){return n.i(i.b)(this,void 0,void 0,function(){var e;return n.i(i.c)(this,function(n){switch(n.label){case 0:return e=new o.b(this.options),this.onDocControllerCreated.fire(this,{controller:e}),l.a.fixFont(e),[4,this.renderSurvey(e)];case 1:return n.sent(),[2,e.doc.output(t)]}})})},e.currentlySaving=!1,e.saveQueue=[],e}(r.SurveyModel)},function(t,e,n){"use strict";function i(t){return void 0===t?-1:t.height}Object.defineProperty(e,"__esModule",{value:!0});var r=n(57),o=function(){function t(t,e){this.intervalTree=t,this.records=[],this.height=0,this.key=e.low,this.max=e.high,this.records.push(e)}return t.prototype.getNodeHigh=function(){for(var t=this.records[0].high,e=1;e<this.records.length;e++)this.records[e].high>t&&(t=this.records[e].high);return t},t.prototype.updateHeight=function(){this.height=Math.max(i(this.left),i(this.right))+1},t.prototype.updateMaxOfParents=function(){if(void 0!==this){var t=this.getNodeHigh();void 0!==this.left&&void 0!==this.right?this.max=Math.max(Math.max(this.left.max,this.right.max),t):void 0!==this.left&&void 0===this.right?this.max=Math.max(this.left.max,t):void 0===this.left&&void 0!==this.right?this.max=Math.max(this.right.max,t):this.max=t,this.parent&&this.parent.updateMaxOfParents()}},t.prototype._updateMaxAfterRightRotate=function(){var t=this.parent,e=t.left,n=e.getNodeHigh();void 0===e.left&&void 0!==e.right?e.max=Math.max(n,e.right.max):void 0!==e.left&&void 0===e.right?e.max=Math.max(n,e.left.max):void 0===e.left&&void 0===e.right?e.max=n:e.max=Math.max(Math.max(e.left.max,e.right.max),n);var i=this.getNodeHigh();void 0===this.left&&void 0!==this.right?this.max=Math.max(i,this.right.max):void 0!==this.left&&void 0===this.right?this.max=Math.max(i,this.left.max):void 0===this.left&&void 0===this.right?this.max=i:this.max=Math.max(Math.max(this.left.max,this.right.max),i),t.max=Math.max(Math.max(t.left.max,t.right.max),t.getNodeHigh())},t.prototype._updateMaxAfterLeftRotate=function(){var t=this.parent,e=t.right,n=e.getNodeHigh();void 0===e.left&&void 0!==e.right?e.max=Math.max(n,e.right.max):void 0!==e.left&&void 0===e.right?e.max=Math.max(n,e.left.max):void 0===e.left&&void 0===e.right?e.max=n:e.max=Math.max(Math.max(e.left.max,e.right.max),n);var i=this.getNodeHigh();void 0===this.left&&void 0!==this.right?this.max=Math.max(i,this.right.max):void 0!==this.left&&void 0===this.right?this.max=Math.max(i,this.left.max):void 0===this.left&&void 0===this.right?this.max=i:this.max=Math.max(Math.max(this.left.max,this.right.max),i),t.max=Math.max(Math.max(t.left.max,e.max),t.getNodeHigh())},t.prototype._leftRotate=function(){var t=this.right;t.parent=this.parent,void 0===t.parent?this.intervalTree.root=t:t.parent.left===this?t.parent.left=t:t.parent.right===this&&(t.parent.right=t),this.right=t.left,void 0!==this.right&&(this.right.parent=this),t.left=this,this.parent=t,this.updateHeight(),t.updateHeight()},t.prototype._rightRotate=function(){var t=this.left;t.parent=this.parent,void 0===t.parent?this.intervalTree.root=t:t.parent.left===this?t.parent.left=t:t.parent.right===this&&(t.parent.right=t),this.left=t.right,void 0!==this.left&&(this.left.parent=this),t.right=this,this.parent=t,this.updateHeight(),t.updateHeight()},t.prototype._rebalance=function(){if(i(this.left)>=2+i(this.right)){var t=this.left;i(t.left)>=i(t.right)?(this._rightRotate(),this._updateMaxAfterRightRotate()):(t._leftRotate(),this._rightRotate(),this._updateMaxAfterRightRotate())}else if(i(this.right)>=2+i(this.left)){var e=this.right;i(e.right)>=i(e.left)?(this._leftRotate(),this._updateMaxAfterLeftRotate()):(e._rightRotate(),this._leftRotate(),this._updateMaxAfterLeftRotate())}},t.prototype.insert=function(e){e.low<this.key?void 0===this.left?(this.left=new t(this.intervalTree,e),this.left.parent=this):this.left.insert(e):void 0===this.right?(this.right=new t(this.intervalTree,e),this.right.parent=this):this.right.insert(e),this.max<e.high&&(this.max=e.high),this.updateHeight(),this._rebalance()},t.prototype._getOverlappingRecords=function(t,e,n){if(t.key<=n&&e<=t.getNodeHigh()){for(var i=[],r=0;r<t.records.length;r++)t.records[r].high>=e&&i.push(t.records[r]);return i}return[]},t.prototype.search=function(t,e){if(void 0===this)return[];var n=[],i=[],r=[];return t>this.max?[]:(void 0!==this.left&&this.left.max>=t&&(n=this.left.search(t,e)),i=this._getOverlappingRecords(this,t,e),e<this.key?n.concat(i):(void 0!==this.right&&(r=this.right.search(t,e)),n.concat(i,r)))},t.prototype.searchExisting=function(t){if(void 0!==this){if(this.key===t)return this;if(t<this.key){if(void 0!==this.left)return this.left.searchExisting(t)}else if(void 0!==this.right)return this.right.searchExisting(t)}},t.prototype._minValue=function(){return void 0===this.left?this:this.left._minValue()},t.prototype.remove=function(t){var e=this.parent;if(t.key<this.key)return void 0!==this.left?this.left.remove(t):void 0;if(t.key>this.key)return void 0!==this.right?this.right.remove(t):void 0;if(void 0!==this.left&&void 0!==this.right){var n=this.right._minValue();return this.key=n.key,this.records=n.records,this.right.remove(this)}return e.left===this?(void 0!==this.right?(e.left=this.right,this.right.parent=e):(e.left=this.left,void 0!==this.left&&(this.left.parent=e)),e.updateMaxOfParents(),e.updateHeight(),e._rebalance(),this):e.right===this?(void 0!==this.right?(e.right=this.right,this.right.parent=e):(e.right=this.left,void 0!==this.left&&(this.left.parent=e)),e.updateMaxOfParents(),e.updateHeight(),e._rebalance(),this):void 0},t}();e.Node=o;var a=function(){function t(){this.count=0}return t.prototype.insert=function(t){if(t.low>t.high)throw new Error("`low` value must be lower or equal to `high` value");if(void 0===this.root)return this.root=new o(this,t),this.count++,!0;var e=this.root.searchExisting(t.low);if(void 0!==e){for(var n=0;n<e.records.length;n++)if(r(e.records[n],t))return!1;return e.records.push(t),t.high>e.max&&(e.max=t.high,e.parent&&e.parent.updateMaxOfParents()),this.count++,!0}return this.root.insert(t),this.count++,!0},t.prototype.search=function(t,e){return void 0===this.root?[]:this.root.search(t,e)},t.prototype.remove=function(t){if(void 0===this.root)return!1;var e=this.root.searchExisting(t.low);if(void 0===e)return!1;if(e.records.length>1){for(var n=void 0,i=0;i<e.records.length;i++)if(r(e.records[i],t)){n=e.records[i],e.records.splice(i,1);break}if(n){if(n=void 0,t.high===e.max){var a=e.getNodeHigh();void 0!==e.left&&void 0!==e.right?e.max=Math.max(Math.max(e.left.max,e.right.max),a):void 0!==e.left&&void 0===e.right?e.max=Math.max(e.left.max,a):void 0===e.left&&void 0!==e.right?e.max=Math.max(e.right.max,a):e.max=a,e.parent&&e.parent.updateMaxOfParents()}return this.count--,!0}return!1}if(1===e.records.length){if(r(e.records[0],t)){if(this.root.key===e.key){var s=new o(this,{low:t.low,high:t.low});s.left=this.root,this.root.parent=s;var c=this.root.remove(e);return this.root=s.left,void 0!==this.root&&(this.root.parent=void 0),!!c&&(c=void 0,this.count--,!0)}var c=this.root.remove(e);return!!c&&(c=void 0,this.count--,!0)}return!1}return!1},t.prototype.inOrder=function(){return new c(this.root)},t.prototype.preOrder=function(){return new l(this.root)},t}();e.IntervalTree=a;var s=function(){function t(){this.tree=new a}return t.prototype.insert=function(t,e,n){return this.tree.insert({low:t,high:e,data:n})},t.prototype.remove=function(t,e,n){return this.tree.remove({low:t,high:e,data:n})},t.prototype.search=function(t,e){return this.tree.search(t,e).map(function(t){return t.data})},t.prototype.inOrder=function(){return this.tree.inOrder()},t.prototype.preOrder=function(){return this.tree.preOrder()},Object.defineProperty(t.prototype,"count",{get:function(){return this.tree.count},enumerable:!0,configurable:!0}),t}();e.default=s;var c=function(){function t(t){this.stack=[],void 0!==t&&this.push(t)}return t.prototype.next=function(){return void 0===this.currentNode?{done:!0,value:void 0}:this.i<this.currentNode.records.length?{done:!1,value:this.currentNode.records[this.i++]}:(void 0!==this.currentNode.right?this.push(this.currentNode.right):this.pop(),this.next())},t.prototype.push=function(t){for(this.currentNode=t,this.i=0;void 0!==this.currentNode.left;)this.stack.push(this.currentNode),this.currentNode=this.currentNode.left},t.prototype.pop=function(){this.currentNode=this.stack.pop(),this.i=0},t}();e.InOrder=c,"function"==typeof Symbol&&(c.prototype[Symbol.iterator]=function(){return this});var l=function(){function t(t){this.stack=[],this.i=0,this.currentNode=t}return t.prototype.next=function(){return void 0===this.currentNode?{done:!0,value:void 0}:this.i<this.currentNode.records.length?{done:!1,value:this.currentNode.records[this.i++]}:(void 0!==this.currentNode.right&&this.push(this.currentNode.right),void 0!==this.currentNode.left&&this.push(this.currentNode.left),this.pop(),this.next())},t.prototype.push=function(t){this.stack.push(t)},t.prototype.pop=function(){this.currentNode=this.stack.pop(),this.i=0},t}();e.PreOrder=l,"function"==typeof Symbol&&(l.prototype[Symbol.iterator]=function(){return this})},function(t,e){t.exports=function(t,e,n,i){var r=n?n.call(i,t,e):void 0;if(void 0!==r)return!!r;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),c=0;c<o.length;c++){var l=o[c];if(!s(l))return!1;var u=t[l],h=e[l];if(!1===(r=n?n.call(i,u,h,l):void 0)||void 0===r&&u!==h)return!1}return!0}},function(t,e,n){"use strict";function i(t){var e=t.AcroFormAppearance.RadioButton.Circle.YesNormal;t.AcroFormAppearance.RadioButton.Circle.YesNormal=function(n){var i=e(n),r=i.stream.split("\n"),o=t.__private__.encodeColorString(n.color);return r[0]=r[0]+"\n"+o+"\n"+o.toUpperCase(),i.stream=r.join("\n"),i}}e.a=i},function(t,e,n){"use strict";var i=n(0),r=n(7);n.d(e,"a",function(){return o});var o=function(t){function e(e,n,i,r,o){var a=t.call(this,void 0,e,n)||this;return a.color=i,a.renderWidth=r,a.renderHeight=o,a}return n.i(i.a)(e,t),e.prototype.renderInteractive=function(){var t,e;return n.i(i.b)(this,void 0,void 0,function(){var r;return n.i(i.c)(this,function(n){return r=this.controller.doc.getFillColor(),this.controller.doc.setFillColor(this.color||"black"),this.controller.doc.rect(this.xLeft,this.yTop,null!==(t=this.renderWidth)&&void 0!==t?t:this.width,null!==(e=this.renderHeight)&&void 0!==e?e:this.height,"F"),this.controller.doc.setFillColor(r),[2]})})},e}(r.a)},function(t,e,n){"use strict";var i=n(0),r=n(4);n.d(e,"a",function(){return o});var o=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return n.i(i.a)(e,t),e}(r.a)},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e,n){(function(t){/**
7
- * @license
8
- * Copyright (c) 2016 Alexander Weidt,
9
- * https://github.com/BiggA94
10
- *
11
- * Licensed under the MIT License. http://opensource.org/licenses/mit-license
12
- */
13
- var e=n(18);!function(t,e){"use strict";function n(t){for(var e="",n=0;n<t.length;n++){for(var i=t.charCodeAt(n).toString(16).toUpperCase();i.length<4;)i="0"+i;e+=i}return"<FEFF"+e+">"}function i(t){for(var e="[ ",i=0;i<t.length;i++)e+=n(t[i]);return e+=" ]"}function r(t,e,n){n||(n=1);for(var i,r=[];i=e.exec(t);)r.push(i[n]);return r}var o,a=t.API,s=1,c=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},l=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},u=function(t){return t.toFixed(2)},h=function(t){return t.toFixed(5)};a.__acroform__={};var f=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},d=function(t){return t*s},p=function(t){return t/s},g=function(t){var e=new q,n=$.internal.getHeight(t)||0,i=$.internal.getWidth(t)||0;return e.BBox=[0,0,Number(u(i)),Number(u(n))],e},m=a.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|=1<<e},v=a.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&=~(1<<e)},y=a.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return 0==(t&1<<e)?0:1},b=a.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return y(t,e-1)},x=a.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return m(t,e-1)},T=a.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return v(t,e-1)},_=a.__acroform__.calculateCoordinates=function(t){var e=this.internal.getHorizontalCoordinate,n=this.internal.getVerticalCoordinate,i=t[0],r=t[1],o=t[2],a=t[3],s={};return s.lowerLeft_X=e(i)||0,s.lowerLeft_Y=n(r+a)||0,s.upperRight_X=e(i+o)||0,s.upperRight_Y=n(r)||0,[Number(u(s.lowerLeft_X)),Number(u(s.lowerLeft_Y)),Number(u(s.upperRight_X)),Number(u(s.upperRight_Y))]},F=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],n=t.V||t.DV,i=w(t,n),r=o.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(o.__private__.encodeColorString(t.color)),e.push("/"+r+" "+u(i.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(i.text),e.push("ET"),e.push("Q"),e.push("EMC");var a=new g(t);return a.stream=e.join("\n"),a}},w=function(t,e){t.isUnicode&&(e=t.trueValue);var n=0===t.fontSize?t.maxFontSize:t.fontSize,i={text:"",fontSize:""};e="("==e.substr(0,1)?e.substr(1):e,e=")"==e.substr(e.length-1)?e.substr(0,e.length-1):e;var r=e.split(" ");r=r.map(function(t){return t.split("\n")}),t.multiline||(r=r.map(function(t){return[t.join(" ")]}));var a=n,s=2,l=2,h=$.internal.getHeight(t)||0;h=h<0?-h:h;var f=$.internal.getWidth(t)||0;f=f<0?-f:f;var d=function(e,n,i){if(e+1<r.length){var o=n+" "+r[e+1][0];return R(o,t,i).width<=f-2*l}return!1};a++;t:for(;a>0;){e="",a--;var p=R("3",t,a).height,g=t.multiline?h-a:(h-p)/2;g+=s;var m,v,y=g,b=0,x=0,T=0;if(a<=0){a=12,e="(...) Tj\n",e+="% Width of Text: "+R(e,t,a).width+", FieldWidth:"+f+"\n";break}for(var _="",F=0,w=0;w<r.length;w++)if(r.hasOwnProperty(w)){var C=!1;if(1!==r[w].length&&T!==r[w].length-1){if((p+s)*(F+2)+s>h)continue t;_+=r[w][T],C=!0,x=w,w--}else{_+=r[w][T]+" ",_=" "==_.substr(_.length-1)?_.substr(0,_.length-1):_;var P=parseInt(w),E=d(P,_,a),O=w>=r.length-1;if(E&&!O){_+=" ",T=0;continue}if(E||O){if(O)x=P;else if(t.multiline&&(p+s)*(F+2)+s>h)continue t}else{if(!t.multiline)continue t;if((p+s)*(F+2)+s>h)continue t;x=P}}for(var S="",L=b;L<=x;L++){var B=r[L];if(t.multiline){if(L===x){S+=B[T]+" ",T=(T+1)%B.length;continue}if(L===b){S+=B[B.length-1]+" ";continue}}S+=B[0]+" "}switch(S=" "==S.substr(S.length-1)?S.substr(0,S.length-1):S,v=R(S,t,a).width,t.textAlign){case"right":m=f-v-l;break;case"center":m=(f-v)/2;break;case"left":default:m=l}if(e+=u(m)+" "+u(y)+" Td\n",t.isUnicode){var A={};A[o.internal.getFont().id]=o.internal.getFont();var N={text:S,x:null,y:null,options:{lang:null},mutex:{pdfEscape:c,activeFontKey:o.internal.getFont().id,fonts:A,activeFontSize:t.fontSize}};o.internal.events.publish("postProcessText",N),e+="<"+N.text+"> Tj\n"}else e+="("+c(S)+") Tj\n";e+=-u(m)+" 0 Td\n",y=-(a+s),v=0,b=C?x:x+1,F++,_=""}else;break}return i.text=e,i.fontSize=a,i},R=function(t,e,n){var i=o.internal.getFont(e.fontName,e.fontStyle),r=o.getStringUnitWidth(t,{font:i,fontSize:parseFloat(n),charSpace:0})*parseFloat(n);return{height:o.getStringUnitWidth("3",{font:i,fontSize:parseFloat(n),charSpace:0})*parseFloat(n)*1.5,width:r}},C={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},P=function(){o.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=o.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var n=t[e];n.objId=void 0,n.hasAnnotation&&O.call(o,n)}},E=function(t){o.internal.acroformPlugin.printedOut&&(o.internal.acroformPlugin.printedOut=!1,o.internal.acroformPlugin.acroFormDictionaryRoot=null),o.internal.acroformPlugin.acroFormDictionaryRoot||N.call(o),o.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)},O=function(t){var e={type:"reference",object:t},n=function(t){return t.type===e.type&&t.object===e.object};void 0===o.internal.getPageInfo(t.page).pageContext.annotations.find(n)&&o.internal.getPageInfo(t.page).pageContext.annotations.push(e)},S=function(){if(void 0===o.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");o.internal.write("/AcroForm "+o.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},L=function(){o.internal.events.unsubscribe(o.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete o.internal.acroformPlugin.acroFormDictionaryRoot._eventID,o.internal.acroformPlugin.printedOut=!0},B=function(t){var e=!t;t||(o.internal.newObjectDeferredBegin(o.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),o.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||o.internal.acroformPlugin.acroFormDictionaryRoot.Kids;for(var n in t)if(t.hasOwnProperty(n)){var i=t[n],r=[],a=i.Rect;if(i.Rect&&(i.Rect=_.call(this,i.Rect)),o.internal.newObjectDeferredBegin(i.objId,!0),i.DA=$.createDefaultAppearanceStream(i),"object"==typeof i&&"function"==typeof i.getKeyValueListForStream&&(r=i.getKeyValueListForStream()),i.Rect=a,i.hasAppearanceStream&&!i.appearanceStreamContent){var s=F.call(this,i);r.push({key:"AP",value:"<</N "+s+">>"}),o.internal.acroformPlugin.xForms.push(s)}if(i.appearanceStreamContent){var c="";for(var l in i.appearanceStreamContent)if(i.appearanceStreamContent.hasOwnProperty(l)){var u=i.appearanceStreamContent[l];if(c+="/"+l+" ",c+="<<",Object.keys(u).length>=1||Array.isArray(u)){for(var n in u)if(u.hasOwnProperty(n)){var h=u[n];"function"==typeof h&&(h=h.call(this,i)),c+="/"+n+" "+h+" ",o.internal.acroformPlugin.xForms.indexOf(h)>=0||o.internal.acroformPlugin.xForms.push(h)}}else h=u,"function"==typeof h&&(h=h.call(this,i)),c+="/"+n+" "+h,o.internal.acroformPlugin.xForms.indexOf(h)>=0||o.internal.acroformPlugin.xForms.push(h);c+=">>"}r.push({key:"AP",value:"<<\n"+c+">>"})}o.internal.putStream({additionalKeyValues:r}),o.internal.out("endobj")}e&&A.call(this,o.internal.acroformPlugin.xForms)},A=function(t){for(var e in t)if(t.hasOwnProperty(e)){var n=e,i=t[e];o.internal.newObjectDeferredBegin(i&&i.objId,!0),"object"==typeof i&&"function"==typeof i.putStream&&i.putStream(),delete t[n]}},N=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(o=this,D.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(C)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");s=o.internal.scaleFactor,o.internal.acroformPlugin.acroFormDictionaryRoot=new H,o.internal.acroformPlugin.acroFormDictionaryRoot._eventID=o.internal.events.subscribe("postPutResources",L),o.internal.events.subscribe("buildDocument",P),o.internal.events.subscribe("putCatalog",S),o.internal.events.subscribe("postPutPages",B),o.internal.acroformPlugin.isInitialized=!0}},I=a.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n<t.length;n++)switch(0!==n&&(e+=" "),typeof t[n]){case"boolean":case"number":case"object":e+=t[n].toString();break;case"string":"/"!==t[n].substr(0,1)?e+="("+c(t[n].toString())+")":e+=t[n].toString()}return e+="]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},M=function(t){var e=[];return"string"==typeof t&&(e=r(t,/\((.*?)\)/g)),e},W=function(t){return t=t||"",t.toString(),t="("+c(t)+")"},k=function(){var t;Object.defineProperty(this,"objId",{configurable:!0,get:function(){return t||(t=o.internal.newObjectDeferred()),t},set:function(e){t=e}})};k.prototype.toString=function(){return this.objId+" 0 R"},k.prototype.putStream=function(){var t=this.getKeyValueListForStream();o.internal.putStream({data:this.stream,additionalKeyValues:t}),o.internal.out("endobj")},k.prototype.getKeyValueListForStream=function(){return function(t){var e=[],n=Object.getOwnPropertyNames(t).filter(function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)});for(var i in n){var r=Object.getOwnPropertyDescriptor(t,n[i]);if(r&&!1===r.configurable){var o=n[i],a=t[o];a&&(Array.isArray(a)?e.push({key:o,value:I(a)}):a instanceof k?e.push({key:o,value:a.objId+" 0 R"}):"function"!=typeof a&&e.push({key:o,value:a}))}}return e}(this)};var q=function(){k.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writeable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writeable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writeable:!0});var t=[];Object.defineProperty(this,"BBox",{configurable:!1,writeable:!0,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writeable:!0});var e;Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(t){e=t.trim()},get:function(){return e||null}})};f(q,k);var H=function(){k.call(this);var t=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return t.length>0?t:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return t}});var e;Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(e)return"("+e+")"},set:function(t){e=t}})};f(H,k);var D=function(){k.call(this);var t=4;this.isUnicode=!1,this.trueValue="",Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){if(isNaN(e))throw new Error('Invalid value "'+e+'" for attribute F supplied.');t=e}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(t,3))},set:function(e){!0===Boolean(e)?this.F=x(t,3):this.F=T(t,3)}});var e=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute Ff supplied.');e=t}});var i=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==i.length)return i},set:function(t){i=void 0!==t?t:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[0])?0:p(i[0])},set:function(t){i[0]=d(t)}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[1])?0:p(i[1])},set:function(t){i[1]=d(t)}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[2])?0:p(i[2])},set:function(t){i[2]=d(t)}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!i||isNaN(i[3])?0:p(i[3])},set:function(t){i[3]=d(t)}});var r="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return r},set:function(t){switch(t){case"/Btn":case"/Tx":case"/Ch":case"/Sig":r=t;break;default:throw new Error('Invalid value "'+t+'" for attribute FT supplied.')}}});var o=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!o||o.length<1){if(this instanceof X)return;o="FieldObject"+D.FieldNum++}return"("+c(o)+")"},set:function(t){o=t.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return o},set:function(t){o=t}});var a="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return a},set:function(t){a=t}});var s="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return s},set:function(t){s=t}});var u=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return p(u)},set:function(t){u=d(t)}});var h=50;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return p(h)},set:function(t){h=d(t)}});var f="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return f},set:function(t){f=t}});var g="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!g||this instanceof X||this instanceof Z))return W(g)},set:function(t){t=t.toString(),g=t}});var m=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(m)return this instanceof U==!1?W(m):m},set:function(t){t=t.toString(),m=this instanceof U==!1?l("("===t.substr(0,1)?t.substr(1,t.length-2):t):t}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof U==!0?l(m.substr(1,m.length-1)):m},set:function(t){t=t.toString(),m=this instanceof U==!0?"/"+t:t}});var v=null;Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){if(this.isUnicode)return v;if(v)return this instanceof U==!1?W(v):v},set:function(t){t=t.toString(),this.isUnicode?(v=n(t),this.trueValue=t):v=this instanceof U==!1?l("("===t.substr(0,1)?t.substr(1,t.length-2):t):t}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof U==!0?l(v.substr(1,v.length-1)):v},set:function(t){t=t.toString(),v=this instanceof U==!0?"/"+t:t}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var y=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,writeable:!0,get:function(){return y},set:function(t){t=Boolean(t),y=t}});var _;Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,writeable:!0,get:function(){if(_)return _},set:function(t){_=t}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,1))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,1):this.Ff=T(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,2))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,2):this.Ff=T(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,3))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,3):this.Ff=T(this.Ff,3)}});var F=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==F)return F},set:function(t){if(-1===[0,1,2].indexOf(t))throw new Error('Invalid value "'+t+'" for attribute Q supplied.');F=t}}),Object.defineProperty(this,"textAlign",{get:function(){var t;switch(F){case 0:default:t="left";break;case 1:t="center";break;case 2:t="right"}return t},configurable:!0,enumerable:!0,set:function(t){switch(t){case"right":case 2:F=2;break;case"center":case 1:F=1;break;case"left":case 0:default:F=0}}})};f(D,k);var j=function(){D.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}});var e="<< /BG [ 0.975 0.975 0.975 ] >>";Object.defineProperty(this,"MK",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){t=e}});var n=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return this.isUnicode?i(n):I(n)},set:function(t){n=M(t)}}),this.getOptions=function(){return n},this.setOptions=function(t){n=t,this.sort&&n.sort()},this.addOption=function(t){t=t||"",t=t.toString(),n.push(t),this.sort&&n.sort()},this.removeOption=function(t,e){for(e=e||!1,t=t||"",t=t.toString();-1!==n.indexOf(t)&&(n.splice(n.indexOf(t),1),!1!==e););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,18))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,18):this.Ff=T(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,19))},set:function(t){!0===this.combo&&(!0===Boolean(t)?this.Ff=x(this.Ff,19):this.Ff=T(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,20))},set:function(t){!0===Boolean(t)?(this.Ff=x(this.Ff,20),n.sort()):this.Ff=T(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,22))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,22):this.Ff=T(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,23):this.Ff=T(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,27))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,27):this.Ff=T(this.Ff,27)}}),this.hasAppearanceStream=!1};f(j,D);var z=function(){j.call(this),this.fontName="helvetica",this.combo=!1};f(z,j);var G=function(){z.call(this),this.combo=!0};f(G,z);var V=function(){G.call(this),this.edit=!0};f(V,G);var U=function(){D.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,15))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,15):this.Ff=T(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,16))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,16):this.Ff=T(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,17))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,17):this.Ff=T(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,26):this.Ff=T(this.Ff,26)}});var t={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){if(0!==Object.keys(t).length){var e=[];e.push("<<");var n;for(n in t)e.push("/"+n+" ("+t[n]+")");return e.push(">>"),e.join("\n")}},set:function(e){"object"==typeof e&&(t=e)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return t.CA||""},set:function(e){"string"==typeof e&&(t.CA=e)}});var e;Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return e.substr(1,e.length-1)},set:function(t){e="/"+t}})};f(U,D);var Y=function(){U.call(this),this.pushButton=!0};f(Y,U);var Q=function(){U.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=void 0!==e?e:[]}})};f(Q,U);var X=function(){D.call(this);var t;Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}});var e;Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(t){e=t}});var n={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t=[];t.push("<<");var e;for(e in n)t.push("/"+e+" ("+n[e]+")");return t.push(">>"),t.join("\n")},set:function(t){"object"==typeof t&&(n=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return n.CA||""},set:function(t){"string"==typeof t&&(n.CA=t)}});var i;Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return i},set:function(t){i=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return i.substr(1,i.length-1)},set:function(t){i="/"+t}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=$.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};f(X,D),Q.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t&&"getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},Q.prototype.createOption=function(t){var e=new X;return e.Parent=this,e.optionName=t,this.Kids.push(e),tt.call(this,e),e};var K=function(){U.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=$.CheckBox.createAppearanceStream()};f(K,U);var Z=function(){D.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,13):this.Ff=T(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,21):this.Ff=T(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,23):this.Ff=T(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,24):this.Ff=T(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,25):this.Ff=T(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,26):this.Ff=T(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};f(Z,D);var J=function(){Z.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(b(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=x(this.Ff,14):this.Ff=T(this.Ff,14)}}),this.password=!0};f(J,Z);var $={CheckBox:{createAppearanceStream:function(){return{N:{On:$.CheckBox.YesNormal},D:{On:$.CheckBox.YesPushDown,Off:$.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=new g(t),n=[],i=o.internal.getFont(t.fontName,t.fontStyle).id,r=o.__private__.encodeColorString(t.color),a=w(t,t.caption);return n.push("0.749023 g"),n.push("0 0 "+u($.internal.getWidth(t))+" "+u($.internal.getHeight(t))+" re"),n.push("f"),n.push("BMC"),n.push("q"),n.push("0 0 1 rg"),n.push("/"+i+" "+u(a.fontSize)+" Tf "+r),n.push("BT"),n.push(a.text),n.push("ET"),n.push("Q"),n.push("EMC"),e.stream=n.join("\n"),e},YesNormal:function(t){var e=new g(t),n=o.internal.getFont(t.fontName,t.fontStyle).id,i=o.__private__.encodeColorString(t.color),r=[],a=$.internal.getHeight(t),s=$.internal.getWidth(t),c=w(t,t.caption);return r.push("1 g"),r.push("0 0 "+u(s)+" "+u(a)+" re"),r.push("f"),r.push("q"),r.push("0 0 1 rg"),r.push("0 0 "+u(s-1)+" "+u(a-1)+" re"),r.push("W"),r.push("n"),r.push("0 g"),r.push("BT"),r.push("/"+n+" "+u(c.fontSize)+" Tf "+i),r.push(c.text),r.push("ET"),r.push("Q"),e.stream=r.join("\n"),e},OffPushDown:function(t){var e=new g(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+u($.internal.getWidth(t))+" "+u($.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:$.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=$.RadioButton.Circle.YesNormal,e.D[t]=$.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=new g(t),n=[],i=$.internal.getWidth(t)<=$.internal.getHeight(t)?$.internal.getWidth(t)/4:$.internal.getHeight(t)/4;i=Number((.9*i).toFixed(5));var r=$.internal.Bezier_C,o=Number((i*r).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+h($.internal.getWidth(t)/2)+" "+h($.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=new g(t),n=[],i=$.internal.getWidth(t)<=$.internal.getHeight(t)?$.internal.getWidth(t)/4:$.internal.getHeight(t)/4,i=Number((.9*i).toFixed(5)),r=Number((2*i).toFixed(5)),o=Number((r*$.internal.Bezier_C).toFixed(5)),a=Number((i*$.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+h($.internal.getWidth(t)/2)+" "+h($.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+h($.internal.getWidth(t)/2)+" "+h($.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+a+" "+a+" "+i+" 0 "+i+" c"),n.push("-"+a+" "+i+" -"+i+" "+a+" -"+i+" 0 c"),n.push("-"+i+" -"+a+" -"+a+" -"+i+" 0 -"+i+" c"),n.push(a+" -"+i+" "+i+" -"+a+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=new g(t),n=[],i=$.internal.getWidth(t)<=$.internal.getHeight(t)?$.internal.getWidth(t)/4:$.internal.getHeight(t)/4;i=Number((.9*i).toFixed(5));var r=Number((2*i).toFixed(5)),o=Number((r*$.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+h($.internal.getWidth(t)/2)+" "+h($.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:$.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=$.RadioButton.Cross.YesNormal,e.D[t]=$.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=new g(t),n=[],i=$.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+u($.internal.getWidth(t)-2)+" "+u($.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(u(i.x1.x)+" "+u(i.x1.y)+" m"),n.push(u(i.x2.x)+" "+u(i.x2.y)+" l"),n.push(u(i.x4.x)+" "+u(i.x4.y)+" m"),n.push(u(i.x3.x)+" "+u(i.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=new g(t),n=$.internal.calculateCross(t),i=[];return i.push("0.749023 g"),i.push("0 0 "+u($.internal.getWidth(t))+" "+u($.internal.getHeight(t))+" re"),i.push("f"),i.push("q"),i.push("1 1 "+u($.internal.getWidth(t)-2)+" "+u($.internal.getHeight(t)-2)+" re"),i.push("W"),i.push("n"),i.push(u(n.x1.x)+" "+u(n.x1.y)+" m"),i.push(u(n.x2.x)+" "+u(n.x2.y)+" l"),i.push(u(n.x4.x)+" "+u(n.x4.y)+" m"),i.push(u(n.x3.x)+" "+u(n.x3.y)+" l"),i.push("s"),i.push("Q"),e.stream=i.join("\n"),e},OffPushDown:function(t){var e=new g(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+u($.internal.getWidth(t))+" "+u($.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=o.internal.getFont(t.fontName,t.fontStyle).id,n=o.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+n}};$.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=$.internal.getWidth(t),n=$.internal.getHeight(t),i=Math.min(e,n);return{x1:{x:(e-i)/2,y:(n-i)/2+i},x2:{x:(e-i)/2+i,y:(n-i)/2},x3:{x:(e-i)/2,y:(n-i)/2},x4:{x:(e-i)/2+i,y:(n-i)/2+i}}}},$.internal.getWidth=function(t){var e=0;return"object"==typeof t&&(e=d(t.Rect[2])),e},$.internal.getHeight=function(t){var e=0;return"object"==typeof t&&(e=d(t.Rect[3])),e};var tt=a.addField=function(t){if(N.call(this),!(t instanceof D))throw new Error("Invalid argument passed to jsPDF.addField.");return E.call(this,t),t.page=o.internal.getCurrentPageInfo().pageNumber,this};a.addButton=function(t){if(t instanceof U==!1)throw new Error("Invalid argument passed to jsPDF.addButton.");return tt.call(this,t)},a.addTextField=function(t){if(t instanceof Z==!1)throw new Error("Invalid argument passed to jsPDF.addTextField.");return tt.call(this,t)},a.addChoiceField=function(t){if(t instanceof j==!1)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return tt.call(this,t)},"object"==typeof e&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField&&(e.ChoiceField=j,e.ListBox=z,e.ComboBox=G,e.EditBox=V,e.Button=U,e.PushButton=Y,e.RadioButton=Q,e.CheckBox=K,e.TextField=Z,e.PasswordField=J,e.AcroForm={Appearance:$}),a.AcroFormChoiceField=j,a.AcroFormListBox=z,a.AcroFormComboBox=G,a.AcroFormEditBox=V,a.AcroFormButton=U,a.AcroFormPushButton=Y,a.AcroFormRadioButton=Q,a.AcroFormCheckBox=K,a.AcroFormTextField=Z,a.AcroFormPasswordField=J,a.AcroFormAppearance=$,a.AcroForm={ChoiceField:j,ListBox:z,ComboBox:G,EditBox:V,Button:U,PushButton:Y,RadioButton:Q,CheckBox:K,TextField:Z,PasswordField:J,Appearance:$},t.AcroForm={ChoiceField:j,ListBox:z,ComboBox:G,EditBox:V,Button:U,PushButton:Y,RadioButton:Q,CheckBox:K,TextField:Z,PasswordField:J,Appearance:$}}(e.jsPDF,"undefined"!=typeof window&&window||void 0!==t&&t)}).call(e,n(61))},function(t,e,n){/**
14
- * jsPDF fromHTML plugin. BETA stage. API subject to change. Needs browser
15
- * Copyright (c) 2012 Willow Systems Corporation, willow-systems.com
16
- * 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
17
- * 2014 Diego Casorran, https://github.com/diegocr
18
- * 2014 Daniel Husar, https://github.com/danielhusar
19
- * 2014 Wolfgang Gassler, https://github.com/woolfg
20
- * 2014 Steven Spungin, https://github.com/flamenco
21
- *
22
- * @license
23
- *
24
- * ====================================================================
25
- */
26
- var i=n(18);!function(t){var e,n,i,r,o,a,s,c,l,u,h,f,d,p,g,m,v,y,b,x;e=function(){function t(){}return function(e){return t.prototype=e,new t}}(),u=function(t){var e,n,i,r,o,a,s;for(n=0,i=t.length,e=void 0,r=!1,a=!1;!r&&n!==i;)e=t[n]=t[n].trimLeft(),e&&(r=!0),n++;for(n=i-1;i&&!a&&-1!==n;)e=t[n]=t[n].trimRight(),e&&(a=!0),n--;for(o=/\s+$/g,s=!0,n=0;n!==i;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),s&&(e=e.trimLeft()),e&&(s=o.test(e)),t[n]=e),n++;return t},h=function(t,e,n,i){return this.pdf=t,this.x=e,this.y=n,this.settings=i,this.watchFunctions=[],this.init(),this},f=function(t){var e,n,r;for(e=void 0,r=t.split(","),n=r.shift();!e&&n;)e=i[n.trim().toLowerCase()],n=r.shift();return e},d=function(t){t="auto"===t?"0px":t,t.indexOf("em")>-1&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),t.indexOf("pt")>-1&&!isNaN(Number(t.replace("pt","")))&&(t=1.333*Number(t.replace("pt",""))+"px");var e,n,i;return n=void 0,e=16,(i=p[t])?i:(i={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[t])!==n?p[t]=i/e:(i=parseFloat(t))?p[t]=i/e:(i=t.match(/([\d\.]+)(px)/),Array.isArray(i)&&3===i.length?p[t]=parseFloat(i[1])/e:p[t]=1)},l=function(t){var e,n,i;return i=function(t){var e;return e=function(t){return document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(t,null):t.currentStyle?t.currentStyle:t.style}(t),function(t){return t=t.replace(/-\D/g,function(t){return t.charAt(1).toUpperCase()}),e[t]}}(t),e={},n=void 0,e["font-family"]=f(i("font-family"))||"times",e["font-style"]=r[i("font-style")]||"normal",e["text-align"]=o[i("text-align")]||"left",n=a[i("font-weight")]||"normal","bold"===n&&("normal"===e["font-style"]?e["font-style"]=n:e["font-style"]=n+e["font-style"]),e["font-size"]=d(i("font-size"))||1,e["line-height"]=d(i("line-height"))||1,e.display="inline"===i("display")?"inline":"block",n="block"===e.display,e["margin-top"]=n&&d(i("margin-top"))||0,e["margin-bottom"]=n&&d(i("margin-bottom"))||0,e["padding-top"]=n&&d(i("padding-top"))||0,e["padding-bottom"]=n&&d(i("padding-bottom"))||0,e["margin-left"]=n&&d(i("margin-left"))||0,e["margin-right"]=n&&d(i("margin-right"))||0,e["padding-left"]=n&&d(i("padding-left"))||0,e["padding-right"]=n&&d(i("padding-right"))||0,e["page-break-before"]=i("page-break-before")||"auto",e.float=s[i("cssFloat")]||"none",e.clear=c[i("clear")]||"none",e.color=i("color"),e},g=function(t,e,n){var i,r,o,a,s;if(o=!1,r=void 0,a=void 0,i=n["#"+t.id])if("function"==typeof i)o=i(t,e);else for(r=0,a=i.length;!o&&r!==a;)o=i[r](t,e),r++;if(i=n[t.nodeName],!o&&i)if("function"==typeof i)o=i(t,e);else for(r=0,a=i.length;!o&&r!==a;)o=i[r](t,e),r++;for(s="string"==typeof t.className?t.className.split(" "):[],r=0;r<s.length;r++)if(i=n["."+s[r]],!o&&i)if("function"==typeof i)o=i(t,e);else for(r=0,a=i.length;!o&&r!==a;)o=i[r](t,e),r++;return o},x=function(t,e){var n,i,r,o,a,s,c,l,u;n=[],i=[],r=0,u=0;for(var o=0;o<t.rows[0].cells.length;o++)u+=t.rows[0].cells[o].colSpan;for(c=t.clientWidth;r<u;){l=t.rows[0].cells[r];for(var o=0;o<l.colSpan;o++)i[r+o]={name:l.textContent.toLowerCase().replace(/\s+/g,"")+"_"+o,prompt:l.textContent.replace(/\r?\n/g,""),width:l.clientWidth/c*e.settings.width/l.colSpan};r+=o}for(r=1;r<t.rows.length;){for(s=t.rows[r],a={},o=0;o<s.cells.length;)a[i[o].name]=s.cells[o].textContent.replace(/\r?\n/g,""),o++;n.push(a),r++}return{rows:n,headers:i}};var T={SCRIPT:1,STYLE:1,NOSCRIPT:1,OBJECT:1,EMBED:1,SELECT:1},_=1;n=function(t,i,r){var o,a,s,c,u,h,f,d;for(a=t.childNodes,o=void 0,s=l(t),u="block"===s.display,u&&(i.setBlockBoundary(),i.setBlockStyle(s)),c=0,h=a.length;c<h;){if("object"==typeof(o=a[c])){if(i.executeWatchFunctions(o),1===o.nodeType&&"HEADER"===o.nodeName){var p=o,v=i.pdf.margins_doc.top;i.pdf.internal.events.subscribe("addPage",function(t){i.y=v,n(p,i,r),i.pdf.margins_doc.top=i.y+10,i.y+=10},!1)}if(8===o.nodeType&&"#comment"===o.nodeName)~o.textContent.indexOf("ADD_PAGE")&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top);else if(1!==o.nodeType||T[o.nodeName])if(3===o.nodeType){var y=o.nodeValue;if(o.nodeValue&&"LI"===o.parentNode.nodeName)if("OL"===o.parentNode.parentNode.nodeName)y=_+++". "+y;else{var b=s["font-size"],F=(3-.75*b)*i.pdf.internal.scaleFactor,w=.75*b*i.pdf.internal.scaleFactor,R=1.74*b/i.pdf.internal.scaleFactor;d=function(t,e){this.pdf.circle(t+F,e+w,R,"FD")}}16&o.ownerDocument.body.compareDocumentPosition(o)&&i.addText(y,s)}else"string"==typeof o&&i.addText(o,s);else{var C;if("IMG"===o.nodeName){var P=o.getAttribute("src");C=m[i.pdf.sHashCode&&i.pdf.sHashCode(P)||P]}if(C){i.pdf.internal.pageSize.getHeight()-i.pdf.margins_doc.bottom<i.y+o.height&&i.y>i.pdf.margins_doc.top&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top,i.executeWatchFunctions(o));var E=l(o),O=i.x,S=12/i.pdf.internal.scaleFactor,L=(E["margin-left"]+E["padding-left"])*S,B=(E["margin-right"]+E["padding-right"])*S,A=(E["margin-top"]+E["padding-top"])*S,N=(E["margin-bottom"]+E["padding-bottom"])*S;void 0!==E.float&&"right"===E.float?O+=i.settings.width-o.width-B:O+=L,i.pdf.addImage(C,O,i.y+A,o.width,o.height),C=void 0,"right"===E.float||"left"===E.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t,i.settings.width+=n,!0):!!(r&&1===r.nodeType&&!T[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t,i.y=e,i.settings.width+=n,!0)}.bind(this,"left"===E.float?-o.width-L-B:0,i.y+o.height+A+N,o.width)),i.watchFunctions.push(function(t,e,n){return!(i.y<t&&e===i.pdf.internal.getNumberOfPages())||1===n.nodeType&&"both"===l(n).clear&&(i.y=t,!0)}.bind(this,i.y+o.height,i.pdf.internal.getNumberOfPages())),i.settings.width-=o.width+L+B,"left"===E.float&&(i.x+=o.width+L+B)):i.y+=o.height+A+N}else if("TABLE"===o.nodeName)i.pdf.autoTable?(i.y+=10,i.pdf.autoTable({theme:"grid",html:o,startY:i.y,styles:{font:i.pdf.getFont().fontName,fontSize:i.pdf.getFontSize(),textColor:i.pdf.getTextColor()},margin:{top:i.pdf.margins_doc.top,left:i.x,right:i.pdf.internal.pageSize.getWidth()-(i.x+i.settings.width),bottom:i.pdf.margins_doc.bottom}}),i.y=i.pdf.lastAutoTable.finalY):(f=x(o,i),i.y+=10,i.pdf.table(i.x,i.y,f.rows,f.headers,{autoSize:!1,printHeaders:r.printHeaders,margins:i.pdf.margins_doc,css:l(o)}),i.y=i.pdf.internal.__cell__.lastCell.y+i.pdf.internal.__cell__.lastCell.height);else if("OL"===o.nodeName||"UL"===o.nodeName)_=1,g(o,i,r)||n(o,i,r),i.y+=10;else if("LI"===o.nodeName){var I=i.x;i.x+=20/i.pdf.internal.scaleFactor,i.y+=3,g(o,i,r)||n(o,i,r),i.x=I}else"BR"===o.nodeName?(i.y+=s["font-size"]*i.pdf.internal.scaleFactor,i.addText("\u2028",e(s))):g(o,i,r)||n(o,i,r)}}c++}if(r.outY=i.y,u)return i.setBlockBoundary(d)},m={},v=function(t,e,n,i){function r(){e.pdf.internal.events.publish("imagesLoaded"),i(a)}function o(t,n,i){if(t){var o=new Image;a=++l,o.crossOrigin="",o.onerror=o.onload=function(){if(o.complete&&(0===o.src.indexOf("data:image/")&&(o.width=n||o.width||0,o.height=i||o.height||0),o.width+o.height)){var a=e.pdf.sHashCode&&e.pdf.sHashCode(t)||t;m[a]=m[a]||o}--l||r()},o.src=t}}for(var a,s=t.getElementsByTagName("img"),c=s.length,l=0;c--;)o(s[c].getAttribute("src"),s[c].width,s[c].height);return l||r()},y=function(t,e,i){var r=t.getElementsByTagName("footer");if(r.length>0){r=r[0];var o=e.pdf.internal.write,a=e.y;e.pdf.internal.write=function(){},n(r,e,i);var s=Math.ceil(e.y-a)+5;e.y=a,e.pdf.internal.write=o,e.pdf.margins_doc.bottom+=s;for(var c=function(t){var o=void 0!==t?t.pageNumber:1,a=e.y;e.y=e.pdf.internal.pageSize.getHeight()-e.pdf.margins_doc.bottom,e.pdf.margins_doc.bottom-=s;for(var c=r.getElementsByTagName("span"),l=0;l<c.length;++l)(" "+c[l].className+" ").replace(/[\n\t]/g," ").indexOf(" pageCounter ")>-1&&(c[l].innerHTML=o),(" "+c[l].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&(c[l].innerHTML="###jsPDFVarTotalPages###");n(r,e,i),e.pdf.margins_doc.bottom+=s,e.y=a},l=r.getElementsByTagName("span"),u=0;u<l.length;++u)(" "+l[u].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&e.pdf.internal.events.subscribe("htmlRenderingFinished",e.pdf.putTotalPages.bind(e.pdf,"###jsPDFVarTotalPages###"),!0);e.pdf.internal.events.subscribe("addPage",c,!1),c(),T.FOOTER=1}},b=function(t,e,r,o,a,s){if(!e)return!1;"string"==typeof e||e.parentNode||(e=""+e.innerHTML),"string"==typeof e&&(e=function(t){var e,n,i,r;return i="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),r="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",n=document.createElement("div"),n.className="sjs-pdf-hidden-html-div",n.style.cssText=r,n.innerHTML='<iframe style="height:1px;width:1px" name="'+i+'" />',document.body.appendChild(n),e=window.frames[i],e.document.open(),e.document.writeln(t),e.document.close(),e.document.body}(e.replace(/<\/?script[^>]*?>/gi,"")));for(var c=Object.keys(t.getFontList()),l=0;l<c.length;++l){var u=c[l],f=u.toLowerCase();i[f]||(i[f]=u)}var d,p=new h(t,r,o,a);return v.call(this,e,p,a.elementHandlers,function(t){y(e,p,a.elementHandlers),n(e,p,a.elementHandlers),p.pdf.internal.events.publish("htmlRenderingFinished"),d=p.dispose(),"function"==typeof s?s(d):t&&console.error("jsPDF Warning: rendering issues? provide a callback to fromHTML!")}),d||{x:p.x,y:p.y}},h.prototype.init=function(){return this.paragraph={text:[],style:[]},this.pdf.internal.write("q")},h.prototype.dispose=function(){return this.pdf.internal.write("Q"),{x:this.x,y:this.y,ready:!0}},h.prototype.executeWatchFunctions=function(t){var e=!1,n=[];if(this.watchFunctions.length>0){for(var i=0;i<this.watchFunctions.length;++i)!0===this.watchFunctions[i](t)?e=!0:n.push(this.watchFunctions[i]);this.watchFunctions=n}return e},h.prototype.splitFragmentsIntoLines=function(t,n){var i,r,o,a,s,c,l,u,h,f,d,p,g,m,v;for(r=12,d=this.pdf.internal.scaleFactor,s={},o=void 0,f=void 0,a=void 0,c=void 0,v=void 0,h=void 0,u=void 0,l=void 0,p=[],g=[p],i=0,m=this.settings.width;t.length;)if(c=t.shift(),v=n.shift(),c)if(o=v["font-family"],f=v["font-style"],a=s[o+f],a||(a=this.pdf.internal.getFont(o,f).metadata.Unicode,s[o+f]=a),h={widths:a.widths,kerning:a.kerning,fontSize:v["font-size"]*r,textIndent:i},u=this.pdf.getStringUnitWidth(c,h)*h.fontSize/d,"\u2028"==c)p=[],g.push(p);else if(i+u>m){for(l=this.pdf.splitTextToSize(c,m,h),p.push([l.shift(),v]);l.length;)p=[[l.shift(),v]],g.push(p);i=this.pdf.getStringUnitWidth(p[0][0],h)*h.fontSize/d}else p.push([c,v]),i+=u;if(void 0!==v["text-align"]&&("center"===v["text-align"]||"right"===v["text-align"]||"justify"===v["text-align"]))for(var y=0;y<g.length;++y){var b=this.pdf.getStringUnitWidth(g[y][0][0],h)*h.fontSize/d;y>0&&(g[y][0][1]=e(g[y][0][1]));var x=m-b;if("right"===v["text-align"])g[y][0][1]["margin-left"]=x;else if("center"===v["text-align"])g[y][0][1]["margin-left"]=x/2;else if("justify"===v["text-align"]){var T=g[y][0][0].split(" ").length-1;g[y][0][1]["word-spacing"]=x/T,y===g.length-1&&(g[y][0][1]["word-spacing"]=0)}}return g},h.prototype.RenderTextFragment=function(t,e){var n,i,r;if(r=0,n=12,this.pdf.internal.pageSize.getHeight()-this.pdf.margins_doc.bottom<this.y+this.pdf.internal.getFontSize()){this.pdf.internal.write("ET","Q","Q");const o=this.pdf.getCurrentPageInfo().pageNumber;this.pdf.getNumberOfPages()===o?this.pdf.addPage():this.pdf.setPage(o+1),this.y=this.pdf.margins_doc.top,this.pdf.internal.write("q","q","BT",this.getPdfColor(e.color),this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td"),r=Math.max(r,e["line-height"],e["font-size"]),this.pdf.internal.write(0,(-1*n*r).toFixed(2),"Td")}i=this.pdf.internal.getFont(e["font-family"],e["font-style"]);var a=this.getPdfColor(e.color);a!==this.lastTextColor&&(this.pdf.internal.write(a),this.lastTextColor=a),void 0!==e["word-spacing"]&&e["word-spacing"]>0&&this.pdf.internal.write(e["word-spacing"].toFixed(2),"Tw");var s=function(t,e){for(var n,i=e.metadata.Unicode.widths,r=["","0","00","000","0000"],o=[""],a=0,s=t.length;a<s;++a){if(n=e.metadata.characterToGlyph(t.charCodeAt(a)),e.metadata.glyIdsUsed.push(n),e.metadata.toUnicode[n]=t.charCodeAt(a),-1==i.indexOf(n)&&(i.push(n),i.push([parseInt(e.metadata.widthOfGlyph(n),10)])),"0"==n)return o.join("");n=n.toString(16),o.push(r[4-n.length],n)}return o.join("")},c=function(t,e){var n,t=t||"",i="",r=0,o="",a=e.encoding;if("Identity-H"!==e.encoding)return t;for(o=t,r=0;r<o.length;r+=1)e.metadata.hasOwnProperty("cmap")&&(n=e.metadata.cmap.unicode.codeMap[o[r].charCodeAt(0)]),n?i+=o[r]:o[r].charCodeAt(0)<256&&e.metadata.hasOwnProperty("Unicode")?i+=o[r]:i+="";var c="";return parseInt(e.id.slice(1))<14||"WinAnsiEncoding"===a?c=this.pdf.internal.pdfEscape(i,key).split("").map(function(t){return t.charCodeAt(0).toString(16)}).join(""):"Identity-H"===a&&(c=s(i,e)),c},l="";l="Identity-H"!==i.encoding?"("+this.pdf.internal.pdfEscape(t)+")":"<"+c(t,i)+">",this.pdf.internal.write("/"+i.id,(n*e["font-size"]).toFixed(2),"Tf",l+" Tj"),void 0!==e["word-spacing"]&&this.pdf.internal.write(0,"Tw")},h.prototype.getPdfColor=function(t){var e,n,i,r=/rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+\s*)\)/,o=r.exec(t);if(null!=o)e=parseInt(o[1]),n=parseInt(o[2]),i=parseInt(o[3]);else{if("string"==typeof t&&"#"!=t.charAt(0)){var a=new RGBColor(t);t=a.ok?a.toHex():"#000000"}e=t.substring(1,3),e=parseInt(e,16),n=t.substring(3,5),n=parseInt(n,16),i=t.substring(5,7),i=parseInt(i,16)}if("string"==typeof e&&/^#[0-9A-Fa-f]{6}$/.test(e)){var s=parseInt(e.substr(1),16);e=s>>16&255,n=s>>8&255,i=255&s}var c=this.f3;return 0===e&&0===n&&0===i||void 0===n?c(e/255)+" g":[c(e/255),c(n/255),c(i/255),"rg"].join(" ")},h.prototype.f3=function(t){return t.toFixed(3)},h.prototype.renderParagraph=function(t){var e,n,i,r,o,a,s,c,l,h,f,d,p,g;if(r=u(this.paragraph.text),p=this.paragraph.style,e=this.paragraph.blockstyle,this.paragraph.priorblockstyle||{},this.paragraph={text:[],style:[],blockstyle:{},priorblockstyle:e},r.join("").trim()){c=this.splitFragmentsIntoLines(r,p),s=void 0,l=void 0,n=12,i=n/this.pdf.internal.scaleFactor,this.priorMarginBottom=this.priorMarginBottom||0,d=(Math.max((e["margin-top"]||0)-this.priorMarginBottom,0)+(e["padding-top"]||0))*i,f=((e["margin-bottom"]||0)+(e["padding-bottom"]||0))*i,this.priorMarginBottom=e["margin-bottom"]||0,"always"===e["page-break-before"]&&(this.pdf.addPage(),this.y=0,d=((e["margin-top"]||0)+(e["padding-top"]||0))*i),h=this.pdf.internal.write,o=void 0,a=void 0,this.y+=d,h("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td");for(var m=0;c.length;){for(s=c.shift(),l=0,o=0,a=s.length;o!==a;)s[o][0].trim()&&(l=Math.max(l,s[o][1]["line-height"],s[o][1]["font-size"]),g=7*s[o][1]["font-size"]),o++;var v=0,y=0;void 0!==s[0][1]["margin-left"]&&s[0][1]["margin-left"]>0&&(y=this.pdf.internal.getCoordinateString(s[0][1]["margin-left"]),v=y-m,m=y);var b=Math.max(e["margin-left"]||0,0)*i;for(h(v+b,(-1*n*l).toFixed(2),"Td"),o=0,a=s.length;o!==a;)s[o][0]&&this.RenderTextFragment(s[o][0],s[o][1]),o++;if(this.y+=l*i,this.executeWatchFunctions(s[0][1])&&c.length>0){var x=[],T=[];c.forEach(function(t){for(var e=0,n=t.length;e!==n;)t[e][0]&&(x.push(t[e][0]+" "),T.push(t[e][1])),++e}),c=this.splitFragmentsIntoLines(u(x),T),h("ET","Q"),h("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td")}}return t&&"function"==typeof t&&t.call(this,this.x-9,this.y-g/2),h("ET","Q"),this.y+=f}},h.prototype.setBlockBoundary=function(t){return this.renderParagraph(t)},h.prototype.setBlockStyle=function(t){return this.paragraph.blockstyle=t},h.prototype.addText=function(t,e){return this.paragraph.text.push(t),this.paragraph.style.push(e)},i={helvetica:"helvetica","sans-serif":"helvetica","times new roman":"times",serif:"times",times:"times",monospace:"courier",courier:"courier"},a={100:"normal",200:"normal",300:"normal",400:"normal",500:"bold",600:"bold",700:"bold",800:"bold",900:"bold",normal:"normal",bold:"bold",bolder:"bold",lighter:"normal"},r={normal:"normal",italic:"italic",oblique:"italic"},o={left:"left",right:"right",center:"center",justify:"justify"},s={none:"none",right:"right",left:"left"},c={none:"none",both:"both"},p={normal:1},t.fromHTML=function(t,e,n,i,r,o){return this.margins_doc=o||{top:0,bottom:0},i||(i={}),i.elementHandlers||(i.elementHandlers={}),b(this,t,isNaN(e)?4:e,isNaN(n)?4:n,i,r)}}(i.jsPDF.API)}])});
1
+ /*! For license information please see survey.pdf.min.js.LICENSE.txt */
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("survey-core"),require("jspdf")):"function"==typeof define&&define.amd?define("SurveyPDF",["survey-core","jspdf"],e):"object"==typeof exports?exports.SurveyPDF=e(require("survey-core"),require("jspdf")):t.SurveyPDF=e(t.Survey,t.jspdf)}(self,((t,e)=>(()=>{var n={400:(t,e,n)=>{"use strict";var i=n(833);function r(t){return void 0===t?-1:t.height}var o=function(){function t(t,e){this.intervalTree=t,this.records=[],this.height=0,this.key=e.low,this.max=e.high,this.records.push(e)}return t.prototype.getNodeHigh=function(){for(var t=this.records[0].high,e=1;e<this.records.length;e++)this.records[e].high>t&&(t=this.records[e].high);return t},t.prototype.updateHeight=function(){this.height=Math.max(r(this.left),r(this.right))+1},t.prototype.updateMaxOfParents=function(){if(void 0!==this){var t=this.getNodeHigh();void 0!==this.left&&void 0!==this.right?this.max=Math.max(Math.max(this.left.max,this.right.max),t):void 0!==this.left&&void 0===this.right?this.max=Math.max(this.left.max,t):void 0===this.left&&void 0!==this.right?this.max=Math.max(this.right.max,t):this.max=t,this.parent&&this.parent.updateMaxOfParents()}},t.prototype._updateMaxAfterRightRotate=function(){var t=this.parent,e=t.left,n=e.getNodeHigh();void 0===e.left&&void 0!==e.right?e.max=Math.max(n,e.right.max):void 0!==e.left&&void 0===e.right?e.max=Math.max(n,e.left.max):void 0===e.left&&void 0===e.right?e.max=n:e.max=Math.max(Math.max(e.left.max,e.right.max),n);var i=this.getNodeHigh();void 0===this.left&&void 0!==this.right?this.max=Math.max(i,this.right.max):void 0!==this.left&&void 0===this.right?this.max=Math.max(i,this.left.max):void 0===this.left&&void 0===this.right?this.max=i:this.max=Math.max(Math.max(this.left.max,this.right.max),i),t.max=Math.max(Math.max(t.left.max,t.right.max),t.getNodeHigh())},t.prototype._updateMaxAfterLeftRotate=function(){var t=this.parent,e=t.right,n=e.getNodeHigh();void 0===e.left&&void 0!==e.right?e.max=Math.max(n,e.right.max):void 0!==e.left&&void 0===e.right?e.max=Math.max(n,e.left.max):void 0===e.left&&void 0===e.right?e.max=n:e.max=Math.max(Math.max(e.left.max,e.right.max),n);var i=this.getNodeHigh();void 0===this.left&&void 0!==this.right?this.max=Math.max(i,this.right.max):void 0!==this.left&&void 0===this.right?this.max=Math.max(i,this.left.max):void 0===this.left&&void 0===this.right?this.max=i:this.max=Math.max(Math.max(this.left.max,this.right.max),i),t.max=Math.max(Math.max(t.left.max,e.max),t.getNodeHigh())},t.prototype._leftRotate=function(){var t=this.right;t.parent=this.parent,void 0===t.parent?this.intervalTree.root=t:t.parent.left===this?t.parent.left=t:t.parent.right===this&&(t.parent.right=t),this.right=t.left,void 0!==this.right&&(this.right.parent=this),t.left=this,this.parent=t,this.updateHeight(),t.updateHeight()},t.prototype._rightRotate=function(){var t=this.left;t.parent=this.parent,void 0===t.parent?this.intervalTree.root=t:t.parent.left===this?t.parent.left=t:t.parent.right===this&&(t.parent.right=t),this.left=t.right,void 0!==this.left&&(this.left.parent=this),t.right=this,this.parent=t,this.updateHeight(),t.updateHeight()},t.prototype._rebalance=function(){if(r(this.left)>=2+r(this.right)){var t=this.left;r(t.left)>=r(t.right)?(this._rightRotate(),this._updateMaxAfterRightRotate()):(t._leftRotate(),this._rightRotate(),this._updateMaxAfterRightRotate())}else if(r(this.right)>=2+r(this.left)){var e=this.right;r(e.right)>=r(e.left)?(this._leftRotate(),this._updateMaxAfterLeftRotate()):(e._rightRotate(),this._leftRotate(),this._updateMaxAfterLeftRotate())}},t.prototype.insert=function(e){e.low<this.key?void 0===this.left?(this.left=new t(this.intervalTree,e),this.left.parent=this):this.left.insert(e):void 0===this.right?(this.right=new t(this.intervalTree,e),this.right.parent=this):this.right.insert(e),this.max<e.high&&(this.max=e.high),this.updateHeight(),this._rebalance()},t.prototype._getOverlappingRecords=function(t,e,n){if(t.key<=n&&e<=t.getNodeHigh()){for(var i=[],r=0;r<t.records.length;r++)t.records[r].high>=e&&i.push(t.records[r]);return i}return[]},t.prototype.search=function(t,e){if(void 0===this)return[];var n,i=[],r=[];return t>this.max?[]:(void 0!==this.left&&this.left.max>=t&&(i=this.left.search(t,e)),n=this._getOverlappingRecords(this,t,e),e<this.key?i.concat(n):(void 0!==this.right&&(r=this.right.search(t,e)),i.concat(n,r)))},t.prototype.searchExisting=function(t){if(void 0!==this){if(this.key===t)return this;if(t<this.key){if(void 0!==this.left)return this.left.searchExisting(t)}else if(void 0!==this.right)return this.right.searchExisting(t)}},t.prototype._minValue=function(){return void 0===this.left?this:this.left._minValue()},t.prototype.remove=function(t){var e=this.parent;if(t.key<this.key)return void 0!==this.left?this.left.remove(t):void 0;if(t.key>this.key)return void 0!==this.right?this.right.remove(t):void 0;if(void 0!==this.left&&void 0!==this.right){var n=this.right._minValue();return this.key=n.key,this.records=n.records,this.right.remove(this)}return e.left===this?(void 0!==this.right?(e.left=this.right,this.right.parent=e):(e.left=this.left,void 0!==this.left&&(this.left.parent=e)),e.updateMaxOfParents(),e.updateHeight(),e._rebalance(),this):e.right===this?(void 0!==this.right?(e.right=this.right,this.right.parent=e):(e.right=this.left,void 0!==this.left&&(this.left.parent=e)),e.updateMaxOfParents(),e.updateHeight(),e._rebalance(),this):void 0},t}(),s=function(){function t(){this.count=0}return t.prototype.insert=function(t){if(t.low>t.high)throw new Error("`low` value must be lower or equal to `high` value");if(void 0===this.root)return this.root=new o(this,t),this.count++,!0;var e=this.root.searchExisting(t.low);if(void 0!==e){for(var n=0;n<e.records.length;n++)if(i(e.records[n],t))return!1;return e.records.push(t),t.high>e.max&&(e.max=t.high,e.parent&&e.parent.updateMaxOfParents()),this.count++,!0}return this.root.insert(t),this.count++,!0},t.prototype.search=function(t,e){return void 0===this.root?[]:this.root.search(t,e)},t.prototype.remove=function(t){if(void 0===this.root)return!1;var e=this.root.searchExisting(t.low);if(void 0===e)return!1;if(e.records.length>1){for(var n=void 0,r=0;r<e.records.length;r++)if(i(e.records[r],t)){n=e.records[r],e.records.splice(r,1);break}if(n){if(n=void 0,t.high===e.max){var s=e.getNodeHigh();void 0!==e.left&&void 0!==e.right?e.max=Math.max(Math.max(e.left.max,e.right.max),s):void 0!==e.left&&void 0===e.right?e.max=Math.max(e.left.max,s):void 0===e.left&&void 0!==e.right?e.max=Math.max(e.right.max,s):e.max=s,e.parent&&e.parent.updateMaxOfParents()}return this.count--,!0}return!1}if(1===e.records.length){if(i(e.records[0],t)){if(this.root.key===e.key){var a=new o(this,{low:t.low,high:t.low});a.left=this.root,this.root.parent=a;var l=this.root.remove(e);return this.root=a.left,void 0!==this.root&&(this.root.parent=void 0),!!l&&(l=void 0,this.count--,!0)}return!!(l=this.root.remove(e))&&(l=void 0,this.count--,!0)}return!1}return!1},t.prototype.inOrder=function(){return new l(this.root)},t.prototype.preOrder=function(){return new c(this.root)},t}(),a=function(){function t(){this.tree=new s}return t.prototype.insert=function(t,e,n){return this.tree.insert({low:t,high:e,data:n})},t.prototype.remove=function(t,e,n){return this.tree.remove({low:t,high:e,data:n})},t.prototype.search=function(t,e){return this.tree.search(t,e).map((function(t){return t.data}))},t.prototype.inOrder=function(){return this.tree.inOrder()},t.prototype.preOrder=function(){return this.tree.preOrder()},Object.defineProperty(t.prototype,"count",{get:function(){return this.tree.count},enumerable:!0,configurable:!0}),t}();e.Ay=a;var l=function(){function t(t){this.stack=[],void 0!==t&&this.push(t)}return t.prototype.next=function(){return void 0===this.currentNode?{done:!0,value:void 0}:this.i<this.currentNode.records.length?{done:!1,value:this.currentNode.records[this.i++]}:(void 0!==this.currentNode.right?this.push(this.currentNode.right):this.pop(),this.next())},t.prototype.push=function(t){for(this.currentNode=t,this.i=0;void 0!==this.currentNode.left;)this.stack.push(this.currentNode),this.currentNode=this.currentNode.left},t.prototype.pop=function(){this.currentNode=this.stack.pop(),this.i=0},t}();"function"==typeof Symbol&&(l.prototype[Symbol.iterator]=function(){return this});var c=function(){function t(t){this.stack=[],this.i=0,this.currentNode=t}return t.prototype.next=function(){return void 0===this.currentNode?{done:!0,value:void 0}:this.i<this.currentNode.records.length?{done:!1,value:this.currentNode.records[this.i++]}:(void 0!==this.currentNode.right&&this.push(this.currentNode.right),void 0!==this.currentNode.left&&this.push(this.currentNode.left),this.pop(),this.next())},t.prototype.push=function(t){this.stack.push(t)},t.prototype.pop=function(){this.currentNode=this.stack.pop(),this.i=0},t}();"function"==typeof Symbol&&(c.prototype[Symbol.iterator]=function(){return this})},833:t=>{t.exports=function(t,e,n,i){var r=n?n.call(i,t,e):void 0;if(void 0!==r)return!!r;if(t===e)return!0;if("object"!=typeof t||!t||"object"!=typeof e||!e)return!1;var o=Object.keys(t),s=Object.keys(e);if(o.length!==s.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(e),l=0;l<o.length;l++){var c=o[l];if(!a(c))return!1;var h=t[c],u=e[c];if(!1===(r=n?n.call(i,h,u,c):void 0)||void 0===r&&h!==u)return!1}return!0}},626:(t,e,n)=>{!function(t,e){"use strict";var n,i=t.API,r=1;function o(t){for(var e="",n=0;n<t.length;n++){for(var i=t.charCodeAt(n).toString(16).toUpperCase();i.length<4;)i="0"+i;e+=i}return"<FEFF"+e+">"}var s=function(t){return t.replace(/\\/g,"\\\\").replace(/\(/g,"\\(").replace(/\)/g,"\\)")},a=function(t){return t.replace(/\\\\/g,"\\").replace(/\\\(/g,"(").replace(/\\\)/g,")")},l=function(t){return t.toFixed(2)},c=function(t){return t.toFixed(5)};i.__acroform__={};var h=function(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t},u=function(t){return t*r},f=function(t){return t/r},d=function(t){var e=new M,n=K.internal.getHeight(t)||0,i=K.internal.getWidth(t)||0;return e.BBox=[0,0,Number(l(i)),Number(l(n))],e},p=i.__acroform__.setBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");return t|1<<e},g=i.__acroform__.clearBit=function(t,e){if(t=t||0,e=e||0,isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");return t&~(1<<e)},m=i.__acroform__.getBit=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");return t&1<<e?1:0},y=i.__acroform__.getBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");return m(t,e-1)},v=i.__acroform__.setBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");return p(t,e-1)},b=i.__acroform__.clearBitForPdf=function(t,e){if(isNaN(t)||isNaN(e))throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");return g(t,e-1)},x=i.__acroform__.calculateCoordinates=function(t){var e=this.internal.getHorizontalCoordinate,n=this.internal.getVerticalCoordinate,i=t[0],r=t[1],o=t[2],s=t[3],a={};return a.lowerLeft_X=e(i)||0,a.lowerLeft_Y=n(r+s)||0,a.upperRight_X=e(i+o)||0,a.upperRight_Y=n(r)||0,[Number(l(a.lowerLeft_X)),Number(l(a.lowerLeft_Y)),Number(l(a.upperRight_X)),Number(l(a.upperRight_Y))]},T=function(t){if(t.appearanceStreamContent)return t.appearanceStreamContent;if(t.V||t.DV){var e=[],i=t.V||t.DV,r=F(t,i),o=n.internal.getFont(t.fontName,t.fontStyle).id;e.push("/Tx BMC"),e.push("q"),e.push("BT"),e.push(n.__private__.encodeColorString(t.color)),e.push("/"+o+" "+l(r.fontSize)+" Tf"),e.push("1 0 0 1 0 0 Tm"),e.push(r.text),e.push("ET"),e.push("Q"),e.push("EMC");var s=new d(t);return s.stream=e.join("\n"),s}},F=function(t,e){t.isUnicode&&(e=t.trueValue);var i=0===t.fontSize?t.maxFontSize:t.fontSize,r={text:"",fontSize:""},o=(e=")"==(e="("==e.substr(0,1)?e.substr(1):e).substr(e.length-1)?e.substr(0,e.length-1):e).split(" ");o=o.map((function(t){return t.split("\n")})),t.multiline||(o=o.map((function(t){return[t.join(" ")]})));var a=i,c=K.internal.getHeight(t)||0;c=c<0?-c:c;var h=K.internal.getWidth(t)||0;h=h<0?-h:h;var u=function(e,n,i){if(e+1<o.length){var r=n+" "+o[e+1][0];return _(r,t,i).width<=h-4}return!1};a++;t:for(;a>0;){e="",a--;var f,d,p=_("3",t,a).height,g=t.multiline?c-a:(c-p)/2,m=g+=2,y=0,v=0,b=0;if(a<=0){e="(...) Tj\n",e+="% Width of Text: "+_(e,t,a=12).width+", FieldWidth:"+h+"\n";break}for(var x="",T=0,F=0;F<o.length;F++)if(o.hasOwnProperty(F)){var w=!1;if(1!==o[F].length&&b!==o[F].length-1){if((p+2)*(T+2)+2>c)continue t;x+=o[F][b],w=!0,v=F,F--}else{x=" "==(x+=o[F][b]+" ").substr(x.length-1)?x.substr(0,x.length-1):x;var R=parseInt(F),C=u(R,x,a),P=F>=o.length-1;if(C&&!P){x+=" ",b=0;continue}if(C||P){if(P)v=R;else if(t.multiline&&(p+2)*(T+2)+2>c)continue t}else{if(!t.multiline)continue t;if((p+2)*(T+2)+2>c)continue t;v=R}}for(var E="",O=y;O<=v;O++){var S=o[O];if(t.multiline){if(O===v){E+=S[b]+" ",b=(b+1)%S.length;continue}if(O===y){E+=S[S.length-1]+" ";continue}}E+=S[0]+" "}switch(E=" "==E.substr(E.length-1)?E.substr(0,E.length-1):E,d=_(E,t,a).width,t.textAlign){case"right":f=h-d-2;break;case"center":f=(h-d)/2;break;default:f=2}if(e+=l(f)+" "+l(m)+" Td\n",t.isUnicode){var L={};L[n.internal.getFont().id]=n.internal.getFont();var B={text:E,x:null,y:null,options:{lang:null},mutex:{pdfEscape:s,activeFontKey:n.internal.getFont().id,fonts:L,activeFontSize:t.fontSize}};n.internal.events.publish("postProcessText",B),e+="<"+B.text+"> Tj\n"}else e+="("+s(E)+") Tj\n";e+=-l(f)+" 0 Td\n",m=-(a+2),d=0,y=w?v:v+1,T++,x=""}break}return r.text=e,r.fontSize=a,r},_=function(t,e,i){var r=n.internal.getFont(e.fontName,e.fontStyle),o=n.getStringUnitWidth(t,{font:r,fontSize:parseFloat(i),charSpace:0})*parseFloat(i);return{height:n.getStringUnitWidth("3",{font:r,fontSize:parseFloat(i),charSpace:0})*parseFloat(i)*1.5,width:o}},w={fields:[],xForms:[],acroFormDictionaryRoot:null,printedOut:!1,internal:null,isInitialized:!1},R=function(){n.internal.acroformPlugin.acroFormDictionaryRoot.objId=void 0;var t=n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;for(var e in t)if(t.hasOwnProperty(e)){var i=t[e];i.objId=void 0,i.hasAnnotation&&P.call(n,i)}},C=function(t){n.internal.acroformPlugin.printedOut&&(n.internal.acroformPlugin.printedOut=!1,n.internal.acroformPlugin.acroFormDictionaryRoot=null),n.internal.acroformPlugin.acroFormDictionaryRoot||B.call(n),n.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t)},P=function(t){var e={type:"reference",object:t};void 0===n.internal.getPageInfo(t.page).pageContext.annotations.find((function(t){return t.type===e.type&&t.object===e.object}))&&n.internal.getPageInfo(t.page).pageContext.annotations.push(e)},E=function(){if(void 0===n.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("putCatalogCallback: Root missing.");n.internal.write("/AcroForm "+n.internal.acroformPlugin.acroFormDictionaryRoot.objId+" 0 R")},O=function(){n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID),delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID,n.internal.acroformPlugin.printedOut=!0},S=function(t){var e=!t;for(var i in t||(n.internal.newObjectDeferredBegin(n.internal.acroformPlugin.acroFormDictionaryRoot.objId,!0),n.internal.acroformPlugin.acroFormDictionaryRoot.putStream()),t=t||n.internal.acroformPlugin.acroFormDictionaryRoot.Kids)if(t.hasOwnProperty(i)){var r=t[i],o=[],s=r.Rect;if(r.Rect&&(r.Rect=x.call(this,r.Rect)),n.internal.newObjectDeferredBegin(r.objId,!0),r.DA=K.createDefaultAppearanceStream(r),"object"==typeof r&&"function"==typeof r.getKeyValueListForStream&&(o=r.getKeyValueListForStream()),r.Rect=s,r.hasAppearanceStream&&!r.appearanceStreamContent){var a=T.call(this,r);o.push({key:"AP",value:"<</N "+a+">>"}),n.internal.acroformPlugin.xForms.push(a)}if(r.appearanceStreamContent){var l="";for(var c in r.appearanceStreamContent)if(r.appearanceStreamContent.hasOwnProperty(c)){var h=r.appearanceStreamContent[c];if(l+="/"+c+" ",l+="<<",Object.keys(h).length>=1||Array.isArray(h)){for(var i in h)if(h.hasOwnProperty(i)){var u=h[i];"function"==typeof u&&(u=u.call(this,r)),l+="/"+i+" "+u+" ",n.internal.acroformPlugin.xForms.indexOf(u)>=0||n.internal.acroformPlugin.xForms.push(u)}}else"function"==typeof(u=h)&&(u=u.call(this,r)),l+="/"+i+" "+u,n.internal.acroformPlugin.xForms.indexOf(u)>=0||n.internal.acroformPlugin.xForms.push(u);l+=">>"}o.push({key:"AP",value:"<<\n"+l+">>"})}n.internal.putStream({additionalKeyValues:o}),n.internal.out("endobj")}e&&L.call(this,n.internal.acroformPlugin.xForms)},L=function(t){for(var e in t)if(t.hasOwnProperty(e)){var i=e,r=t[e];n.internal.newObjectDeferredBegin(r&&r.objId,!0),"object"==typeof r&&"function"==typeof r.putStream&&r.putStream(),delete t[i]}},B=function(){if(void 0!==this.internal&&(void 0===this.internal.acroformPlugin||!1===this.internal.acroformPlugin.isInitialized)){if(n=this,W.FieldNum=0,this.internal.acroformPlugin=JSON.parse(JSON.stringify(w)),this.internal.acroformPlugin.acroFormDictionaryRoot)throw new Error("Exception while creating AcroformDictionary");r=n.internal.scaleFactor,n.internal.acroformPlugin.acroFormDictionaryRoot=new k,n.internal.acroformPlugin.acroFormDictionaryRoot._eventID=n.internal.events.subscribe("postPutResources",O),n.internal.events.subscribe("buildDocument",R),n.internal.events.subscribe("putCatalog",E),n.internal.events.subscribe("postPutPages",S),n.internal.acroformPlugin.isInitialized=!0}},A=i.__acroform__.arrayToPdfArray=function(t){if(Array.isArray(t)){for(var e="[",n=0;n<t.length;n++)switch(0!==n&&(e+=" "),typeof t[n]){case"boolean":case"number":case"object":e+=t[n].toString();break;case"string":"/"!==t[n].substr(0,1)?e+="("+s(t[n].toString())+")":e+=t[n].toString()}return e+"]"}throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray")},I=function(t){return(t=t||"").toString(),"("+s(t)+")"},N=function(){var t;Object.defineProperty(this,"objId",{configurable:!0,get:function(){return t||(t=n.internal.newObjectDeferred()),t},set:function(e){t=e}})};N.prototype.toString=function(){return this.objId+" 0 R"},N.prototype.putStream=function(){var t=this.getKeyValueListForStream();n.internal.putStream({data:this.stream,additionalKeyValues:t}),n.internal.out("endobj")},N.prototype.getKeyValueListForStream=function(){return function(t){var e=[],n=Object.getOwnPropertyNames(t).filter((function(t){return"content"!=t&&"appearanceStreamContent"!=t&&"_"!=t.substring(0,1)}));for(var i in n){var r=Object.getOwnPropertyDescriptor(t,n[i]);if(r&&!1===r.configurable){var o=n[i],s=t[o];s&&(Array.isArray(s)?e.push({key:o,value:A(s)}):s instanceof N?e.push({key:o,value:s.objId+" 0 R"}):"function"!=typeof s&&e.push({key:o,value:s}))}}return e}(this)};var M=function(){N.call(this),Object.defineProperty(this,"Type",{value:"/XObject",configurable:!1,writeable:!0}),Object.defineProperty(this,"Subtype",{value:"/Form",configurable:!1,writeable:!0}),Object.defineProperty(this,"FormType",{value:1,configurable:!1,writeable:!0});var t,e=[];Object.defineProperty(this,"BBox",{configurable:!1,writeable:!0,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"Resources",{value:"2 0 R",configurable:!1,writeable:!0}),Object.defineProperty(this,"stream",{enumerable:!1,configurable:!0,set:function(e){t=e.trim()},get:function(){return t||null}})};h(M,N);var k=function(){N.call(this);var t,e=[];Object.defineProperty(this,"Kids",{enumerable:!1,configurable:!0,get:function(){return e.length>0?e:void 0}}),Object.defineProperty(this,"Fields",{enumerable:!1,configurable:!1,get:function(){return e}}),Object.defineProperty(this,"DA",{enumerable:!1,configurable:!1,get:function(){if(t)return"("+t+")"},set:function(e){t=e}})};h(k,N);var W=function(){N.call(this);var t=4;this.isUnicode=!1,this.trueValue="",Object.defineProperty(this,"F",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){if(isNaN(e))throw new Error('Invalid value "'+e+'" for attribute F supplied.');t=e}}),Object.defineProperty(this,"showWhenPrinted",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(t,3))},set:function(e){!0===Boolean(e)?this.F=v(t,3):this.F=b(t,3)}});var e=0;Object.defineProperty(this,"Ff",{enumerable:!1,configurable:!1,get:function(){return e},set:function(t){if(isNaN(t))throw new Error('Invalid value "'+t+'" for attribute Ff supplied.');e=t}});var n=[];Object.defineProperty(this,"Rect",{enumerable:!1,configurable:!1,get:function(){if(0!==n.length)return n},set:function(t){n=void 0!==t?t:[]}}),Object.defineProperty(this,"x",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[0])?0:f(n[0])},set:function(t){n[0]=u(t)}}),Object.defineProperty(this,"y",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[1])?0:f(n[1])},set:function(t){n[1]=u(t)}}),Object.defineProperty(this,"width",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[2])?0:f(n[2])},set:function(t){n[2]=u(t)}}),Object.defineProperty(this,"height",{enumerable:!0,configurable:!0,get:function(){return!n||isNaN(n[3])?0:f(n[3])},set:function(t){n[3]=u(t)}});var i="";Object.defineProperty(this,"FT",{enumerable:!0,configurable:!1,get:function(){return i},set:function(t){switch(t){case"/Btn":case"/Tx":case"/Ch":case"/Sig":i=t;break;default:throw new Error('Invalid value "'+t+'" for attribute FT supplied.')}}});var r=null;Object.defineProperty(this,"T",{enumerable:!0,configurable:!1,get:function(){if(!r||r.length<1){if(this instanceof U)return;r="FieldObject"+W.FieldNum++}return"("+s(r)+")"},set:function(t){r=t.toString()}}),Object.defineProperty(this,"fieldName",{configurable:!0,enumerable:!0,get:function(){return r},set:function(t){r=t}});var l="helvetica";Object.defineProperty(this,"fontName",{enumerable:!0,configurable:!0,get:function(){return l},set:function(t){l=t}});var c="normal";Object.defineProperty(this,"fontStyle",{enumerable:!0,configurable:!0,get:function(){return c},set:function(t){c=t}});var h=0;Object.defineProperty(this,"fontSize",{enumerable:!0,configurable:!0,get:function(){return f(h)},set:function(t){h=u(t)}});var d=50;Object.defineProperty(this,"maxFontSize",{enumerable:!0,configurable:!0,get:function(){return f(d)},set:function(t){d=u(t)}});var p="black";Object.defineProperty(this,"color",{enumerable:!0,configurable:!0,get:function(){return p},set:function(t){p=t}});var g="/F1 0 Tf 0 g";Object.defineProperty(this,"DA",{enumerable:!0,configurable:!1,get:function(){if(!(!g||this instanceof U||this instanceof Y))return I(g)},set:function(t){t=t.toString(),g=t}});var m=null;Object.defineProperty(this,"DV",{enumerable:!1,configurable:!1,get:function(){if(m)return this instanceof z==0?I(m):m},set:function(t){t=t.toString(),m=this instanceof z==0?"("===t.substr(0,1)?a(t.substr(1,t.length-2)):a(t):t}}),Object.defineProperty(this,"defaultValue",{enumerable:!0,configurable:!0,get:function(){return this instanceof z==1?a(m.substr(1,m.length-1)):m},set:function(t){t=t.toString(),m=this instanceof z==1?"/"+t:t}});var x=null;Object.defineProperty(this,"V",{enumerable:!1,configurable:!1,get:function(){return this.isUnicode?x:x?this instanceof z==0?I(x):x:void 0},set:function(t){t=t.toString(),this.isUnicode?(x=o(t),this.trueValue=t):x=this instanceof z==0?"("===t.substr(0,1)?a(t.substr(1,t.length-2)):a(t):t}}),Object.defineProperty(this,"value",{enumerable:!0,configurable:!0,get:function(){return this instanceof z==1?a(x.substr(1,x.length-1)):x},set:function(t){t=t.toString(),x=this instanceof z==1?"/"+t:t}}),Object.defineProperty(this,"hasAnnotation",{enumerable:!0,configurable:!0,get:function(){return this.Rect}}),Object.defineProperty(this,"Type",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Annot":null}}),Object.defineProperty(this,"Subtype",{enumerable:!0,configurable:!1,get:function(){return this.hasAnnotation?"/Widget":null}});var T,F=!1;Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,writeable:!0,get:function(){return F},set:function(t){t=Boolean(t),F=t}}),Object.defineProperty(this,"page",{enumerable:!0,configurable:!0,writeable:!0,get:function(){if(T)return T},set:function(t){T=t}}),Object.defineProperty(this,"readOnly",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,1))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,1):this.Ff=b(this.Ff,1)}}),Object.defineProperty(this,"required",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,2))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,2):this.Ff=b(this.Ff,2)}}),Object.defineProperty(this,"noExport",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,3))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,3):this.Ff=b(this.Ff,3)}});var _=null;Object.defineProperty(this,"Q",{enumerable:!0,configurable:!1,get:function(){if(null!==_)return _},set:function(t){if(-1===[0,1,2].indexOf(t))throw new Error('Invalid value "'+t+'" for attribute Q supplied.');_=t}}),Object.defineProperty(this,"textAlign",{get:function(){var t;switch(_){case 0:default:t="left";break;case 1:t="center";break;case 2:t="right"}return t},configurable:!0,enumerable:!0,set:function(t){switch(t){case"right":case 2:_=2;break;case"center":case 1:_=1;break;default:_=0}}})};h(W,N);var H=function(){W.call(this),this.FT="/Ch",this.V="()",this.fontName="zapfdingbats";var t=0;Object.defineProperty(this,"TI",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}});var e="<< /BG [ 0.975 0.975 0.975 ] >>";Object.defineProperty(this,"MK",{enumerable:!0,configurable:!1,get:function(){return e},set:function(t){e=t}}),Object.defineProperty(this,"topIndex",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){t=e}});var n=[];Object.defineProperty(this,"Opt",{enumerable:!0,configurable:!1,get:function(){return this.isUnicode?function(t){for(var e="[ ",n=0;n<t.length;n++)e+=o(t[n]);return e+" ]"}(n):A(n)},set:function(t){var e,i;i=[],"string"==typeof(e=t)&&(i=function(t,e,n){n||(n=1);for(var i,r=[];i=e.exec(t);)r.push(i[n]);return r}(e,/\((.*?)\)/g)),n=i}}),this.getOptions=function(){return n},this.setOptions=function(t){n=t,this.sort&&n.sort()},this.addOption=function(t){t=(t=t||"").toString(),n.push(t),this.sort&&n.sort()},this.removeOption=function(t,e){for(e=e||!1,t=(t=t||"").toString();-1!==n.indexOf(t)&&(n.splice(n.indexOf(t),1),!1!==e););},Object.defineProperty(this,"combo",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,18))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,18):this.Ff=b(this.Ff,18)}}),Object.defineProperty(this,"edit",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,19))},set:function(t){!0===this.combo&&(!0===Boolean(t)?this.Ff=v(this.Ff,19):this.Ff=b(this.Ff,19))}}),Object.defineProperty(this,"sort",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,20))},set:function(t){!0===Boolean(t)?(this.Ff=v(this.Ff,20),n.sort()):this.Ff=b(this.Ff,20)}}),Object.defineProperty(this,"multiSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,22))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,22):this.Ff=b(this.Ff,22)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,23):this.Ff=b(this.Ff,23)}}),Object.defineProperty(this,"commitOnSelChange",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,27))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,27):this.Ff=b(this.Ff,27)}}),this.hasAppearanceStream=!1};h(H,W);var q=function(){H.call(this),this.fontName="helvetica",this.combo=!1};h(q,H);var D=function(){q.call(this),this.combo=!0};h(D,q);var j=function(){D.call(this),this.edit=!0};h(j,D);var z=function(){W.call(this),this.FT="/Btn",Object.defineProperty(this,"noToggleToOff",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,15))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,15):this.Ff=b(this.Ff,15)}}),Object.defineProperty(this,"radio",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,16))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,16):this.Ff=b(this.Ff,16)}}),Object.defineProperty(this,"pushButton",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,17))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,17):this.Ff=b(this.Ff,17)}}),Object.defineProperty(this,"radioIsUnison",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,26):this.Ff=b(this.Ff,26)}});var t,e={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){if(0!==Object.keys(e).length){var t,n=[];for(t in n.push("<<"),e)n.push("/"+t+" ("+e[t]+")");return n.push(">>"),n.join("\n")}},set:function(t){"object"==typeof t&&(e=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return e.CA||""},set:function(t){"string"==typeof t&&(e.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return t.substr(1,t.length-1)},set:function(e){t="/"+e}})};h(z,W);var G=function(){z.call(this),this.pushButton=!0};h(G,z);var V=function(){z.call(this),this.radio=!0,this.pushButton=!1;var t=[];Object.defineProperty(this,"Kids",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=void 0!==e?e:[]}})};h(V,z);var U=function(){var t,e;W.call(this),Object.defineProperty(this,"Parent",{enumerable:!1,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"optionName",{enumerable:!1,configurable:!0,get:function(){return e},set:function(t){e=t}});var n,i={};Object.defineProperty(this,"MK",{enumerable:!1,configurable:!1,get:function(){var t,e=[];for(t in e.push("<<"),i)e.push("/"+t+" ("+i[t]+")");return e.push(">>"),e.join("\n")},set:function(t){"object"==typeof t&&(i=t)}}),Object.defineProperty(this,"caption",{enumerable:!0,configurable:!0,get:function(){return i.CA||""},set:function(t){"string"==typeof t&&(i.CA=t)}}),Object.defineProperty(this,"AS",{enumerable:!1,configurable:!1,get:function(){return n},set:function(t){n=t}}),Object.defineProperty(this,"appearanceState",{enumerable:!0,configurable:!0,get:function(){return n.substr(1,n.length-1)},set:function(t){n="/"+t}}),this.caption="l",this.appearanceState="Off",this._AppearanceType=K.RadioButton.Circle,this.appearanceStreamContent=this._AppearanceType.createAppearanceStream(this.optionName)};h(U,W),V.prototype.setAppearance=function(t){if(!("createAppearanceStream"in t)||!("getCA"in t))throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");for(var e in this.Kids)if(this.Kids.hasOwnProperty(e)){var n=this.Kids[e];n.appearanceStreamContent=t.createAppearanceStream(n.optionName),n.caption=t.getCA()}},V.prototype.createOption=function(t){var e=new U;return e.Parent=this,e.optionName=t,this.Kids.push(e),Z.call(this,e),e};var Q=function(){z.call(this),this.fontName="zapfdingbats",this.caption="3",this.appearanceState="On",this.value="On",this.textAlign="center",this.appearanceStreamContent=K.CheckBox.createAppearanceStream()};h(Q,z);var Y=function(){W.call(this),this.FT="/Tx",Object.defineProperty(this,"multiline",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,13))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,13):this.Ff=b(this.Ff,13)}}),Object.defineProperty(this,"fileSelect",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,21))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,21):this.Ff=b(this.Ff,21)}}),Object.defineProperty(this,"doNotSpellCheck",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,23))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,23):this.Ff=b(this.Ff,23)}}),Object.defineProperty(this,"doNotScroll",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,24))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,24):this.Ff=b(this.Ff,24)}}),Object.defineProperty(this,"comb",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,25))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,25):this.Ff=b(this.Ff,25)}}),Object.defineProperty(this,"richText",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,26))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,26):this.Ff=b(this.Ff,26)}});var t=null;Object.defineProperty(this,"MaxLen",{enumerable:!0,configurable:!1,get:function(){return t},set:function(e){t=e}}),Object.defineProperty(this,"maxLength",{enumerable:!0,configurable:!0,get:function(){return t},set:function(e){Number.isInteger(e)&&(t=e)}}),Object.defineProperty(this,"hasAppearanceStream",{enumerable:!0,configurable:!0,get:function(){return this.V||this.DV}})};h(Y,W);var X=function(){Y.call(this),Object.defineProperty(this,"password",{enumerable:!0,configurable:!0,get:function(){return Boolean(y(this.Ff,14))},set:function(t){!0===Boolean(t)?this.Ff=v(this.Ff,14):this.Ff=b(this.Ff,14)}}),this.password=!0};h(X,Y);var K={CheckBox:{createAppearanceStream:function(){return{N:{On:K.CheckBox.YesNormal},D:{On:K.CheckBox.YesPushDown,Off:K.CheckBox.OffPushDown}}},YesPushDown:function(t){var e=new d(t),i=[],r=n.internal.getFont(t.fontName,t.fontStyle).id,o=n.__private__.encodeColorString(t.color),s=F(t,t.caption);return i.push("0.749023 g"),i.push("0 0 "+l(K.internal.getWidth(t))+" "+l(K.internal.getHeight(t))+" re"),i.push("f"),i.push("BMC"),i.push("q"),i.push("0 0 1 rg"),i.push("/"+r+" "+l(s.fontSize)+" Tf "+o),i.push("BT"),i.push(s.text),i.push("ET"),i.push("Q"),i.push("EMC"),e.stream=i.join("\n"),e},YesNormal:function(t){var e=new d(t),i=n.internal.getFont(t.fontName,t.fontStyle).id,r=n.__private__.encodeColorString(t.color),o=[],s=K.internal.getHeight(t),a=K.internal.getWidth(t),c=F(t,t.caption);return o.push("1 g"),o.push("0 0 "+l(a)+" "+l(s)+" re"),o.push("f"),o.push("q"),o.push("0 0 1 rg"),o.push("0 0 "+l(a-1)+" "+l(s-1)+" re"),o.push("W"),o.push("n"),o.push("0 g"),o.push("BT"),o.push("/"+i+" "+l(c.fontSize)+" Tf "+r),o.push(c.text),o.push("ET"),o.push("Q"),e.stream=o.join("\n"),e},OffPushDown:function(t){var e=new d(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+l(K.internal.getWidth(t))+" "+l(K.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}},RadioButton:{Circle:{createAppearanceStream:function(t){var e={D:{Off:K.RadioButton.Circle.OffPushDown},N:{}};return e.N[t]=K.RadioButton.Circle.YesNormal,e.D[t]=K.RadioButton.Circle.YesPushDown,e},getCA:function(){return"l"},YesNormal:function(t){var e=new d(t),n=[],i=K.internal.getWidth(t)<=K.internal.getHeight(t)?K.internal.getWidth(t)/4:K.internal.getHeight(t)/4;i=Number((.9*i).toFixed(5));var r=K.internal.Bezier_C,o=Number((i*r).toFixed(5));return n.push("q"),n.push("1 0 0 1 "+c(K.internal.getWidth(t)/2)+" "+c(K.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+o+" "+o+" "+i+" 0 "+i+" c"),n.push("-"+o+" "+i+" -"+i+" "+o+" -"+i+" 0 c"),n.push("-"+i+" -"+o+" -"+o+" -"+i+" 0 -"+i+" c"),n.push(o+" -"+i+" "+i+" -"+o+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=new d(t),n=[],i=K.internal.getWidth(t)<=K.internal.getHeight(t)?K.internal.getWidth(t)/4:K.internal.getHeight(t)/4,r=(i=Number((.9*i).toFixed(5)),Number((2*i).toFixed(5))),o=Number((r*K.internal.Bezier_C).toFixed(5)),s=Number((i*K.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+c(K.internal.getWidth(t)/2)+" "+c(K.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),n.push("0 g"),n.push("q"),n.push("1 0 0 1 "+c(K.internal.getWidth(t)/2)+" "+c(K.internal.getHeight(t)/2)+" cm"),n.push(i+" 0 m"),n.push(i+" "+s+" "+s+" "+i+" 0 "+i+" c"),n.push("-"+s+" "+i+" -"+i+" "+s+" -"+i+" 0 c"),n.push("-"+i+" -"+s+" -"+s+" -"+i+" 0 -"+i+" c"),n.push(s+" -"+i+" "+i+" -"+s+" "+i+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e},OffPushDown:function(t){var e=new d(t),n=[],i=K.internal.getWidth(t)<=K.internal.getHeight(t)?K.internal.getWidth(t)/4:K.internal.getHeight(t)/4;i=Number((.9*i).toFixed(5));var r=Number((2*i).toFixed(5)),o=Number((r*K.internal.Bezier_C).toFixed(5));return n.push("0.749023 g"),n.push("q"),n.push("1 0 0 1 "+c(K.internal.getWidth(t)/2)+" "+c(K.internal.getHeight(t)/2)+" cm"),n.push(r+" 0 m"),n.push(r+" "+o+" "+o+" "+r+" 0 "+r+" c"),n.push("-"+o+" "+r+" -"+r+" "+o+" -"+r+" 0 c"),n.push("-"+r+" -"+o+" -"+o+" -"+r+" 0 -"+r+" c"),n.push(o+" -"+r+" "+r+" -"+o+" "+r+" 0 c"),n.push("f"),n.push("Q"),e.stream=n.join("\n"),e}},Cross:{createAppearanceStream:function(t){var e={D:{Off:K.RadioButton.Cross.OffPushDown},N:{}};return e.N[t]=K.RadioButton.Cross.YesNormal,e.D[t]=K.RadioButton.Cross.YesPushDown,e},getCA:function(){return"8"},YesNormal:function(t){var e=new d(t),n=[],i=K.internal.calculateCross(t);return n.push("q"),n.push("1 1 "+l(K.internal.getWidth(t)-2)+" "+l(K.internal.getHeight(t)-2)+" re"),n.push("W"),n.push("n"),n.push(l(i.x1.x)+" "+l(i.x1.y)+" m"),n.push(l(i.x2.x)+" "+l(i.x2.y)+" l"),n.push(l(i.x4.x)+" "+l(i.x4.y)+" m"),n.push(l(i.x3.x)+" "+l(i.x3.y)+" l"),n.push("s"),n.push("Q"),e.stream=n.join("\n"),e},YesPushDown:function(t){var e=new d(t),n=K.internal.calculateCross(t),i=[];return i.push("0.749023 g"),i.push("0 0 "+l(K.internal.getWidth(t))+" "+l(K.internal.getHeight(t))+" re"),i.push("f"),i.push("q"),i.push("1 1 "+l(K.internal.getWidth(t)-2)+" "+l(K.internal.getHeight(t)-2)+" re"),i.push("W"),i.push("n"),i.push(l(n.x1.x)+" "+l(n.x1.y)+" m"),i.push(l(n.x2.x)+" "+l(n.x2.y)+" l"),i.push(l(n.x4.x)+" "+l(n.x4.y)+" m"),i.push(l(n.x3.x)+" "+l(n.x3.y)+" l"),i.push("s"),i.push("Q"),e.stream=i.join("\n"),e},OffPushDown:function(t){var e=new d(t),n=[];return n.push("0.749023 g"),n.push("0 0 "+l(K.internal.getWidth(t))+" "+l(K.internal.getHeight(t))+" re"),n.push("f"),e.stream=n.join("\n"),e}}},createDefaultAppearanceStream:function(t){var e=n.internal.getFont(t.fontName,t.fontStyle).id,i=n.__private__.encodeColorString(t.color);return"/"+e+" "+t.fontSize+" Tf "+i}};K.internal={Bezier_C:.551915024494,calculateCross:function(t){var e=K.internal.getWidth(t),n=K.internal.getHeight(t),i=Math.min(e,n);return{x1:{x:(e-i)/2,y:(n-i)/2+i},x2:{x:(e-i)/2+i,y:(n-i)/2},x3:{x:(e-i)/2,y:(n-i)/2},x4:{x:(e-i)/2+i,y:(n-i)/2+i}}}},K.internal.getWidth=function(t){var e=0;return"object"==typeof t&&(e=u(t.Rect[2])),e},K.internal.getHeight=function(t){var e=0;return"object"==typeof t&&(e=u(t.Rect[3])),e};var Z=i.addField=function(t){if(B.call(this),!(t instanceof W))throw new Error("Invalid argument passed to jsPDF.addField.");return C.call(this,t),t.page=n.internal.getCurrentPageInfo().pageNumber,this};i.addButton=function(t){if(t instanceof z==0)throw new Error("Invalid argument passed to jsPDF.addButton.");return Z.call(this,t)},i.addTextField=function(t){if(t instanceof Y==0)throw new Error("Invalid argument passed to jsPDF.addTextField.");return Z.call(this,t)},i.addChoiceField=function(t){if(t instanceof H==0)throw new Error("Invalid argument passed to jsPDF.addChoiceField.");return Z.call(this,t)},"object"==typeof e&&void 0===e.ChoiceField&&void 0===e.ListBox&&void 0===e.ComboBox&&void 0===e.EditBox&&void 0===e.Button&&void 0===e.PushButton&&void 0===e.RadioButton&&void 0===e.CheckBox&&void 0===e.TextField&&void 0===e.PasswordField&&(e.ChoiceField=H,e.ListBox=q,e.ComboBox=D,e.EditBox=j,e.Button=z,e.PushButton=G,e.RadioButton=V,e.CheckBox=Q,e.TextField=Y,e.PasswordField=X,e.AcroForm={Appearance:K}),i.AcroFormChoiceField=H,i.AcroFormListBox=q,i.AcroFormComboBox=D,i.AcroFormEditBox=j,i.AcroFormButton=z,i.AcroFormPushButton=G,i.AcroFormRadioButton=V,i.AcroFormCheckBox=Q,i.AcroFormTextField=Y,i.AcroFormPasswordField=X,i.AcroFormAppearance=K,i.AcroForm={ChoiceField:H,ListBox:q,ComboBox:D,EditBox:j,Button:z,PushButton:G,RadioButton:V,CheckBox:Q,TextField:Y,PasswordField:X,Appearance:K},t.AcroForm={ChoiceField:H,ListBox:q,ComboBox:D,EditBox:j,Button:z,PushButton:G,RadioButton:V,CheckBox:Q,TextField:Y,PasswordField:X,Appearance:K}}(n(814).jsPDF,"undefined"!=typeof window&&window||void 0!==n.g&&n.g)},343:(t,e,n)=>{!function(t){var e,n,i,r,o,s,a,l,c,h,u,f,d,p,g,m,y,v,b,x;e=function(){return function(e){return t.prototype=e,new t};function t(){}}(),h=function(t){var e,n,i,r,o,s,a;for(n=0,i=t.length,e=void 0,r=!1,s=!1;!r&&n!==i;)(e=t[n]=t[n].trimLeft())&&(r=!0),n++;for(n=i-1;i&&!s&&-1!==n;)(e=t[n]=t[n].trimRight())&&(s=!0),n--;for(o=/\s+$/g,a=!0,n=0;n!==i;)"\u2028"!=t[n]&&(e=t[n].replace(/\s+/g," "),a&&(e=e.trimLeft()),e&&(a=o.test(e)),t[n]=e),n++;return t},f=function(t){var e,n,r;for(e=void 0,n=(r=t.split(",")).shift();!e&&n;)e=i[n.trim().toLowerCase()],n=r.shift();return e},d=function(t){var e;return(t="auto"===t?"0px":t).indexOf("em")>-1&&!isNaN(Number(t.replace("em","")))&&(t=18.719*Number(t.replace("em",""))+"px"),t.indexOf("pt")>-1&&!isNaN(Number(t.replace("pt","")))&&(t=1.333*Number(t.replace("pt",""))+"px"),(e=p[t])?e:void 0!==(e={"xx-small":9,"x-small":11,small:13,medium:16,large:19,"x-large":23,"xx-large":28,auto:0}[t])||(e=parseFloat(t))?p[t]=e/16:(e=t.match(/([\d\.]+)(px)/),Array.isArray(e)&&3===e.length?p[t]=parseFloat(e[1])/16:p[t]=1)},c=function(t){var e,n,i,c,h;return h=t,c=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(h,null):h.currentStyle?h.currentStyle:h.style,n=void 0,(e={})["font-family"]=f((i=function(t){return t=t.replace(/-\D/g,(function(t){return t.charAt(1).toUpperCase()})),c[t]})("font-family"))||"times",e["font-style"]=r[i("font-style")]||"normal",e["text-align"]=o[i("text-align")]||"left","bold"===(n=s[i("font-weight")]||"normal")&&("normal"===e["font-style"]?e["font-style"]=n:e["font-style"]=n+e["font-style"]),e["font-size"]=d(i("font-size"))||1,e["line-height"]=d(i("line-height"))||1,e.display="inline"===i("display")?"inline":"block",n="block"===e.display,e["margin-top"]=n&&d(i("margin-top"))||0,e["margin-bottom"]=n&&d(i("margin-bottom"))||0,e["padding-top"]=n&&d(i("padding-top"))||0,e["padding-bottom"]=n&&d(i("padding-bottom"))||0,e["margin-left"]=n&&d(i("margin-left"))||0,e["margin-right"]=n&&d(i("margin-right"))||0,e["padding-left"]=n&&d(i("padding-left"))||0,e["padding-right"]=n&&d(i("padding-right"))||0,e["page-break-before"]=i("page-break-before")||"auto",e.float=a[i("cssFloat")]||"none",e.clear=l[i("clear")]||"none",e.color=i("color"),e},g=function(t,e,n){var i,r,o,s,a;if(o=!1,r=void 0,s=void 0,i=n["#"+t.id])if("function"==typeof i)o=i(t,e);else for(r=0,s=i.length;!o&&r!==s;)o=i[r](t,e),r++;if(i=n[t.nodeName],!o&&i)if("function"==typeof i)o=i(t,e);else for(r=0,s=i.length;!o&&r!==s;)o=i[r](t,e),r++;for(a="string"==typeof t.className?t.className.split(" "):[],r=0;r<a.length;r++)if(i=n["."+a[r]],!o&&i)if("function"==typeof i)o=i(t,e);else for(r=0,s=i.length;!o&&r!==s;)o=i[r](t,e),r++;return o},x=function(t,e){var n,i,r,o,s,a,l,c;n=[],i=[],r=0,c=0;for(var h=0;h<t.rows[0].cells.length;h++)c+=t.rows[0].cells[h].colSpan;for(a=t.clientWidth;r<c;){for(l=t.rows[0].cells[r],h=0;h<l.colSpan;h++)i[r+h]={name:l.textContent.toLowerCase().replace(/\s+/g,"")+"_"+h,prompt:l.textContent.replace(/\r?\n/g,""),width:l.clientWidth/a*e.settings.width/l.colSpan};r+=h}for(r=1;r<t.rows.length;){for(s=t.rows[r],o={},h=0;h<s.cells.length;)o[i[h].name]=s.cells[h].textContent.replace(/\r?\n/g,""),h++;n.push(o),r++}return{rows:n,headers:i}};var T={SCRIPT:1,STYLE:1,NOSCRIPT:1,OBJECT:1,EMBED:1,SELECT:1},F=1;n=function(t,i,r){var o,s,a,l,h,u,f,d;for(s=t.childNodes,o=void 0,(h="block"===(a=c(t)).display)&&(i.setBlockBoundary(),i.setBlockStyle(a)),l=0,u=s.length;l<u;){if("object"==typeof(o=s[l])){if(i.executeWatchFunctions(o),1===o.nodeType&&"HEADER"===o.nodeName){var p=o,y=i.pdf.margins_doc.top;i.pdf.internal.events.subscribe("addPage",(function(t){i.y=y,n(p,i,r),i.pdf.margins_doc.top=i.y+10,i.y+=10}),!1)}if(8===o.nodeType&&"#comment"===o.nodeName)~o.textContent.indexOf("ADD_PAGE")&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top);else if(1!==o.nodeType||T[o.nodeName])if(3===o.nodeType){var v=o.nodeValue;if(o.nodeValue&&"LI"===o.parentNode.nodeName)if("OL"===o.parentNode.parentNode.nodeName)v=F+++". "+v;else{var b=a["font-size"],_=(3-.75*b)*i.pdf.internal.scaleFactor,w=.75*b*i.pdf.internal.scaleFactor,R=1.74*b/i.pdf.internal.scaleFactor;d=function(t,e){this.pdf.circle(t+_,e+w,R,"FD")}}16&o.ownerDocument.body.compareDocumentPosition(o)&&i.addText(v,a)}else"string"==typeof o&&i.addText(o,a);else{var C;if("IMG"===o.nodeName){var P=o.getAttribute("src");C=m[i.pdf.sHashCode&&i.pdf.sHashCode(P)||P]}if(C){i.pdf.internal.pageSize.getHeight()-i.pdf.margins_doc.bottom<i.y+o.height&&i.y>i.pdf.margins_doc.top&&(i.pdf.addPage(),i.y=i.pdf.margins_doc.top,i.executeWatchFunctions(o));var E=c(o),O=i.x,S=12/i.pdf.internal.scaleFactor,L=(E["margin-left"]+E["padding-left"])*S,B=(E["margin-right"]+E["padding-right"])*S,A=(E["margin-top"]+E["padding-top"])*S,I=(E["margin-bottom"]+E["padding-bottom"])*S;void 0!==E.float&&"right"===E.float?O+=i.settings.width-o.width-B:O+=L,i.pdf.addImage(C,O,i.y+A,o.width,o.height),C=void 0,"right"===E.float||"left"===E.float?(i.watchFunctions.push(function(t,e,n,r){return i.y>=e?(i.x+=t,i.settings.width+=n,!0):!!(r&&1===r.nodeType&&!T[r.nodeName]&&i.x+r.width>i.pdf.margins_doc.left+i.pdf.margins_doc.width)&&(i.x+=t,i.y=e,i.settings.width+=n,!0)}.bind(this,"left"===E.float?-o.width-L-B:0,i.y+o.height+A+I,o.width)),i.watchFunctions.push(function(t,e,n){return!(i.y<t&&e===i.pdf.internal.getNumberOfPages())||1===n.nodeType&&"both"===c(n).clear&&(i.y=t,!0)}.bind(this,i.y+o.height,i.pdf.internal.getNumberOfPages())),i.settings.width-=o.width+L+B,"left"===E.float&&(i.x+=o.width+L+B)):i.y+=o.height+A+I}else if("TABLE"===o.nodeName)i.pdf.autoTable?(i.y+=10,i.pdf.autoTable({theme:"grid",html:o,startY:i.y,styles:{font:i.pdf.getFont().fontName,fontSize:i.pdf.getFontSize(),textColor:i.pdf.getTextColor()},margin:{top:i.pdf.margins_doc.top,left:i.x,right:i.pdf.internal.pageSize.getWidth()-(i.x+i.settings.width),bottom:i.pdf.margins_doc.bottom}}),i.y=i.pdf.lastAutoTable.finalY):(f=x(o,i),i.y+=10,i.pdf.table(i.x,i.y,f.rows,f.headers,{autoSize:!1,printHeaders:r.printHeaders,margins:i.pdf.margins_doc,css:c(o)}),i.y=i.pdf.internal.__cell__.lastCell.y+i.pdf.internal.__cell__.lastCell.height);else if("OL"===o.nodeName||"UL"===o.nodeName)F=1,g(o,i,r)||n(o,i,r),i.y+=10;else if("LI"===o.nodeName){var N=i.x;i.x+=20/i.pdf.internal.scaleFactor,i.y+=3,g(o,i,r)||n(o,i,r),i.x=N}else"BR"===o.nodeName?(i.y+=a["font-size"]*i.pdf.internal.scaleFactor,i.addText("\u2028",e(a))):g(o,i,r)||n(o,i,r)}}l++}if(r.outY=i.y,h)return i.setBlockBoundary(d)},m={},y=function(t,e,n,i){var r,o=t.getElementsByTagName("img"),s=o.length,a=0;function l(){e.pdf.internal.events.publish("imagesLoaded"),i(r)}function c(t,n,i){if(t){var o=new Image;r=++a,o.crossOrigin="",o.onerror=o.onload=function(){if(o.complete&&(0===o.src.indexOf("data:image/")&&(o.width=n||o.width||0,o.height=i||o.height||0),o.width+o.height)){var r=e.pdf.sHashCode&&e.pdf.sHashCode(t)||t;m[r]=m[r]||o}--a||l()},o.src=t}}for(;s--;)c(o[s].getAttribute("src"),o[s].width,o[s].height);return a||l()},v=function(t,e,i){var r=t.getElementsByTagName("footer");if(r.length>0){r=r[0];var o=e.pdf.internal.write,s=e.y;e.pdf.internal.write=function(){},n(r,e,i);var a=Math.ceil(e.y-s)+5;e.y=s,e.pdf.internal.write=o,e.pdf.margins_doc.bottom+=a;for(var l=function(t){var o=void 0!==t?t.pageNumber:1,s=e.y;e.y=e.pdf.internal.pageSize.getHeight()-e.pdf.margins_doc.bottom,e.pdf.margins_doc.bottom-=a;for(var l=r.getElementsByTagName("span"),c=0;c<l.length;++c)(" "+l[c].className+" ").replace(/[\n\t]/g," ").indexOf(" pageCounter ")>-1&&(l[c].innerHTML=o),(" "+l[c].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&(l[c].innerHTML="###jsPDFVarTotalPages###");n(r,e,i),e.pdf.margins_doc.bottom+=a,e.y=s},c=r.getElementsByTagName("span"),h=0;h<c.length;++h)(" "+c[h].className+" ").replace(/[\n\t]/g," ").indexOf(" totalPages ")>-1&&e.pdf.internal.events.subscribe("htmlRenderingFinished",e.pdf.putTotalPages.bind(e.pdf,"###jsPDFVarTotalPages###"),!0);e.pdf.internal.events.subscribe("addPage",l,!1),l(),T.FOOTER=1}},b=function(t,e,r,o,s,a){if(!e)return!1;"string"==typeof e||e.parentNode||(e=""+e.innerHTML),"string"==typeof e&&(e=function(t){var e,n,i;return i="jsPDFhtmlText"+Date.now().toString()+(1e3*Math.random()).toFixed(0),(n=document.createElement("div")).className="sjs-pdf-hidden-html-div",n.style.cssText="position: absolute !important;clip: rect(1px 1px 1px 1px); /* IE6, IE7 */clip: rect(1px, 1px, 1px, 1px);padding:0 !important;border:0 !important;height: 1px !important;width: 1px !important; top:auto;left:-100px;overflow: hidden;",n.innerHTML='<iframe style="height:1px;width:1px" name="'+i+'" />',document.body.appendChild(n),(e=window.frames[i]).document.open(),e.document.writeln(t),e.document.close(),e.document.body}(e.replace(/<\/?script[^>]*?>/gi,"")));for(var l=Object.keys(t.getFontList()),c=0;c<l.length;++c){var h=l[c],f=h.toLowerCase();i[f]||(i[f]=h)}var d,p=new u(t,r,o,s);return y.call(this,e,p,s.elementHandlers,(function(t){v(e,p,s.elementHandlers),n(e,p,s.elementHandlers),p.pdf.internal.events.publish("htmlRenderingFinished"),d=p.dispose(),"function"==typeof a?a(d):t&&console.error("jsPDF Warning: rendering issues? provide a callback to fromHTML!")})),d||{x:p.x,y:p.y}},(u=function(t,e,n,i){return this.pdf=t,this.x=e,this.y=n,this.settings=i,this.watchFunctions=[],this.init(),this}).prototype.init=function(){return this.paragraph={text:[],style:[]},this.pdf.internal.write("q")},u.prototype.dispose=function(){return this.pdf.internal.write("Q"),{x:this.x,y:this.y,ready:!0}},u.prototype.executeWatchFunctions=function(t){var e=!1,n=[];if(this.watchFunctions.length>0){for(var i=0;i<this.watchFunctions.length;++i)!0===this.watchFunctions[i](t)?e=!0:n.push(this.watchFunctions[i]);this.watchFunctions=n}return e},u.prototype.splitFragmentsIntoLines=function(t,n){var i,r,o,s,a,l,c,h,u,f,d,p,g,m;for(f=this.pdf.internal.scaleFactor,s={},r=void 0,u=void 0,o=void 0,a=void 0,m=void 0,h=void 0,c=void 0,l=void 0,p=[d=[]],i=0,g=this.settings.width;t.length;)if(a=t.shift(),m=n.shift(),a)if((o=s[(r=m["font-family"])+(u=m["font-style"])])||(o=this.pdf.internal.getFont(r,u).metadata.Unicode,s[r+u]=o),h={widths:o.widths,kerning:o.kerning,fontSize:12*m["font-size"],textIndent:i},c=this.pdf.getStringUnitWidth(a,h)*h.fontSize/f,"\u2028"==a)d=[],p.push(d);else if(i+c>g){for(l=this.pdf.splitTextToSize(a,g,h),d.push([l.shift(),m]);l.length;)d=[[l.shift(),m]],p.push(d);i=this.pdf.getStringUnitWidth(d[0][0],h)*h.fontSize/f}else d.push([a,m]),i+=c;if(void 0!==m["text-align"]&&("center"===m["text-align"]||"right"===m["text-align"]||"justify"===m["text-align"]))for(var y=0;y<p.length;++y){var v=this.pdf.getStringUnitWidth(p[y][0][0],h)*h.fontSize/f;y>0&&(p[y][0][1]=e(p[y][0][1]));var b=g-v;if("right"===m["text-align"])p[y][0][1]["margin-left"]=b;else if("center"===m["text-align"])p[y][0][1]["margin-left"]=b/2;else if("justify"===m["text-align"]){var x=p[y][0][0].split(" ").length-1;p[y][0][1]["word-spacing"]=b/x,y===p.length-1&&(p[y][0][1]["word-spacing"]=0)}}return p},u.prototype.RenderTextFragment=function(t,e){var n,i;if(i=0,this.pdf.internal.pageSize.getHeight()-this.pdf.margins_doc.bottom<this.y+this.pdf.internal.getFontSize()){this.pdf.internal.write("ET","Q","Q");const t=this.pdf.getCurrentPageInfo().pageNumber;this.pdf.getNumberOfPages()===t?this.pdf.addPage():this.pdf.setPage(t+1),this.y=this.pdf.margins_doc.top,this.pdf.internal.write("q","q","BT",this.getPdfColor(e.color),this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td"),i=Math.max(i,e["line-height"],e["font-size"]),this.pdf.internal.write(0,(-12*i).toFixed(2),"Td")}n=this.pdf.internal.getFont(e["font-family"],e["font-style"]);var r=this.getPdfColor(e.color);r!==this.lastTextColor&&(this.pdf.internal.write(r),this.lastTextColor=r),void 0!==e["word-spacing"]&&e["word-spacing"]>0&&this.pdf.internal.write(e["word-spacing"].toFixed(2),"Tw");var o;o="Identity-H"!==n.encoding?"("+this.pdf.internal.pdfEscape(t)+")":"<"+function(t,e){t=t||"";var n,i="",r=0,o="",s=e.encoding;if("Identity-H"!==e.encoding)return t;for(o=t,r=0;r<o.length;r+=1)e.metadata.hasOwnProperty("cmap")&&(n=e.metadata.cmap.unicode.codeMap[o[r].charCodeAt(0)]),n||o[r].charCodeAt(0)<256&&e.metadata.hasOwnProperty("Unicode")?i+=o[r]:i+="";var a="";return parseInt(e.id.slice(1))<14||"WinAnsiEncoding"===s?a=this.pdf.internal.pdfEscape(i,key).split("").map((function(t){return t.charCodeAt(0).toString(16)})).join(""):"Identity-H"===s&&(a=function(t,e){for(var n,i=e.metadata.Unicode.widths,r=["","0","00","000","0000"],o=[""],s=0,a=t.length;s<a;++s){if(n=e.metadata.characterToGlyph(t.charCodeAt(s)),e.metadata.glyIdsUsed.push(n),e.metadata.toUnicode[n]=t.charCodeAt(s),-1==i.indexOf(n)&&(i.push(n),i.push([parseInt(e.metadata.widthOfGlyph(n),10)])),"0"==n)return o.join("");n=n.toString(16),o.push(r[4-n.length],n)}return o.join("")}(i,e)),a}(t,n)+">",this.pdf.internal.write("/"+n.id,(12*e["font-size"]).toFixed(2),"Tf",o+" Tj"),void 0!==e["word-spacing"]&&this.pdf.internal.write(0,"Tw")},u.prototype.getPdfColor=function(t){var e,n,i,r=/rgb\s*\(\s*(\d+),\s*(\d+),\s*(\d+\s*)\)/.exec(t);if(null!=r)e=parseInt(r[1]),n=parseInt(r[2]),i=parseInt(r[3]);else{if("string"==typeof t&&"#"!=t.charAt(0)){var o=new RGBColor(t);t=o.ok?o.toHex():"#000000"}e=t.substring(1,3),e=parseInt(e,16),n=t.substring(3,5),n=parseInt(n,16),i=t.substring(5,7),i=parseInt(i,16)}if("string"==typeof e&&/^#[0-9A-Fa-f]{6}$/.test(e)){var s=parseInt(e.substr(1),16);e=s>>16&255,n=s>>8&255,i=255&s}var a=this.f3;return 0===e&&0===n&&0===i||void 0===n?a(e/255)+" g":[a(e/255),a(n/255),a(i/255),"rg"].join(" ")},u.prototype.f3=function(t){return t.toFixed(3)},u.prototype.renderParagraph=function(t){var e,n,i,r,o,s,a,l,c,u,f,d,p;if(i=h(this.paragraph.text),d=this.paragraph.style,e=this.paragraph.blockstyle,this.paragraph.priorblockstyle,this.paragraph={text:[],style:[],blockstyle:{},priorblockstyle:e},i.join("").trim()){a=this.splitFragmentsIntoLines(i,d),s=void 0,l=void 0,n=12/this.pdf.internal.scaleFactor,this.priorMarginBottom=this.priorMarginBottom||0,f=(Math.max((e["margin-top"]||0)-this.priorMarginBottom,0)+(e["padding-top"]||0))*n,u=((e["margin-bottom"]||0)+(e["padding-bottom"]||0))*n,this.priorMarginBottom=e["margin-bottom"]||0,"always"===e["page-break-before"]&&(this.pdf.addPage(),this.y=0,f=((e["margin-top"]||0)+(e["padding-top"]||0))*n),c=this.pdf.internal.write,r=void 0,o=void 0,this.y+=f,c("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td");for(var g=0;a.length;){for(l=0,r=0,o=(s=a.shift()).length;r!==o;)s[r][0].trim()&&(l=Math.max(l,s[r][1]["line-height"],s[r][1]["font-size"]),p=7*s[r][1]["font-size"]),r++;var m=0,y=0;for(void 0!==s[0][1]["margin-left"]&&s[0][1]["margin-left"]>0&&(m=(y=this.pdf.internal.getCoordinateString(s[0][1]["margin-left"]))-g,g=y),c(m+Math.max(e["margin-left"]||0,0)*n,(-12*l).toFixed(2),"Td"),r=0,o=s.length;r!==o;)s[r][0]&&this.RenderTextFragment(s[r][0],s[r][1]),r++;if(this.y+=l*n,this.executeWatchFunctions(s[0][1])&&a.length>0){var v=[],b=[];a.forEach((function(t){for(var e=0,n=t.length;e!==n;)t[e][0]&&(v.push(t[e][0]+" "),b.push(t[e][1])),++e})),a=this.splitFragmentsIntoLines(h(v),b),c("ET","Q"),c("q","BT 0 g",this.pdf.internal.getCoordinateString(this.x),this.pdf.internal.getVerticalCoordinateString(this.y),"Td")}}return t&&"function"==typeof t&&t.call(this,this.x-9,this.y-p/2),c("ET","Q"),this.y+=u}},u.prototype.setBlockBoundary=function(t){return this.renderParagraph(t)},u.prototype.setBlockStyle=function(t){return this.paragraph.blockstyle=t},u.prototype.addText=function(t,e){return this.paragraph.text.push(t),this.paragraph.style.push(e)},i={helvetica:"helvetica","sans-serif":"helvetica","times new roman":"times",serif:"times",times:"times",monospace:"courier",courier:"courier"},s={100:"normal",200:"normal",300:"normal",400:"normal",500:"bold",600:"bold",700:"bold",800:"bold",900:"bold",normal:"normal",bold:"bold",bolder:"bold",lighter:"normal"},r={normal:"normal",italic:"italic",oblique:"italic"},o={left:"left",right:"right",center:"center",justify:"justify"},a={none:"none",right:"right",left:"left"},l={none:"none",both:"both"},p={normal:1},t.fromHTML=function(t,e,n,i,r,o){return this.margins_doc=o||{top:0,bottom:0},i||(i={}),i.elementHandlers||(i.elementHandlers={}),b(this,t,isNaN(e)?4:e,isNaN(n)?4:n,i,r)}}(n(814).jsPDF.API)},156:e=>{"use strict";e.exports=t},814:t=>{"use strict";t.exports=e}},i={};function r(t){var e=i[t];if(void 0!==e)return e.exports;var o=i[t]={exports:{}};return n[t](o,o.exports,r),o.exports}r.d=(t,e)=>{for(var n in e)r.o(e,n)&&!r.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var o={};return(()=>{"use strict";r.r(o),r.d(o,{BooleanItemBrick:()=>V,CheckItemBrick:()=>G,CheckboxItemBrick:()=>J,CommentBrick:()=>E,CompositeBrick:()=>u,CustomBrick:()=>Ft,DocController:()=>k,DocOptions:()=>M,DrawCanvas:()=>q,DropdownBrick:()=>it,EmptyBrick:()=>B,EventHandler:()=>j,FlatBoolean:()=>K,FlatCheckbox:()=>$,FlatComment:()=>nt,FlatCustomModel:()=>et,FlatDropdown:()=>rt,FlatExpression:()=>ot,FlatFile:()=>st,FlatHTML:()=>at,FlatImage:()=>lt,FlatImagePicker:()=>ct,FlatMatrix:()=>yt,FlatMatrixDynamic:()=>xt,FlatMatrixMultiple:()=>bt,FlatMultipleText:()=>Tt,FlatPanelDynamic:()=>ht,FlatQuestion:()=>x,FlatQuestionDefault:()=>T,FlatRadiogroup:()=>X,FlatRanking:()=>dt,FlatRating:()=>pt,FlatRepository:()=>F,FlatSelectBase:()=>Y,FlatSignaturePad:()=>gt,FlatSurvey:()=>y,FlatTextbox:()=>mt,HTMLBrick:()=>S,HorizontalAlign:()=>I,ImageBrick:()=>L,LinkBrick:()=>O,PagePacker:()=>H,PdfBrick:()=>v,RadioItemBrick:()=>Q,RankingItemBrick:()=>ut,RowlineBrick:()=>f,SurveyHelper:()=>A,SurveyPDF:()=>z,TextBoldBrick:()=>_,TextBoxBrick:()=>P,TextBrick:()=>b,TextFieldBrick:()=>C,TitlePanelBrick:()=>w,VerticalAlign:()=>N});var t={};r.r(t),r.d(t,{BooleanItemBrick:()=>V,CheckItemBrick:()=>G,CheckboxItemBrick:()=>J,CommentBrick:()=>E,CompositeBrick:()=>u,CustomBrick:()=>Ft,DocController:()=>k,DocOptions:()=>M,DrawCanvas:()=>q,DropdownBrick:()=>it,EmptyBrick:()=>B,EventHandler:()=>j,FlatBoolean:()=>K,FlatCheckbox:()=>$,FlatComment:()=>nt,FlatCustomModel:()=>et,FlatDropdown:()=>rt,FlatExpression:()=>ot,FlatFile:()=>st,FlatHTML:()=>at,FlatImage:()=>lt,FlatImagePicker:()=>ct,FlatMatrix:()=>yt,FlatMatrixDynamic:()=>xt,FlatMatrixMultiple:()=>bt,FlatMultipleText:()=>Tt,FlatPanelDynamic:()=>ht,FlatQuestion:()=>x,FlatQuestionDefault:()=>T,FlatRadiogroup:()=>X,FlatRanking:()=>dt,FlatRating:()=>pt,FlatRepository:()=>F,FlatSelectBase:()=>Y,FlatSignaturePad:()=>gt,FlatSurvey:()=>y,FlatTextbox:()=>mt,HTMLBrick:()=>S,HorizontalAlign:()=>I,ImageBrick:()=>L,LinkBrick:()=>O,PagePacker:()=>H,PdfBrick:()=>v,RadioItemBrick:()=>Q,RankingItemBrick:()=>ut,RowlineBrick:()=>f,SurveyHelper:()=>A,SurveyPDF:()=>z,TextBoldBrick:()=>_,TextBoxBrick:()=>P,TextBrick:()=>b,TextFieldBrick:()=>C,TitlePanelBrick:()=>w,VerticalAlign:()=>N});var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}var i=function(){return i=Object.assign||function(t){for(var e,n=1,i=arguments.length;n<i;n++)for(var r in e=arguments[n])Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t},i.apply(this,arguments)};function s(t,e,n,i){return new(n||(n=Promise))((function(r,o){function s(t){try{l(i.next(t))}catch(t){o(t)}}function a(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(s,a)}l((i=i.apply(t,e||[])).next())}))}function a(t,e){var n,i,r,o,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,i&&(r=2&o[0]?i.return:o[0]?i.throw||((r=i.return)&&r.call(i),0):i.next)&&!(r=r.call(i,o[1])).done)return r;switch(i=0,r&&(o=[2&o[0],r.value]),o[0]){case 0:case 1:r=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,i=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!((r=(r=s.trys).length>0&&r[r.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!r||o[1]>r[0]&&o[1]<r[3])){s.label=o[1];break}if(6===o[0]&&s.label<r[1]){s.label=r[1],r=o;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(o);break}r[2]&&s.ops.pop(),s.trys.pop();continue}o=e.call(t,s)}catch(t){o=[6,t],i=0}finally{n=r=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}function l(t,e,n){if(n||2===arguments.length)for(var i,r=0,o=e.length;r<o;r++)!i&&r in e||(i||(i=Array.prototype.slice.call(e,0,r)),i[r]=e[r]);return t.concat(i||Array.prototype.slice.call(e))}var c=r(156),h=r(814),u=function(){function t(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];this.bricks=[],this.isPageBreak=!1,this._xLeft=0,this._xRight=0,this._yTop=0,this._yBot=0,this.addBrick.apply(this,t)}return Object.defineProperty(t.prototype,"xLeft",{get:function(){return this._xLeft},set:function(t){this.shift(t-this.xLeft,0,0,0),this._xLeft=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xRight",{get:function(){return this._xRight},set:function(t){this.shift(0,t-this.xRight,0,0),this._xRight=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yTop",{get:function(){return this._yTop},set:function(t){this.shift(0,0,t-this.yTop,0),this._yTop=t},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yBot",{get:function(){return this._yBot},set:function(t){this.shift(0,0,0,t-this.yBot),this._yBot=t},enumerable:!1,configurable:!0}),t.prototype.shift=function(t,e,n,i){this.bricks.forEach((function(r){r.xLeft+=t,r.xRight+=e,r.yTop+=n,r.yBot+=i}))},Object.defineProperty(t.prototype,"width",{get:function(){return this.xRight-this.xLeft},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.yBot-this.yTop},enumerable:!1,configurable:!0}),t.prototype.render=function(){return s(this,void 0,void 0,(function(){var t;return a(this,(function(e){switch(e.label){case 0:t=0,e.label=1;case 1:return t<this.bricks.length?[4,this.bricks[t].render()]:[3,4];case 2:e.sent(),e.label=3;case 3:return t++,[3,1];case 4:return[2]}}))}))},Object.defineProperty(t.prototype,"isEmpty",{get:function(){return 0===this.bricks.length},enumerable:!1,configurable:!0}),t.prototype.addBrick=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];if(0!=e.length){(t=this.bricks).push.apply(t,e);var i=A.mergeRects.apply(A,this.bricks);this._xLeft=i.xLeft,this._xRight=i.xRight,this._yTop=i.yTop,this._yBot=i.yBot}},t.prototype.unfold=function(){var t=[];return this.bricks.forEach((function(e){t.push.apply(t,e.unfold())})),t},t.prototype.translateX=function(t){this.bricks.forEach((function(e){return e.translateX(t)}));var e=t(this.xLeft,this.xRight);this._xLeft=e.xLeft,this._xRight=e.xRight},t}(),f=function(){function t(t,e,n){this.controller=t,this.color=n,this.isPageBreak=!1,this.xLeft=e.xLeft,this.xRight=e.xRight,this.yTop=e.yTop,this.yBot=e.yBot}return Object.defineProperty(t.prototype,"width",{get:function(){return this.xRight-this.xLeft},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.yBot-this.yTop},enumerable:!1,configurable:!0}),t.prototype.render=function(){return s(this,void 0,void 0,(function(){var t;return a(this,(function(e){return null!==this.color&&(t=this.controller.doc.getDrawColor(),this.controller.doc.setDrawColor(this.color),this.controller.doc.line(this.xLeft,this.yTop,this.xRight,this.yTop),this.controller.doc.setDrawColor(t)),[2]}))}))},t.prototype.unfold=function(){return[this]},t.prototype.translateX=function(t){},t}(),d=function(t,e,n,i,r){this.point=t,this.bricks=e,this.controller=n,this.repository=i,this.module=r},p=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e,n,r,o,s)||this;return a.question=i,a}return n(e,t),e}(d),g=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e,n,r,o,s)||this;return a.panel=i,a}return n(e,t),e}(d),m=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e,n,r,o,s)||this;return a.page=i,a}return n(e,t),e}(d),y=function(){function e(){}return e.generateFlatsPanel=function(e,n,i,r){return s(this,void 0,void 0,(function(){var o,s,c,h,u,f;return a(this,(function(a){switch(a.label){case 0:return o=[],s=A.clone(r),n.pushMargins(),n.margins.left+=n.measureText(i.innerIndent).width,s.xLeft+=n.measureText(i.innerIndent).width,h=(c=o.push).apply,u=[o],[4,this.generateFlatsPagePanel(e,n,i,s)];case 1:return h.apply(c,u.concat([a.sent()])),n.popMargins(),f=new g(r,o,i,n,F.getInstance(),t),[4,e.onRenderPanel.fire(e,f)];case 2:return a.sent(),[2,l([],f.bricks,!0)]}}))}))},e.generateFlatsPagePanel=function(t,n,i,r){return s(this,void 0,void 0,(function(){var o,s,l,h,f,d,p,g,m,y,v,b,x,T,F,_,w,R,C,P,E,O,S;return a(this,(function(a){switch(a.label){case 0:return i.isVisible?(i.onFirstRendering(),o=[],s=A.clone(r),"page"!==i.getType()||t.showPageTitles?(l=new u,i.title?i instanceof c.PanelModel&&i.no?[4,A.createTitlePanelFlat(s,n,i.no,"page"===i.getType())]:[3,2]:[3,4]):[3,7]):[2];case 1:h=a.sent(),l.addBrick(h),s.xLeft=h.xRight+n.measureText(" ").width,a.label=2;case 2:return[4,A.createTitlePanelFlat(s,n,i.locTitle,"page"===i.getType())];case 3:f=a.sent(),l.addBrick(f),s=A.createPoint(f),a.label=4;case 4:return i.description?(i.title&&(s.yTop+=n.unitWidth*e.PANEL_DESC_GAP_SCALE),[4,A.createDescFlat(s,null,n,i.locDescription)]):[3,6];case 5:d=a.sent(),l.addBrick(d),s=A.createPoint(d),a.label=6;case 6:l.isEmpty||(p=A.createPoint(l),l.addBrick(A.createRowlineFlat(p,n)),o.push(l),s.yTop+=n.unitHeight*e.PANEL_CONT_GAP_SCALE+A.EPSILON),a.label=7;case 7:g=0,m=i.rows,a.label=8;case 8:if(!(g<m.length))return[3,16];if(!(y=m[g]).visible)return[3,15];n.pushMargins(),v=A.getPageAvailableWidth(n),b=n.margins.left,x=[],T=y.elements.filter((function(t){return t.isVisible})),F=0,a.label=9;case 9:return F<T.length?(_=T[F]).isVisible?(w=A.parseWidth(_.renderWidth,v-(T.length-1)*n.unitWidth,T.length),n.margins.left=b+(0!==F?n.unitWidth:0),n.margins.right=n.paperWidth-n.margins.left-w,s.xLeft=n.margins.left,b=n.margins.left+w,_ instanceof c.PanelModel?(C=(R=x.push).apply,P=[x],[4,this.generateFlatsPanel(t,n,_,s)]):[3,11]):[3,13]:[3,14];case 10:return C.apply(R,P.concat([a.sent()])),[3,13];case 11:return O=(E=x.push).apply,S=[x],[4,A.generateQuestionFlats(t,n,_,s)];case 12:O.apply(E,S.concat([a.sent()])),a.label=13;case 13:return F++,[3,9];case 14:n.popMargins(),s.xLeft=n.margins.left,0!==x.length&&(s.yTop=A.mergeRects.apply(A,x).yBot,s.xLeft=r.xLeft,s.yTop+=n.unitHeight*e.QUES_GAP_VERT_SCALE,o.push.apply(o,x),o.push(A.createRowlineFlat(s,n)),s.yTop+=A.EPSILON),a.label=15;case 15:return g++,[3,8];case 16:return[2,o]}}))}))},e.popRowlines=function(t){for(;t.length>0&&t[t.length-1]instanceof f;)t.pop()},e.generateFlatTitle=function(t,n,i){return s(this,void 0,void 0,(function(){var r,o,s,l;return a(this,(function(a){switch(a.label){case 0:return r=new u,t.showTitle?t.title?[4,A.createTitleSurveyFlat(i,n,t.locTitle)]:[3,2]:[3,4];case 1:o=a.sent(),r.addBrick(o),i=A.createPoint(o),a.label=2;case 2:return t.description?(t.title&&(i.yTop+=n.unitWidth*e.PANEL_DESC_GAP_SCALE),l=(s=r).addBrick,[4,A.createDescFlat(i,null,n,t.locDescription)]):[3,4];case 3:l.apply(s,[a.sent()]),a.label=4;case 4:return[2,r]}}))}))},e.generateFlatLogoImage=function(t,e,n){return s(this,void 0,void 0,(function(){var i,r,o,s;return a(this,(function(a){switch(a.label){case 0:return i=A.getLocString(t.locLogo),[4,A.getCorrectedImageSize(e,{imageLink:i,imageHeight:t.logoHeight,imageWidth:t.logoWidth,defaultImageWidth:"300px",defaultImageHeight:"200px"})];case 1:return r=a.sent(),[4,A.createImageFlat(n,null,e,{link:i,width:r.width,height:r.height})];case 2:return o=a.sent(),s=0,"right"===t.logoPosition?s=A.getPageAvailableWidth(e)-o.width:"left"!==t.logoPosition&&(s=A.getPageAvailableWidth(e)/2-o.width/2),o.xLeft+=s,o.xRight+=s,[2,o]}}))}))},e.generateFlats=function(n,i){return s(this,void 0,void 0,(function(){var r,o,s,c,h,u,f,d,p,g,y,v,b;return a(this,(function(a){switch(a.label){case 0:return r=[],n.hasLogo?[3,2]:[4,this.generateFlatTitle(n,i,i.leftTopPoint)];case 1:return(s=a.sent()).isEmpty||r.push([s]),[3,11];case 2:return n.isLogoBefore?[4,this.generateFlatLogoImage(n,i,i.leftTopPoint)]:[3,5];case 3:return h=a.sent(),r.push([h]),o=A.createPoint(h,"top"===n.logoPosition,"top"!==n.logoPosition),"top"!==n.logoPosition?(i.pushMargins(),o.xLeft+=i.unitWidth,i.margins.left+=h.width+i.unitWidth):(o.xLeft=i.leftTopPoint.xLeft,o.yTop+=i.unitHeight/2),[4,this.generateFlatTitle(n,i,o)];case 4:return s=a.sent(),"top"!==n.logoPosition&&i.popMargins(),s.isEmpty||r[0].push(s),[3,11];case 5:return"right"!==n.logoPosition?[3,8]:[4,this.generateFlatLogoImage(n,i,i.leftTopPoint)];case 6:return h=a.sent(),r.push([h]),i.pushMargins(),i.margins.right+=h.width+i.unitWidth,[4,this.generateFlatTitle(n,i,i.leftTopPoint)];case 7:return(s=a.sent()).isEmpty||r[0].unshift(s),i.popMargins(),[3,11];case 8:return[4,this.generateFlatTitle(n,i,i.leftTopPoint)];case 9:return s=a.sent(),c=i.leftTopPoint,s.isEmpty||(r.push([s]),(c=A.createPoint(s)).yTop+=i.unitHeight/2),[4,this.generateFlatLogoImage(n,i,c)];case 10:h=a.sent(),0!==r.length?r[0].push(h):r.push([h]),a.label=11;case 11:u=i.leftTopPoint,0!==r.length&&(u.yTop=A.createPoint(A.mergeRects.apply(A,r[0])).yTop,r[0].push(A.createRowlineFlat(u,i)),u.yTop+=i.unitHeight*e.PANEL_CONT_GAP_SCALE+A.EPSILON),f=0,a.label=12;case 12:return f<n.visiblePages.length?(n.currentPage=n.visiblePages[f],g=(p=(d=[]).push).apply,y=[d],[4,this.generateFlatsPagePanel(n,i,n.visiblePages[f],u)]):[3,16];case 13:return g.apply(p,y.concat([a.sent()])),v=new m(u,d,n.visiblePages[f],i,F.getInstance(),t),[4,n.onRenderPage.fire(n,v)];case 14:a.sent(),d=l([],v.bricks,!0),0===f&&0!==r.length?(b=r[0]).push.apply(b,d):r.push(d),this.popRowlines(r[r.length-1]),u.yTop=i.leftTopPoint.yTop,a.label=15;case 15:return f++,[3,12];case 16:return[2,r]}}))}))},e.QUES_GAP_VERT_SCALE=1.5,e.PANEL_CONT_GAP_SCALE=1,e.PANEL_DESC_GAP_SCALE=.25,e}(),v=function(){function t(t,e,n){this.question=t,this.controller=e,this.textColor=A.TEXT_COLOR,this.formBorderColor=A.FORM_BORDER_COLOR,this.isPageBreak=!1,this.xLeft=n.xLeft,this.xRight=n.xRight,this.yTop=n.yTop,this.yBot=n.yBot,this.fontSize=e?e.fontSize:k.FONT_SIZE}return Object.defineProperty(t.prototype,"xLeft",{get:function(){return this._xLeft},set:function(t){this.setXLeft(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"xRight",{get:function(){return this._xRight},set:function(t){this.setXRight(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yTop",{get:function(){return this._yTop},set:function(t){this.setYTop(t)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"yBot",{get:function(){return this._yBot},set:function(t){this.setYBottom(t)},enumerable:!1,configurable:!0}),t.prototype.translateX=function(t){var e=t(this.xLeft,this.xRight);this.xLeft=e.xLeft,this.xRight=e.xRight},Object.defineProperty(t.prototype,"width",{get:function(){return this.xRight-this.xLeft},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"height",{get:function(){return this.yBot-this.yTop},enumerable:!1,configurable:!0}),t.prototype.getShouldRenderReadOnly=function(){return A.shouldRenderReadOnly(this.question,this.controller)},t.prototype.render=function(){return s(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return this.getShouldRenderReadOnly()?[4,this.renderReadOnly()]:[3,2];case 1:return t.sent(),[3,4];case 2:return[4,this.renderInteractive()];case 3:t.sent(),t.label=4;case 4:return this.afterRenderCallback&&this.afterRenderCallback(),[2]}}))}))},t.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){return a(this,(function(t){return[2]}))}))},t.prototype.renderReadOnly=function(){return s(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,this.renderInteractive()];case 1:return t.sent(),[2]}}))}))},t.prototype.unfold=function(){return[this]},t.prototype.getCorrectedText=function(t){return this.controller.isRTL?(t||"").split("").reverse().join(""):t},t.prototype.setXLeft=function(t){this._xLeft=t},t.prototype.setXRight=function(t){this._xRight=t},t.prototype.setYTop=function(t){this._yTop=t},t.prototype.setYBottom=function(t){this._yBot=t},t}(),b=function(t){function e(e,n,i,r){var o=t.call(this,e,n,i)||this;return o.text=r,o.align={isInputRtl:!1,isOutputRtl:n.isRTL,align:n.isRTL?"right":"left",baseline:"middle"},o}return n(e,t),e.prototype.escapeText=function(){for(;this.text.indexOf("\t")>-1;)this.text=this.text.replace("\t",Array(5).join(String.fromCharCode(160)));return this.text},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){var t,e,n;return a(this,(function(i){return t=this.alignPoint(this),e=this.controller.fontSize,this.controller.fontSize=this.fontSize,n=this.controller.doc.getTextColor(),this.controller.doc.setTextColor(this.textColor),this.controller.doc.text(this.escapeText(),t.xLeft,t.yTop,this.align),this.controller.doc.setTextColor(n),this.controller.fontSize=e,[2]}))}))},e.prototype.alignPoint=function(t){return{xLeft:this.controller.isRTL?t.xRight:t.xLeft,yTop:t.yTop+(t.yBot-t.yTop)/2}},e}(v),x=function(){function t(t,e,n){this.survey=t,this.controller=n,this.question=e}return t.prototype.generateFlatTitle=function(t){return s(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,A.createTitleFlat(t,this.question,this.controller)];case 1:return[2,e.sent()]}}))}))},t.prototype.generateFlatDescription=function(t){return s(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,A.createDescFlat(t,this.question,this.controller,this.question.locDescription)];case 1:return[2,e.sent()]}}))}))},t.prototype.generateFlatHeader=function(e){return s(this,void 0,void 0,(function(){var n,i,r,o,s;return a(this,(function(a){switch(a.label){case 0:return[4,this.generateFlatTitle(e)];case 1:return n=a.sent(),i=new u(n),this.question.hasDescriptionUnderTitle?((r=A.createPoint(n,!0,!1)).yTop+=t.DESC_GAP_SCALE*this.controller.unitHeight,r.xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,s=(o=i).addBrick,[4,this.generateFlatDescription(r)]):[3,3];case 2:s.apply(o,[a.sent()]),a.label=3;case 3:return[2,i]}}))}))},t.prototype.generateFlatsComment=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r,o;return a(this,(function(s){switch(s.label){case 0:return e=this.question.locCommentText,[4,A.createTextFlat(t,this.question,this.controller,e,b)];case 1:return n=s.sent(),(i=A.createPoint(n)).yTop+=this.controller.unitHeight*A.GAP_BETWEEN_ROWS,r=u.bind,o=[void 0,n],[4,A.createCommentFlat(i,this.question,this.controller,!1,{rows:A.OTHER_ROWS_COUNT})];case 2:return[2,new(r.apply(u,o.concat([s.sent()])))]}}))}))},t.prototype.generateFlatsComposite=function(t){return s(this,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return(e=this.question.contentPanel)?[4,y.generateFlatsPanel(this.survey,this.controller,e,t)]:[3,2];case 1:case 3:return[2,n.sent()];case 2:return this.question=A.getContentQuestion(this.question),[4,this.generateFlatsContent(t)]}}))}))},t.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){return a(this,(function(t){return[2,null]}))}))},t.prototype.generateFlatsContentWithOptionalElements=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r,o,s,l,c=this;return a(this,(function(a){switch(a.label){case 0:return e=[],[4,this.generateFlatsComposite(t)];case 1:return n=a.sent(),e.push.apply(e,n),i=function(){var i=A.clone(t);return null!==n&&0!==n.length&&(i.yTop=A.mergeRects.apply(A,e).yBot+c.controller.unitHeight*A.GAP_BETWEEN_ROWS),i},this.question.hasComment?(o=(r=e).push,[4,this.generateFlatsComment(i())]):[3,3];case 2:o.apply(r,[a.sent()]),a.label=3;case 3:return this.question.hasDescriptionUnderInput?(l=(s=e).push,[4,this.generateFlatDescription(i())]):[3,5];case 4:l.apply(s,[a.sent()]),a.label=5;case 5:return[2,e]}}))}))},t.prototype.generateFlats=function(e){return s(this,void 0,void 0,(function(){var n,i,r,o,s,l,c,h,u,f,d,p;return a(this,(function(a){switch(a.label){case 0:switch(this.controller.pushMargins(),this.controller.margins.left+=this.controller.measureText(this.question.indent).width,n={xLeft:e.xLeft+this.controller.measureText(this.question.indent).width,yTop:e.yTop},i=[],r=this.question.getTitleLocation(),r=this.question.hasTitle?r:"hidden"){case"top":case"default":return[3,1];case"bottom":return[3,4];case"left":return[3,7];case"hidden":case A.TITLE_LOCATION_MATRIX:return[3,10]}return[3,10];case 1:return[4,this.generateFlatHeader(n)];case 2:return c=a.sent(),(u=A.createPoint(c)).xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,c.addBrick(A.createRowlineFlat(A.createPoint(c),this.controller)),u.yTop+=this.controller.unitHeight*t.CONTENT_GAP_VERT_SCALE+A.EPSILON,this.controller.pushMargins(),this.controller.margins.left+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,[4,this.generateFlatsContentWithOptionalElements(u)];case 3:return h=a.sent(),this.controller.popMargins(),null!==h&&0!==h.length&&c.addBrick(h.shift()),i.push(c),i.push.apply(i,h),[3,12];case 4:return u=A.clone(n),this.controller.pushMargins(),u.xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,this.controller.margins.left+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,[4,this.generateFlatsContentWithOptionalElements(u)];case 5:return h=a.sent(),this.controller.popMargins(),i.push.apply(i,h),o=n,0!==i.length&&(o.yTop=i[i.length-1].yBot),o.yTop+=this.controller.unitHeight*t.CONTENT_GAP_VERT_SCALE,l=(s=i).push,[4,this.generateFlatHeader(o)];case 6:return l.apply(s,[a.sent()]),[3,12];case 7:return this.controller.pushMargins(this.controller.margins.left,this.controller.paperWidth-this.controller.margins.left-A.getPageAvailableWidth(this.controller)*A.MULTIPLETEXT_TEXT_PERS),[4,this.generateFlatHeader(n)];case 8:return c=a.sent(),u=A.createPoint(c,!1,!0),this.controller.popMargins(),u.xLeft+=this.controller.unitWidth*t.CONTENT_GAP_HOR_SCALE,this.controller.margins.left=u.xLeft,[4,this.generateFlatsContentWithOptionalElements(u)];case 9:return null!==(h=a.sent())&&0!==h.length&&c.addBrick(h.shift()),i.push(c),i.push.apply(i,h),[3,12];case 10:return u=A.clone(n),this.controller.pushMargins(),r!==A.TITLE_LOCATION_MATRIX&&(u.xLeft+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE,this.controller.margins.left+=this.controller.unitWidth*t.CONTENT_INDENT_SCALE),d=(f=i.push).apply,p=[i],[4,this.generateFlatsContentWithOptionalElements(u)];case 11:return d.apply(f,p.concat([a.sent()])),this.controller.popMargins(),[3,12];case 12:return this.controller.popMargins(),[2,i]}}))}))},Object.defineProperty(t.prototype,"shouldRenderAsComment",{get:function(){return A.shouldRenderReadOnly(this.question,this.controller)},enumerable:!1,configurable:!0}),t.CONTENT_GAP_VERT_SCALE=.5,t.CONTENT_GAP_HOR_SCALE=1,t.CONTENT_INDENT_SCALE=1,t.DESC_GAP_SCALE=.0625,t}();c.Serializer.addProperty("question",{name:"readonlyRenderAs",default:"auto",choices:["auto","text","acroform"],visible:!1});var T=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,A.createTextFlat(t,this.question,this.controller,"".concat(this.question.displayValue),b)];case 1:return[2,[e.sent()]]}}))}))},e}(x),F=function(){function t(){this.questions={}}return t.getInstance=function(){return t.instance},t.prototype.register=function(t,e){this.questions[t]=e},t.prototype.isTypeRegistered=function(t){return!!this.questions[t]},t.prototype.getRenderer=function(t){return this.questions[t]},t.prototype.create=function(t,e,n,i){var r,o=void 0===i?e.getType():i,s=this.getRenderer(o);return s||(s=(null===(r=e.customWidget)||void 0===r?void 0:r.pdfRender)?x:T),new s(t,e,n)},t.register=function(t,e){this.getInstance().register(t,e)},t.getRenderer=function(t){return this.getInstance().getRenderer(t)},t.instance=new t,t}(),_=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return this.controller.fontStyle="bold",[4,t.prototype.renderInteractive.call(this)];case 1:return e.sent(),this.controller.fontStyle="normal",[2]}}))}))},e}(b),w=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return e=this.controller.fontSize,this.controller.fontSize=e*A.TITLE_PANEL_FONT_SIZE_SCALE,[4,t.prototype.renderInteractive.call(this)];case 1:return n.sent(),this.controller.fontSize=e,[2]}}))}))},e}(_),R=function(t){function e(e,n,i,r){return t.call(this,e,n,i,r)||this}return n(e,t),e}(b),C=function(t){function e(e,n,i,r,o,s,a,l,c,h){var u=t.call(this,e,n,i)||this;return u.isQuestion=r,u.fieldName=o,u.value=s,u.placeholder=a,u.isReadOnly=l,u.isMultiline=c,u.inputType=h,u.question=e,u}return n(e,t),e.prototype.renderColorQuestion=function(){var t=this.controller.doc.getFillColor();this.controller.doc.setFillColor(this.question.value||"black"),this.controller.doc.rect(this.xLeft,this.yTop,this.width,this.height,"F"),this.controller.doc.setFillColor(t)},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){var t,e;return a(this,(function(n){return"color"===this.inputType?(this.renderColorQuestion(),[2]):((t="password"===this.inputType?new this.controller.doc.AcroFormPasswordField:new this.controller.doc.AcroFormTextField).fieldName=this.fieldName,t.fontName=this.controller.fontName,t.fontSize=this.fontSize,t.isUnicode=A.isCustomFont(this.controller,t.fontName),"password"!==this.inputType?(t.V=" "+this.getCorrectedText(this.value),t.DV=" "+this.getCorrectedText(this.placeholder)):t.value="",t.multiline=this.isMultiline,t.readOnly=this.isReadOnly,t.color=this.textColor,e=A.formScale(this.controller,this),t.maxFontSize=this.controller.fontSize*e,t.Rect=A.createAcroformRect(A.scaleRect(this,e)),this.controller.doc.addField(t),A.renderFlatBorders(this.controller,this),[2])}))}))},e.prototype.shouldRenderFlatBorders=function(){return"input"===c.settings.readOnlyTextRenderMode},e.prototype.getShouldRenderReadOnly=function(){return A.shouldRenderReadOnly(this.question,this.controller,this.isReadOnly)},Object.defineProperty(e.prototype,"textBrick",{get:function(){return this._textBrick},set:function(t){var e=this;this._textBrick=t;var n=t.unfold(),i=n.length,r=0,o={},s=function(t){if(e.shouldRenderFlatBorders()){r++;var n=e.controller.getCurrentPageIndex();if(o[n]||(o[n]=[]),o[n].push(t),r>=i){var s=Object.keys(o),a=1==s.length;s.forEach((function(t){var i=new u;o[t].forEach((function(t){i.addBrick(t)}));var r=e.controller.unitHeight*A.VALUE_READONLY_PADDING_SCALE,s={xLeft:e.xLeft,xRight:e.xRight,width:e.width,yTop:a?e.yTop:i.yTop-r,yBot:a?e.yBot:i.yBot+r,height:a?e.height:i.height+2*r,formBorderColor:e.formBorderColor};e.controller.setPage(Number(t)),A.renderFlatBorders(e.controller,s),e.controller.setPage(n)}))}}};n.forEach((function(t){t.afterRenderCallback=s.bind(e,t)}))},enumerable:!1,configurable:!0}),e.prototype.renderReadOnly=function(){return s(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return this.controller.pushMargins(this.xLeft,this.controller.paperWidth-this.xRight),"color"!==this.inputType?[3,1]:(this.renderColorQuestion(),[3,3]);case 1:return[4,this.textBrick.render()];case 2:t.sent(),t.label=3;case 3:return this.controller.popMargins(),[2]}}))}))},e.prototype.unfold=function(){return this.getShouldRenderReadOnly()&&"color"!==this.inputType?this.textBrick.unfold():t.prototype.unfold.call(this)},e.prototype.translateX=function(t){var e=t(this.xLeft,this.xRight);this._xLeft=e.xLeft,this._xRight=e.xRight,this.textBrick&&this.textBrick.translateX(t)},e.prototype.setXLeft=function(e){var n=e-this._xLeft;t.prototype.setXLeft.call(this,e),this.textBrick&&(this.textBrick.xLeft=this.textBrick.xLeft+n)},e.prototype.setXRight=function(e){var n=e-this._xRight;t.prototype.setXRight.call(this,e),this.textBrick&&(this.textBrick.xRight=this.textBrick.xRight+n)},e.prototype.setYTop=function(e){var n=e-this._yTop;t.prototype.setYTop.call(this,e),this.textBrick&&(this.textBrick.yTop=this.textBrick.yTop+n)},e.prototype.setYBottom=function(e){var n=e-this._yBot;t.prototype.setYBottom.call(this,e),this.textBrick&&(this.textBrick.yBot=this.textBrick.yBot+n)},e}(v),P=function(t){function e(e,n,i,r,o,s){void 0===r&&(r=!0),void 0===o&&(o=!1),void 0===s&&(s=0);var a=t.call(this,e,n,i,r,e.id+(r?"":"_comment"+s),A.getQuestionOrCommentValue(e,r),r&&e.locPlaceHolder?A.getLocString(e.locPlaceHolder):"",e.isReadOnly,o,e.inputType)||this;return a.isQuestion=r,a.isMultiline=o,a}return n(e,t),e}(C),E=function(t){function e(e,n,i,r,o){void 0===o&&(o=0);var s=t.call(this,e,n,i,r,!0,o)||this;return s.controller=n,s}return n(e,t),e.prototype.shouldRenderFlatBorders=function(){return this.isQuestion&&"comment"!==this.question.getType()?t.prototype.shouldRenderFlatBorders.call(this):"textarea"===c.settings.readOnlyCommentRenderMode},e}(P),O=function(t){function e(n,i){var r=t.call(this,n.question,n.controller,n,n.text)||this;return r.link=i,r.textColor=e.COLOR,r}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){var n,i,r;return a(this,(function(o){switch(o.label){case 0:return n=this.controller.doc.getTextColor(),this.controller.doc.setTextColor(A.BACKGROUND_COLOR),i=this.controller.unitHeight*(this.controller.doc.getLineHeightFactor()-e.SCALE_FACTOR_MAGIC),r=this.yTop+(this.yBot-this.yTop)-i,this.controller.doc.textWithLink(this.text,this.xLeft,r,{url:this.link}),[4,t.prototype.renderInteractive.call(this)];case 1:return o.sent(),this.controller.doc.setTextColor(n),[2]}}))}))},e.prototype.renderReadOnly=function(){return s(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return"text"!==A.getReadonlyRenderAs(this.question,this.controller)?[2,this.renderInteractive()]:[4,t.prototype.renderInteractive.call(this)];case 1:return e.sent(),[2]}}))}))},e.SCALE_FACTOR_MAGIC=.955,e.COLOR="#0000EE",e}(b),S=function(t){function e(e,n,i,r,o){void 0===o&&(o=!1);var s=t.call(this,e,n,i)||this;return s.html=r,s.margins=o?{top:0,bottom:0}:{top:n.margins.top,bottom:n.margins.bot},s}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){var t,e=this;return a(this,(function(n){switch(n.label){case 0:return t=this.controller.fontSize,this.controller.fontSize=this.fontSize,[4,new Promise((function(t){e.controller.doc.fromHTML(e.html,e.xLeft,e.yTop,{width:e.width,pagesplit:!0},(function(){[].slice.call(document.querySelectorAll(".sjs-pdf-hidden-html-div")).forEach((function(t){t.parentNode.removeChild(t)})),t()}),e.margins)}))];case 1:return n.sent(),this.controller.fontSize=t,[2]}}))}))},e}(v),L=function(t){function e(e,n,i,r,o,s){var a=t.call(this,e,n,{xLeft:r.xLeft,xRight:r.xLeft+(o||0),yTop:r.yTop,yBot:r.yTop+(s||0)})||this;return a.image=i,a.originalWidth=o,a.originalHeight=s,a.isPageBreak=void 0===a.originalHeight,a}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){var t=this;return a(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){try{t.controller.doc.addImage(t.image,"PNG",t.xLeft,t.yTop,t.originalWidth,t.originalHeight)}finally{e()}}))];case 1:return e.sent(),[2]}}))}))},e}(v),B=function(t){function e(e,n,i){void 0===n&&(n=null),void 0===i&&(i=!1);var r=t.call(this,null,n,e)||this;return r.controller=n,r.isBorderVisible=!1,r.isBorderVisible=i,r}return n(e,t),e.prototype.resizeBorder=function(t){var e=t?1:-1,n=this.controller.doc.getFontSize()*A.VALUE_READONLY_PADDING_SCALE;this.xLeft-=e*n,this.xRight+=e*n,this.yBot+=e*n},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){return a(this,(function(t){return this.isBorderVisible&&(this.resizeBorder(!0),A.renderFlatBorders(this.controller,this),this.resizeBorder(!1)),[2]}))}))},e}(v),A=function(){function e(){}return e.parseWidth=function(t,e,n,i){if(void 0===n&&(n=1),0===t.indexOf("calc"))return e/n;var r,o=parseFloat(t);switch(t.replace(/[^A-Za-z%]/g,"")||i){case"pt":r=1;break;case"mm":r=72/25.4;break;case"cm":r=72/2.54;break;case"in":r=72;break;case"px":r=.75;break;case"pc":case"em":r=12;break;case"ex":r=6;break;default:r=e/100}return Math.min(o*r,e)},e.pxToPt=function(t){return"string"==typeof t?(isNaN(Number(t))||(t+="px"),e.parseWidth(t,Number.MAX_VALUE)):72*t/96},e.mergeRects=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n={xLeft:t[0].xLeft,xRight:t[0].xRight,yTop:t[0].yTop,yBot:t[0].yBot};return t.forEach((function(t){n.xLeft=Math.min(n.xLeft,t.xLeft),n.xRight=Math.max(n.xRight,t.xRight),n.yTop=Math.min(n.yTop,t.yTop),n.yBot=Math.max(n.yBot,t.yBot)})),n},e.createPoint=function(t,e,n){return void 0===e&&(e=!0),void 0===n&&(n=!1),{xLeft:e?t.xLeft:t.xRight,yTop:n?t.yTop:t.yBot}},e.createRect=function(t,e,n){return{xLeft:t.xLeft,xRight:t.xLeft+e,yTop:t.yTop,yBot:t.yTop+n}},e.createHeaderRect=function(t){return{xLeft:0,xRight:t.paperWidth,yTop:0,yBot:t.margins.top}},e.createFooterRect=function(t){return{xLeft:0,xRight:t.paperWidth,yTop:t.paperHeight-t.margins.bot,yBot:t.paperHeight}},e.chooseHtmlFont=function(t){return t.useCustomFontInHtml?t.fontName:this.STANDARD_FONT},e.generateCssTextRule=function(t,e,n){return'"font-size: '.concat(t,"pt; font-weight: ").concat(e,"; font-family: ").concat(n,"; color: ").concat(this.TEXT_COLOR,';"')},e.createHtmlContainerBlock=function(t,e,n){var i=this.chooseHtmlFont(e);return'<div class="__surveypdf_html" style='.concat(this.generateCssTextRule(e.fontSize,e.fontStyle,i),">")+"<style>.__surveypdf_html p { margin: 0; line-height: ".concat(e.fontSize,"pt } body { margin: 0; }</style>").concat(t,"</div>")},e.splitHtmlRect=function(t,e){var n=[],i=e.height,r=t.doc.getFontSize();e.yBot=e.yTop+r;var o=Math.floor(i/r)-1;n.push(e);for(var s=this.createPoint(e),a=0;a<o;a++)n.push(new B(this.createRect(s,e.width,r))),s.yTop+=r;var c=i-(o+1)*r;return c>0&&n.push(new B(this.createRect(s,e.width,c))),new(u.bind.apply(u,l([void 0],n,!1)))},e.createPlainTextFlat=function(t,e,n,i,r){var o=this,s=n.doc.splitTextToSize(i,n.paperWidth-n.margins.right-t.xLeft),a=this.clone(t),l=new u;return s.forEach((function(t){var i=n.measureText(t);l.addBrick(new r(e,n,o.createRect(a,i.width,i.height),t)),a.yTop+=i.height})),l},e.createTextFlat=function(t,e,n,i,r){return s(this,void 0,void 0,(function(){var o,s;return a(this,(function(a){switch(a.label){case 0:return"string"!=typeof i&&this.hasHtml(i)?[3,1]:[2,this.createPlainTextFlat(t,e,n,"string"==typeof i?i:this.getLocString(i),r)];case 1:return o=this.splitHtmlRect,s=[n],[4,this.createHTMLFlat(t,e,n,this.createHtmlContainerBlock(this.getLocString(i),n,"standard"))];case 2:return[2,o.apply(this,s.concat([a.sent()]))]}}))}))},e.hasHtml=function(t){var e=/<\/?[a-z][\s\S]*>/i;return t.hasHtml&&(e.test(t.renderedText)||e.test(t.renderedHtml))},e.getHtmlMargins=function(t,e){var n=t.paperWidth-e.xLeft-t.margins.right;return{top:t.margins.top,bottom:t.margins.bot,width:n>t.unitWidth?n:t.unitWidth}},e.createHTMLRect=function(t,n,i,r){var o=n.paperHeight-n.margins.bot-n.margins.top,s=(n.helperDoc.getNumberOfPages()-1)*(n.fontSize*Math.floor(o/n.fontSize))+r-i.top+e.HTML_TAIL_TEXT_SCALE*n.fontSize,a=n.helperDoc.getNumberOfPages();n.helperDoc.addPage();for(var l=0;l<a;l++)n.helperDoc.deletePage(1);return e.createRect(t,i.width,s)},e.createHTMLFlat=function(t,n,i,r){return s(this,void 0,void 0,(function(){var o;return a(this,(function(s){switch(s.label){case 0:return o=this.getHtmlMargins(i,t),[4,new Promise((function(s){i.helperDoc.fromHTML(r,t.xLeft,o.top,{pagesplit:!0,width:o.width},(function(a){var l=e.createHTMLRect(t,i,o,a.y);s(new S(n,i,l,r))}),o)}))];case 1:return[2,s.sent()]}}))}))},e.generateFontFace=function(t,e,n){return"@font-face { font-family: ".concat(t,"; ")+"src: url(data:application/font-woff;charset=utf-8;base64,".concat(e,") format('woff'); ")+"font-weight: ".concat(n,"; }")},e.generateFontFaceWithItalicStyle=function(t,e,n){return"@font-face { font-family: ".concat(t,"; ")+"src: url(data:application/font-woff;charset=utf-8;base64,".concat(e,") format('woff'); ")+"font-weight: ".concat(n,"; font-style: italic}")},e.htmlToXml=function(t){var e=document.implementation.createHTMLDocument("");return e.write(t.replace(/\#/g,"%23")),e.documentElement.setAttribute("xmlns",e.documentElement.namespaceURI),e.body.style.margin="unset",(new XMLSerializer).serializeToString(e.body).replace(/%23/g,"#")},e.createSvgContent=function(t,e,n){var i=this,r=document.createElement("style");r.innerHTML=".__surveypdf_html p { margin: unset; line-height: 22px; } body { margin: unset; }",document.body.appendChild(r);var o=document.createElement("div");o.className="__surveypdf_html",o.style.display="block",o.style.position="fixed",o.style.top="-10000px",o.style.left="-10000px",o.style.width=e/72*96+"px",o.style.boxSizing="initial",o.style.color="initial",o.style.fontFamily="initial",o.style.font="initial",o.style.lineHeight="initial",o.insertAdjacentHTML("beforeend",t),document.body.appendChild(o);var s=o.offsetWidth,a=o.offsetHeight;o.remove(),r.remove();var l="";return n.useCustomFontInHtml?l="<defs><style>".concat(this.generateFontFace(n.fontName,n.base64Normal,"normal"))+" ".concat(this.generateFontFace(n.fontName,n.base64Bold,"bold"),"</style></defs>"):Object.keys(k.customFonts).forEach((function(t){var e=k.customFonts[t];Object.keys(e).forEach((function(n){l+="".concat("normal"===n||"bold"===n?i.generateFontFace(t,e[n],n):i.generateFontFaceWithItalicStyle(t,e[n],"italic"===n?"normal":"bold"))})),l="<defs><style>"+l+"</style></defs>"})),{svg:'<svg xmlns="http://www.w3.org/2000/svg" width="'.concat(s,'px" height="').concat(a,'px">')+l+"<style>.__surveypdf_html p { margin: unset; line-height: 22px; }</style>"+'<foreignObject width="'.concat(s,'px" height="').concat(a,'px">')+this.htmlToXml(t)+"</foreignObject></svg>",divWidth:s,divHeight:a}},e.setCanvas=function(t,n,i,r){t.width=n*e.HTML_TO_IMAGE_QUALITY,t.height=i*e.HTML_TO_IMAGE_QUALITY;var o=t.getContext("2d");o.scale(e.HTML_TO_IMAGE_QUALITY,e.HTML_TO_IMAGE_QUALITY),o.fillStyle=e.BACKGROUND_COLOR,o.fillRect(0,0,n,i),o.drawImage(r,0,0)},e.htmlToImage=function(t,n,i){return s(this,void 0,void 0,(function(){var r,o,s,l,c,h;return a(this,(function(a){return r=e.createSvgContent(t,n,i),o=r.svg,s=r.divWidth,l=r.divHeight,c="data:image/svg+xml;base64,"+btoa(unescape(encodeURIComponent(o))),(h=new Image).crossOrigin="anonymous",h.src=c,[2,new Promise((function(t){h.onload=function(){var n=document.createElement("canvas");e.setCanvas(n,s,l,h);var i=n.toDataURL("image/jpeg",e.HTML_TO_IMAGE_QUALITY);n.remove(),t({url:i,aspect:s/l})},h.onerror=function(){t({url:"data:,",aspect:n/this.EPSILON})}}))]}))}))},e.createBoldTextFlat=function(t,e,n,i){return s(this,void 0,void 0,(function(){var r;return a(this,(function(o){switch(o.label){case 0:return n.fontStyle="bold",[4,this.createTextFlat(t,e,n,i,_)];case 1:return r=o.sent(),n.fontStyle="normal",[2,r]}}))}))},e.createTitleFlat=function(t,e,n){return s(this,void 0,void 0,(function(){var i,r,o,s,l,c,h,f,d,p,g;return a(this,(function(a){switch(a.label){case 0:return i=new u,r=this.clone(t),o=n.fontSize,n.fontSize*=this.TITLE_FONT_SCALE,e.no?(s=e.no+" ",l=void 0,this.hasHtml(e.locTitle)?(n.fontStyle="bold",n.pushMargins(),n.margins.right=n.paperWidth-n.margins.left-n.measureText(s,"bold").width,[4,this.createHTMLFlat(r,e,n,this.createHtmlContainerBlock(s,n,"standard"))]):[3,2]):[3,5];case 1:return l=a.sent(),n.popMargins(),n.fontStyle="normal",[3,4];case 2:return[4,this.createBoldTextFlat(r,e,n,s)];case 3:l=a.sent(),a.label=4;case 4:i.addBrick(l),r.xLeft=l.xRight,a.label=5;case 5:return n.pushMargins(),n.margins.left=r.xLeft,[4,this.createBoldTextFlat(r,e,n,e.locTitle)];case 6:return c=a.sent(),i.addBrick(c),n.popMargins(),e.isRequired?(h=e.requiredText,this.hasHtml(e.locTitle)?(r=this.createPoint(c.unfold()[0],!1,!1),n.fontStyle="bold",n.pushMargins(),n.margins.right=n.paperWidth-n.margins.left-n.measureText(h,"bold").width,d=(f=i).addBrick,[4,this.createHTMLFlat(r,e,n,this.createHtmlContainerBlock(h,n,"standard"))]):[3,8]):[3,10];case 7:return d.apply(f,[a.sent()]),n.popMargins(),n.fontStyle="normal",[3,10];case 8:return r=this.createPoint(c.unfold().pop(),!1,!0),g=(p=i).addBrick,[4,this.createBoldTextFlat(r,e,n,h)];case 9:g.apply(p,[a.sent()]),a.label=10;case 10:return n.fontSize=o,[2,i]}}))}))},e.createTitleSurveyPanelFlat=function(t,e,n,i){return s(this,void 0,void 0,(function(){var r,o;return a(this,(function(s){switch(s.label){case 0:return r=e.fontSize,e.fontSize=r*i,e.fontStyle="bold",[4,this.createTextFlat(t,null,e,n,w)];case 1:return o=s.sent(),e.fontStyle="normal",e.fontSize=r,[2,o]}}))}))},e.createTitleSurveyFlat=function(t,e,n){return s(this,void 0,void 0,(function(){return a(this,(function(i){switch(i.label){case 0:return[4,this.createTitleSurveyPanelFlat(t,e,n,this.TITLE_SURVEY_FONT_SIZE_SCALE)];case 1:return[2,i.sent()]}}))}))},e.createTitlePanelFlat=function(t,e,n){return s(this,arguments,void 0,(function(t,e,n,i){return void 0===i&&(i=!1),a(this,(function(r){switch(r.label){case 0:return[4,this.createTitleSurveyPanelFlat(t,e,n,i?this.TITLE_PAGE_FONT_SIZE_SCALE:this.TITLE_PANEL_FONT_SIZE_SCALE)];case 1:return[2,r.sent()]}}))}))},e.createDescFlat=function(t,e,n,i){return s(this,void 0,void 0,(function(){var r,o;return a(this,(function(s){switch(s.label){case 0:return r=n.fontSize,n.fontSize=r*this.DESCRIPTION_FONT_SIZE_SCALE,[4,this.createTextFlat(t,e,n,i,R)];case 1:return o=s.sent(),n.fontSize=r,[2,o]}}))}))},e.getReadonlyRenderAs=function(t,e){return"auto"===t.readonlyRenderAs?e.readonlyRenderAs:t.readonlyRenderAs},e.createCommentFlat=function(t,n,i,r){return s(this,arguments,void 0,(function(t,n,i,r,o){var s,l,c,h,u,f,d,p;return void 0===o&&(o={}),a(this,(function(a){switch(a.label){case 0:return s=this.createTextFieldRect(t,i,null!==(f=o.rows)&&void 0!==f?f:1),(null!==(d=o.readOnly)&&void 0!==d?d:e.shouldRenderReadOnly(n,i))?(c=null!==(p=o.value)&&void 0!==p?p:this.getQuestionOrCommentValue(n,r),[4,this.createReadOnlyTextFieldTextFlat(t,i,n,c)]):[3,2];case 1:l=a.sent(),h=i.unitHeight*this.VALUE_READONLY_PADDING_SCALE,l.yBot+h>s.yBot&&(s.yBot=l.yBot+h),a.label=2;case 2:return u=new E(n,i,s,r,o.index),null!==o.readOnly&&void 0!==o.readOnly&&(u.isReadOnly=o.readOnly),l&&(u.textBrick=l),[2,u]}}))}))},e.getQuestionOrCommentValue=function(t,e){return void 0===e&&(e=!0),e?void 0!==t.value&&null!==t.value?t.value:"":void 0!==t.comment&&null!==t.comment?t.comment:""},e.getQuestionOrCommentDisplayValue=function(t,n){return void 0===n&&(n=!0),n?t.displayValue:e.getQuestionOrCommentValue(t,n)},Object.defineProperty(e,"hasDocument",{get:function(){return"undefined"!=typeof document},enumerable:!1,configurable:!0}),e.getImageBase64=function(t){return s(this,void 0,void 0,(function(){var e;return a(this,(function(n){return(e=new Image).crossOrigin="anonymous",[2,new Promise((function(n){e.onload=function(){var t=document.createElement("canvas"),i=t.getContext("2d");t.height=e.naturalHeight,t.width=e.naturalWidth,i.drawImage(e,0,0);var r=t.toDataURL();n(r)},e.onerror=function(){n("")},e.src=t}))]}))}))},e.getImageLink=function(t,n,i){return s(this,void 0,void 0,(function(){var r,o,s,l;return a(this,(function(a){switch(a.label){case 0:return r=96/72,this.shouldConvertImageToPng?[4,e.getImageBase64(n.link)]:[3,2];case 1:return s=a.sent(),[3,3];case 2:s=n.link,a.label=3;case 3:return o=s,"function"==typeof XMLSerializer&&i?(l="<div style='overflow: hidden; width: ".concat(n.width*r,"px; height: ").concat(n.height*r,"px;'>\n <img src='").concat(o,"' style='object-fit: ").concat(n.objectFit,"; width: 100%; height: 100%;'/>\n </div>"),[4,e.htmlToImage(l,n.width,t)]):[3,5];case 4:o=a.sent().url,a.label=5;case 5:return[2,o]}}))}))},e.createImageFlat=function(t,n,i,r,o){return s(this,void 0,void 0,(function(){var s,l,c;return a(this,(function(a){switch(a.label){case 0:return e.inBrowser?(r.objectFit=n&&n.imageFit?n.imageFit:r.objectFit||"contain",(null!=o?o:i.applyImageFit)&&r.width>i.paperWidth-i.margins.left-i.margins.right&&(s=i.paperWidth-i.margins.left-i.margins.right,r.height*=s/r.width,r.width=s),c="<img src='".concat,[4,e.getImageLink(i,r,null!=o?o:i.applyImageFit)]):[3,2];case 1:return l=c.apply("<img src='",[a.sent(),"' width='"]).concat(r.width,"' height='").concat(r.height,"'/>"),[2,new S(n,i,this.createRect(t,r.width,r.height),l,!0)];case 2:return[2,new L(n,i,r.link,t,r.width,r.height)]}}))}))},e.canPreviewImage=function(t,e,n){return t.canPreviewImage(e)},e.getImageSize=function(t){return s(this,void 0,void 0,(function(){return a(this,(function(n){switch(n.label){case 0:return e.inBrowser?[3,2]:[4,new Promise((function(t){return t({width:void 0,height:void 0})}))];case 1:case 3:return[2,n.sent()];case 2:return[4,new Promise((function(e){var n=new Image;n.src=t,n.onload=function(){return e({width:n.width,height:n.height})},n.onerror=function(){return e(null)}}))]}}))}))},e.createRowlineFlat=function(t,e,n,i){var r=void 0===n?e.paperWidth-e.margins.right:t.xLeft+n;return r=r>t.xLeft?r:t.xLeft+this.EPSILON,new f(e,{xLeft:t.xLeft,xRight:r,yTop:t.yTop+this.EPSILON,yBot:t.yTop+this.EPSILON},void 0===i?null:i)},e.createLinkFlat=function(t,e,n,i,r){return s(this,void 0,void 0,(function(){var o,s,l=this;return a(this,(function(a){switch(a.label){case 0:return[4,this.createTextFlat(t,e,n,i,b)];case 1:return o=a.sent(),s=new u,o.unfold().forEach((function(t){s.addBrick(new O(t,r));var e=l.createPoint(s);s.addBrick(l.createRowlineFlat(e,n,s.width,O.COLOR))})),[2,s]}}))}))},e.createAcroformRect=function(t){return[t.xLeft,t.yTop,t.xRight-t.xLeft,t.yBot-t.yTop]},e.createTextFieldRect=function(t,e,n){void 0===n&&(n=1);var i=e.paperWidth-t.xLeft-e.margins.right;i=Math.max(i,e.unitWidth);var r=e.unitHeight*n;return this.createRect(t,i,r)},e.createReadOnlyTextFieldTextFlat=function(t,e,n,i){return s(this,void 0,void 0,(function(){var r,o;return a(this,(function(s){switch(s.label){case 0:return r=e.unitWidth*this.VALUE_READONLY_PADDING_SCALE,t.yTop+=r,t.xLeft+=r,e.pushMargins(t.xLeft,e.margins.right+r),[4,this.createTextFlat(t,n,e,i.toString(),b)];case 1:return o=s.sent(),e.popMargins(),[2,o]}}))}))},e.renderFlatBorders=function(t,e){var n,i,r,o,s,a;if(this.FORM_BORDER_VISIBLE){e.rounded=null===(r=e.rounded)||void 0===r||r,e.outside=null!==(o=e.outside)&&void 0!==o&&o;var c=Math.min(e.width,e.height),h=this.getBorderWidth(t),u=t.unitHeight*this.VISIBLE_BORDER_SCALE*this.BORDER_SCALE,f=e.outside?(c+h)/c-u/c:(c-h)/c+u/c,d=t.doc.getDrawColor();t.doc.setDrawColor(e.formBorderColor),t.doc.setLineWidth(u);var p=this.scaleRect(e,f);if(e.dashStyle){var g=e.dashStyle,m=2*(Math.abs(p.yTop-p.yBot)+Math.abs(p.xLeft-p.xRight)),y=g.dashArray[0]+(null!==(s=g.dashArray[1])&&void 0!==s?s:g.dashArray[0]),v=g.dashArray[0]+m%y/Math.floor(m/y);t.doc.setLineDashPattern([v,null!==(a=g.dashArray[1])&&void 0!==a?a:g.dashArray[0]],g.dashPhase)}if((n=t.doc).rect.apply(n,this.createAcroformRect(p)),e.rounded){var b=t.unitHeight*this.UNVISIBLE_BORDER_SCALE*this.BORDER_SCALE,x=1-b/c,T=this.RADIUS_SCALE*b;t.doc.setDrawColor(this.BACKGROUND_COLOR),t.doc.setLineWidth(b),(i=t.doc).roundedRect.apply(i,l(l([],this.createAcroformRect(this.scaleRect(e,x)),!1),[T,T],!1))}e.dashStyle&&t.doc.setLineDashPattern([]),t.doc.setDrawColor(d)}},e.getLocString=function(t){return this.hasHtml(t)?t.renderedHtml:t.renderedText||t.renderedHtml},e.getDropdownQuestionValue=function(t){var e=t;return e.isOtherSelected?e.otherText:t.displayValue?t.displayValue:e.showOptionsCaption?e.optionsCaption:""},e.getContentQuestion=function(t){return t.contentQuestion?t.contentQuestion:t},e.getContentQuestionTypeRenderAs=function(t,e){var n=t.renderAs;if("boolean"===t.getType()&&e.options.useLegacyBooleanRendering&&(n="checkbox"),"default"!==n){var i="".concat(t.getType(),"-").concat(n);if(F.getInstance().isTypeRegistered(i))return i}return t.getType()},e.getContentQuestionType=function(t,e){return t.customWidget?t.customWidget.pdfQuestionType:t.contentQuestion?"custom_model":this.getContentQuestionTypeRenderAs(t,e)},e.getRatingMinWidth=function(t){return t.measureText(this.RATING_MIN_WIDTH).width},e.getRatingItemText=function(t,e,n){var i=new c.LocalizableString(n.owner,n.useMarkdown);return i.text=this.getLocString(n),0===e&&t.minRateDescription?i.text=t.locMinRateDescription.text+" "+this.getLocString(n):e===t.visibleRateValues.length-1&&t.maxRateDescription&&(i.text=this.getLocString(n)+" "+t.locMaxRateDescription.text),i},e.getPageAvailableWidth=function(t){return t.paperWidth-t.margins.left-t.margins.right},e.getImagePickerAvailableWidth=function(t){var e=this.getPageAvailableWidth(t)-(this.IMAGEPICKER_COUNT-1)*t.unitHeight;return e>0?e:t.unitHeight},e.getColumnWidth=function(t,e){return(this.getPageAvailableWidth(t)-(e-1)*t.unitWidth*this.GAP_BETWEEN_COLUMNS)/e},e.setColumnMargins=function(t,e,n){var i=this.getColumnWidth(t,e);t.margins.left=t.margins.left+n*(i+t.unitWidth*this.GAP_BETWEEN_COLUMNS),t.margins.right=t.margins.right+(e-n-1)*(i+t.unitWidth*this.GAP_BETWEEN_COLUMNS)},e.moveRect=function(t,e,n){return void 0===e&&(e=t.xLeft),void 0===n&&(n=t.yTop),{xLeft:e,yTop:n,xRight:e+t.xRight-t.xLeft,yBot:n+t.yBot-t.yTop}},e.scaleRect=function(t,e){var n=Math.min(t.xRight-t.xLeft,t.yBot-t.yTop)*(1-e)/2;return{xLeft:t.xLeft+n,yTop:t.yTop+n,xRight:t.xRight-n,yBot:t.yBot-n}},e.getBorderWidth=function(t){return 2*t.unitWidth*this.BORDER_SCALE},e.formScale=function(t,e){var n=Math.min(e.width,e.height);return(n-this.getBorderWidth(t))/n},e.generateQuestionFlats=function(e,n,i,r){return s(this,void 0,void 0,(function(){var o,s,c;return a(this,(function(a){switch(a.label){case 0:return o=this.getContentQuestionType(i,e),[4,F.getInstance().create(e,i,n,o).generateFlats(r)];case 1:return s=a.sent(),c=new p(r,s,i,n,F.getInstance(),t),i.customWidget&&i.customWidget.isFit(i)&&i.customWidget.pdfRender&&e.onRenderQuestion.unshift(i.customWidget.pdfRender),[4,e.onRenderQuestion.fire(e,c)];case 2:return a.sent(),[2,l([],c.bricks,!0)]}}))}))},e.isFontExist=function(t,e){return t.doc.internal.getFont(e).fontName===e},e.isCustomFont=function(t,e){return t.doc.internal.getFont(e).encoding===this.CUSTOM_FONT_ENCODING},e.fixFont=function(t){this.isCustomFont(t,t.fontName)&&(t.doc.text("load font",0,0),t.doc.deletePage(1),t.addPage())},e.clone=function(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},e.shouldRenderReadOnly=function(t,n,i){return(!!t&&t.isReadOnly||i)&&"acroform"!==e.getReadonlyRenderAs(t,n)||(null==n?void 0:n.compress)},e.isSizeEmpty=function(t){return!t||"auto"===t},e.isHeightEmpty=function(t){return this.isSizeEmpty(t)||"100%"==t},e.getCorrectedImageSize=function(t,n){return s(this,void 0,void 0,(function(){var i,r,o,s,l,c,h,u,f,d;return a(this,(function(a){switch(a.label){case 0:return i=n.imageWidth,r=n.imageLink,o=n.imageHeight,s=n.defaultImageWidth,l=n.defaultImageHeight,i="number"==typeof i?i.toString():i,o="number"==typeof o?o.toString():o,c=i&&e.parseWidth(i,e.getPageAvailableWidth(t),1,"px"),h=o&&e.parseWidth(o,e.getPageAvailableWidth(t),1,"px"),s="number"==typeof s?s.toString():s,l="number"==typeof l?l.toString():l,u=s&&e.parseWidth(s,e.getPageAvailableWidth(t),1,"px"),f=l&&e.parseWidth(l,e.getPageAvailableWidth(t),1,"px"),e.isSizeEmpty(i)||e.isHeightEmpty(o)?[4,e.getImageSize(r)]:[3,2];case 1:d=a.sent(),e.isSizeEmpty(i)?e.isHeightEmpty(o)?d&&d.height&&d.width&&(h=e.parseWidth(d.height.toString(),e.getPageAvailableWidth(t),1,"px"),c=e.parseWidth(d.width.toString(),e.getPageAvailableWidth(t),1,"px")):d&&d.height&&(c=d.width*h/d.height):d&&d.width&&(h=d.height*c/d.width),a.label=2;case 2:return[2,{width:c||u||0,height:h||f||0}]}}))}))},e.EPSILON=2220446049250313e-30,e.TITLE_SURVEY_FONT_SIZE_SCALE=1.7,e.TITLE_PAGE_FONT_SIZE_SCALE=1.3,e.TITLE_PANEL_FONT_SIZE_SCALE=1.3,e.DESCRIPTION_FONT_SIZE_SCALE=2/3,e.OTHER_ROWS_COUNT=2,e.RATING_MIN_WIDTH=3,e.RATING_MIN_HEIGHT=2,e.RATING_COLUMN_WIDTH=5,e.MATRIX_COLUMN_WIDTH=5,e.IMAGEPICKER_COUNT=4,e.IMAGEPICKER_RATIO=4/3,e.MULTIPLETEXT_TEXT_PERS=Math.E/10,e.HTML_TAIL_TEXT_SCALE=.24,e.SELECT_ITEM_FLAT_SCALE=.95,e.GAP_BETWEEN_ROWS=.25,e.GAP_BETWEEN_COLUMNS=1.5,e.GAP_BETWEEN_ITEM_TEXT=.25,e.FORM_BORDER_VISIBLE=!0,e.BORDER_SCALE=.1,e.VISIBLE_BORDER_SCALE=.8,e.UNVISIBLE_BORDER_SCALE=.2,e.RADIUS_SCALE=3,e.TITLE_FONT_SCALE=1.1,e.VALUE_READONLY_PADDING_SCALE=.3,e.HTML_TO_IMAGE_QUALITY=1,e.FORM_BORDER_COLOR="#9f9f9f",e.TEXT_COLOR="#404040",e.BACKGROUND_COLOR="#FFFFFF",e.TITLE_LOCATION_MATRIX="matrix",e.STANDARD_FONT="helvetica",e.CUSTOM_FONT_ENCODING="Identity-H",e.inBrowser="function"==typeof Image,e.shouldConvertImageToPng=!0,e}();r(626),r(343);var I,N,M=function(){function t(e){var n=this;this._base64Normal=void 0,this._base64Bold=void 0,void 0===e.orientation?void 0===e.format||e.format[0]<e.format[1]?this._orientation="p":this._orientation="l":this._orientation=e.orientation,this._format=e.format||"a4",Array.isArray(this._format)&&(this._format=this._format.map((function(e){return e*t.MM_TO_PT}))),this._fontSize=e.fontSize||t.FONT_SIZE,e.fontName?this._fontName=e.fontName:t.SEGOE_BOLD||t.SEGOE_NORMAL?this._fontName="segoe":this._fontName=A.STANDARD_FONT,void 0===e.fontName||void 0===e.base64Normal&&void 0===e.base64Bold?"segoe"===this.fontName&&(this._base64Normal=t.SEGOE_NORMAL,this._base64Bold=t.SEGOE_BOLD):(this._base64Normal=e.base64Normal||e.base64Bold,this._base64Bold=e.base64Bold||e.base64Normal),this._margins=A.clone(e.margins),void 0===this._margins&&(this._margins={}),void 0===this._margins.top&&(this._margins.top=10),void 0===this._margins.bot&&(this._margins.bot=10),void 0===this._margins.left&&(this._margins.left=10),void 0===this._margins.right&&(this._margins.right=10),Object.keys(this._margins).forEach((function(e){n._margins[e]=n._margins[e]*t.MM_TO_PT})),this._htmlRenderAs=e.htmlRenderAs||"auto",this._matrixRenderAs=e.matrixRenderAs||"auto",this._readonlyRenderAs=e.readonlyRenderAs||"auto",this._compress=e.compress||!1,this._applyImageFit=e.applyImageFit||!1,this._useLegacyBooleanRendering=e.useLegacyBooleanRendering||!1,this._isRTL=e.isRTL||!1,this._tagboxSelectedChoicesOnly=e.tagboxSelectedChoicesOnly||!1}return Object.defineProperty(t.prototype,"leftTopPoint",{get:function(){return{xLeft:this.margins.left,yTop:this.margins.top}},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontSize",{get:function(){return this._fontSize},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"fontName",{get:function(){return this._fontName},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"base64Normal",{get:function(){return this._base64Normal},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"base64Bold",{get:function(){return this._base64Bold},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useCustomFontInHtml",{get:function(){return this._useCustomFontInHtml},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"margins",{get:function(){return this._margins},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"format",{get:function(){return this._format},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"orientation",{get:function(){return this._orientation},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"htmlRenderAs",{get:function(){return this._htmlRenderAs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"matrixRenderAs",{get:function(){return this._matrixRenderAs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readonlyRenderAs",{get:function(){return this._readonlyRenderAs},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"compress",{get:function(){return this._compress},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"applyImageFit",{get:function(){return this._applyImageFit},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"useLegacyBooleanRendering",{get:function(){return this._useLegacyBooleanRendering},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"isRTL",{get:function(){return this._isRTL},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"tagboxSelectedChoicesOnly",{get:function(){return this._tagboxSelectedChoicesOnly},enumerable:!1,configurable:!0}),t.MM_TO_PT=72/25.4,t.FONT_SIZE=14,t}(),k=function(t){function e(n){void 0===n&&(n={});var i,r,o=t.call(this,n)||this,s={orientation:o.orientation,unit:"pt",format:o.format,compress:o.compress};return o._doc=new h.jsPDF(s),void 0===o.base64Normal||A.isFontExist(o,o.fontName)||(e.addFont(o.fontName,o.base64Normal,"normal"),e.addFont(o.fontName,o.base64Bold,"bold"),o._doc=new h.jsPDF(s)),i=o._doc,r=i.AcroFormAppearance.RadioButton.Circle.YesNormal,i.AcroFormAppearance.RadioButton.Circle.YesNormal=function(t){var e=r(t),n=e.stream.split("\n"),o=i.__private__.encodeColorString(t.color);return n[0]=n[0]+"\n"+o+"\n"+o.toUpperCase(),e.stream=n.join("\n"),e},o._useCustomFontInHtml=n.useCustomFontInHtml&&A.isFontExist(o,o.fontName),o._helperDoc=new h.jsPDF(s),o._doc.setFont(o.fontName),o._helperDoc.setFont(o.fontName),o._doc.setFontSize(o.fontSize),o._helperDoc.setFontSize(o.fontSize),o._fontStyle="normal",o.marginsStack=[],o}return n(e,t),e.addFont=function(t,n,i){var r=e.customFonts[t];r||(r={},e.customFonts[t]=r),r[i]=n,h.jsPDF.API.events.push(["addFonts",function(){var n=e.customFonts[t];if(n&&n[i]){var r="".concat(t,"-").concat(i,".ttf");this.addFileToVFS(r,n[i]),this.addFont(r,t,i)}}])},Object.defineProperty(e.prototype,"doc",{get:function(){return this._doc},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"helperDoc",{get:function(){return this._helperDoc},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontName",{get:function(){return this._fontName},set:function(t){this._fontName=t,this._doc.setFont(t),this._helperDoc.setFont(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontSize",{get:function(){return this._fontSize},set:function(t){this._fontSize=t,this._doc.setFontSize(t),this._helperDoc.setFontSize(t)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"fontStyle",{get:function(){return this._fontStyle},set:function(t){this._fontStyle=t,this._doc.setFont(this._fontName,t),this._helperDoc.setFont(this._fontName,t)},enumerable:!1,configurable:!0}),e.prototype.measureText=function(t,e,n){var i=this;void 0===t&&(t=1),void 0===e&&(e=this._fontStyle),void 0===n&&(n=this._fontSize);var r=this._helperDoc.getFontSize();this._helperDoc.setFontSize(n),this._helperDoc.setFont(this._fontName,e);var o,s=this._helperDoc.getLineHeight()/this._helperDoc.internal.scaleFactor;return o="number"==typeof t?s*t:(t="string"==typeof t?t:A.getLocString(t)).split("").reduce((function(t,e){return t+i._helperDoc.getTextWidth(e)}),0),this._helperDoc.setFontSize(r),this._helperDoc.setFont(this._fontName,"normal"),{width:o,height:s}},Object.defineProperty(e.prototype,"unitWidth",{get:function(){return this.measureText().width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"unitHeight",{get:function(){return this.measureText().height},enumerable:!1,configurable:!0}),e.prototype.pushMargins=function(t,e){this.marginsStack.push({left:this.margins.left,right:this.margins.right}),void 0!==t&&(this.margins.left=t),void 0!==e&&(this.margins.right=e)},e.prototype.popMargins=function(){var t=this.marginsStack.pop();this.margins.left=t.left,this.margins.right=t.right},Object.defineProperty(e.prototype,"paperWidth",{get:function(){return this.doc.internal.pageSize.width},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"paperHeight",{get:function(){return this.doc.internal.pageSize.height},enumerable:!1,configurable:!0}),e.prototype.getNumberOfPages=function(){return this.doc.getNumberOfPages()},e.prototype.addPage=function(){this.doc.addPage()},e.prototype.getCurrentPageIndex=function(){return this.doc.getCurrentPageInfo().pageNumber-1},e.prototype.setPage=function(t){this.doc.setPage(t+1)},e.customFonts={},e}(M),W=r(400),H=function(){function t(){}return t.findBotInterval=function(t,e,n,i){var r=t.search(e,n);return r.push({pageIndex:0,xLeft:i.margins.left,xRight:i.margins.left,yBot:i.margins.top,absBot:i.margins.top}),r.reduce((function(t,i){return Math.abs(i.xRight-e)<A.EPSILON||Math.abs(i.xLeft-n)<A.EPSILON||i.pageIndex<t.pageIndex?t:i.pageIndex>t.pageIndex||i.yBot>t.yBot?i:t}),r[r.length-1])},t.addPack=function(t,e,n){for(var i=t.length;i<=e;i++)t.push([]);t[e].push(n)},t.pack=function(e,n){var i=n.paperHeight-n.margins.top-n.margins.bot,r=[];e.forEach((function(t){r.push([]),t.forEach((function(t){var e;t.height>i+A.EPSILON?(e=r[r.length-1]).push.apply(e,t.unfold()):r[r.length-1].push(t)}))})),r.forEach((function(t){t.sort((function(t,e){return t.yTop<e.yTop?-1:t.yTop>e.yTop||t.xLeft>e.xLeft?1:t.xLeft<e.xLeft?-1:0}))}));var o=0,s=[],a=n.paperHeight-n.margins.bot;return r.forEach((function(e){var i=new W.Ay,r=0;e.forEach((function(e){var l=t.findBotInterval(i,e.xLeft,e.xRight,n),c=l.pageIndex,h=l.yBot,u=l.absBot,f=e.height;e.yTop=h+e.yTop-u,(Math.abs(e.yTop-n.margins.top)>A.EPSILON&&e.yTop+f>a+A.EPSILON||e.isPageBreak)&&(e.yTop=n.margins.top,c++,r=Math.max(r,c)),i.insert(e.xLeft,e.xRight,{pageIndex:c,xLeft:e.xLeft,xRight:e.xRight,yBot:e.yTop+f,absBot:e.yBot}),e.yBot=e.yTop+f,t.addPack(s,o+c,e)})),o+=r+1})),s},t}();!function(t){t.NotSet="notset",t.Left="left",t.Center="center",t.Right="right"}(I||(I={})),function(t){t.NotSet="notset",t.Top="top",t.Middle="middle",t.Bottom="bottom"}(N||(N={}));var q=function(){function t(t,e,n,i,r){this.packs=t,this.controller=e,this._rect=n,this._countPages=i,this._pageNumber=r}return Object.defineProperty(t.prototype,"pageCount",{get:function(){return this._countPages},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"countPages",{get:function(){return this._countPages},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageNumber",{get:function(){return this._pageNumber},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rect",{get:function(){return this._rect},enumerable:!1,configurable:!0}),t.prototype.alignRect=function(t,e){void 0===t.margins?t.margins={left:0,right:0,top:0,bot:0}:(void 0===t.margins.left&&(t.margins.left=0),void 0===t.margins.right&&(t.margins.right=0),void 0===t.margins.top&&(t.margins.top=0),void 0===t.margins.bot&&(t.margins.bot=0)),void 0===t.rect&&(void 0!==t.horizontalAlign&&t.horizontalAlign!==I.NotSet||(t.horizontalAlign=I.Center),void 0!==t.verticalAlign&&t.verticalAlign!==N.NotSet||(t.verticalAlign=N.Middle));var n=A.clone(this.rect);if(void 0!==t.horizontalAlign)switch(t.horizontalAlign){case I.Left:n.xLeft=this.rect.xLeft+t.margins.left,n.xRight=Math.min(this.rect.xRight-t.margins.right,this.rect.xLeft+t.margins.left+e.width);break;case I.Center:n.xLeft=Math.max(this.rect.xLeft+t.margins.left,(this.rect.xLeft+this.rect.xRight-e.width)/2),n.xRight=Math.min(this.rect.xRight-t.margins.right,(this.rect.xLeft+this.rect.xRight+e.width)/2);break;case I.Right:n.xLeft=Math.max(this.rect.xLeft+t.margins.left,this.rect.xRight-t.margins.right-e.width),n.xRight=this.rect.xRight-t.margins.right}else n.xLeft=t.rect.xLeft||this.rect.xLeft,n.xRight=t.rect.xRight||this.rect.xRight;if(void 0!==t.verticalAlign)switch(t.verticalAlign){case N.Top:n.yTop=this.rect.yTop+t.margins.top,n.yBot=Math.min(this.rect.yBot-t.margins.bot,this.rect.yTop+t.margins.top+e.height);break;case N.Middle:n.yTop=Math.max(this.rect.yTop+t.margins.top,(this.rect.yTop+this.rect.yBot-e.height)/2),n.yBot=Math.min(this.rect.yBot-t.margins.bot,(this.rect.yTop+this.rect.yBot+e.height)/2);break;case N.Bottom:n.yTop=Math.max(this.rect.yTop+t.margins.top,this.rect.yBot-t.margins.bot-e.height),n.yBot=this.rect.yBot-t.margins.bot}else n.yTop=t.rect.yTop||this.rect.yTop,n.yBot=t.rect.yBot||this.rect.yBot;return n},t.prototype.drawText=function(t){void 0===(t=A.clone(t)).fontSize&&(t.fontSize=M.FONT_SIZE),void 0===t.isBold&&(t.isBold=!1);var e=this.controller.measureText(t.text,t.isBold?"bold":"normal",t.fontSize),n=this.alignRect(t,e);t.isBold?this.packs.push(new _(null,this.controller,n,t.text)):this.packs.push(new b(null,this.controller,n,t.text)),this.packs[this.packs.length-1].fontSize=t.fontSize},t.prototype.drawImage=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r;return a(this,(function(o){switch(o.label){case 0:return void 0===(t=A.clone(t)).width&&(t.width=this.rect.xRight-this.rect.xLeft),void 0===t.height&&(t.height=this.rect.yBot-this.rect.yTop),e={width:t.width,height:t.height},n=this.alignRect(t,e),this.controller.pushMargins(0,0),r=(i=this.packs).push,[4,A.createImageFlat(A.createPoint(n,!0,!0),null,this.controller,{link:t.base64,width:n.xRight-n.xLeft,height:n.yBot-n.yTop,objectFit:t.imageFit},!!t.imageFit||this.controller.applyImageFit)];case 1:return r.apply(i,[o.sent()]),this.controller.popMargins(),[2]}}))}))},t}(),D=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.unshift=function(t){this.hasFunc(t)||(null==this.callbacks&&(this.callbacks=new Array),this.callbacks.unshift(t))},e.prototype.fire=function(t,e){return s(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:if(null==this.callbacks)return[2];n=0,i.label=1;case 1:return n<this.callbacks.length?[4,this.callbacks[n](t,e)]:[3,4];case 2:i.sent(),i.label=3;case 3:return n++,[3,1];case 4:return[2]}}))}))},e}(c.EventBase),j=function(){function t(){}return t.process_header_events=function(t,e,n){return s(this,void 0,void 0,(function(){var i;return a(this,(function(r){switch(r.label){case 0:t.haveCommercialLicense||t.onRenderHeader.add((function(t,e){e.drawText({text:"SurveyJS PDF | Please purchase a SurveyJS PDF developer license to use it in your app | https://surveyjs.io/Buy",fontSize:10})})),i=0,r.label=1;case 1:return i<n.length?[4,t.onRenderHeader.fire(t,new q(n[i],e,A.createHeaderRect(e),n.length,i+1))]:[3,5];case 2:return r.sent(),[4,t.onRenderFooter.fire(t,new q(n[i],e,A.createFooterRect(e),n.length,i+1))];case 3:r.sent(),r.label=4;case 4:return i++,[3,1];case 5:return[2]}}))}))},t}(),z=function(t){function e(e,n){var i=t.call(this,e)||this;return i.onRenderHeader=new D,i.onRenderFooter=new D,i.onRenderQuestion=new D,i.onRenderPanel=new D,i.onRenderPage=new D,i.onDocControllerCreated=new c.EventBase,i.onRenderCheckItemAcroform=new D,i.onRenderRadioGroupWrapAcroform=new D,i.onRenderRadioItemAcroform=new D,void 0===n&&(n={}),i.options=A.clone(n),i}return n(e,t),Object.defineProperty(e.prototype,"haveCommercialLicense",{get:function(){var t=c.hasLicense;return!!t&&t(2)},set:function(t){console.error("As of v1.9.101, the haveCommercialLicense property is not supported. To activate your license, use the setLicenseKey(key) method as shown on the following page: https://surveyjs.io/remove-alert-banner")},enumerable:!1,configurable:!0}),e.prototype.waitForQuestionIsReady=function(t){return new Promise((function(e){if(t.isReady)e();else{var n=function(i,r){r.isReady&&(t.onReadyChanged.remove(n),e())};t.onReadyChanged.add(n)}}))},e.prototype.waitForCoreIsReady=function(){return s(this,void 0,void 0,(function(){var t,e,n,i,r,o,s;return a(this,(function(a){switch(a.label){case 0:t=0,e=this.getAllQuestions(),a.label=1;case 1:if(!(t<e.length))return[3,9];if(!(n=e[t]).contentPanel)return[3,6];i=[],n.contentPanel.addQuestionsToList(i),r=0,o=i,a.label=2;case 2:return r<o.length?(s=o[r],[4,this.waitForQuestionIsReady(s)]):[3,5];case 3:a.sent(),a.label=4;case 4:return r++,[3,2];case 5:return[3,8];case 6:return[4,this.waitForQuestionIsReady(A.getContentQuestion(n))];case 7:a.sent(),a.label=8;case 8:return t++,[3,1];case 9:return[2]}}))}))},e.prototype.getUpdatedCheckItemAcroformOptions=function(t){this.onRenderCheckItemAcroform.fire(this,t)},e.prototype.getUpdatedRadioGroupWrapOptions=function(t){this.onRenderRadioGroupWrapAcroform.fire(this,t)},e.prototype.getUpdatedRadioItemAcroformOptions=function(t){this.onRenderRadioItemAcroform.fire(this,t)},e.prototype.correctBricksPosition=function(t,e){t.isRTL&&e.forEach((function(e){e.forEach((function(e){e.translateX((function(e,n){var i=t.paperWidth-e-n;return{xLeft:e+i,xRight:n+i}}))}))}))},e.prototype.renderSurvey=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r;return a(this,(function(o){switch(o.label){case 0:return this.visiblePages.forEach((function(t){return t.onFirstRendering()})),[4,this.waitForCoreIsReady()];case 1:return o.sent(),[4,y.generateFlats(this,t)];case 2:return e=o.sent(),this.correctBricksPosition(t,e),n=H.pack(e,t),[4,j.process_header_events(this,t,n)];case 3:o.sent(),i=0,o.label=4;case 4:if(!(i<n.length))return[3,9];r=0,o.label=5;case 5:return r<n[i].length?(t.getNumberOfPages()===i&&t.addPage(),t.setPage(i),[4,n[i][r].render()]):[3,8];case 6:o.sent(),o.label=7;case 7:return r++,[3,5];case 8:return i++,[3,4];case 9:return[2]}}))}))},e.prototype.save=function(){return s(this,arguments,void 0,(function(t){var n,i,r=this;return void 0===t&&(t="survey_result.pdf"),a(this,(function(o){switch(o.label){case 0:return e.currentlySaving?[3,2]:(n=new k(this.options),this.onDocControllerCreated.fire(this,{controller:n}),e.currentlySaving=!0,A.fixFont(n),[4,this.renderSurvey(n)]);case 1:return o.sent(),(i=n.doc.save(t,{returnPromise:!0})).then((function(){e.currentlySaving=!1;var t=e.saveQueue.shift();t&&t()})),[2,i];case 2:e.saveQueue.push((function(){r.save(t)})),o.label=3;case 3:return[2]}}))}))},e.prototype.raw=function(t){return s(this,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return e=new k(this.options),this.onDocControllerCreated.fire(this,{controller:e}),A.fixFont(e),[4,this.renderSurvey(e)];case 1:return n.sent(),[2,e.doc.output(t)]}}))}))},e.currentlySaving=!1,e.saveQueue=[],e}(c.SurveyModel),G=function(t){function e(e,n,i,r){var o=t.call(this,r.question,e,n)||this;return o.fieldName=i,o.context=r,o.question=o.context.question,o.textColor=o.formBorderColor,o}return n(e,t),e.prototype.getShouldRenderReadOnly=function(){return this.context.readOnly&&"acroform"!==A.getReadonlyRenderAs(this.question,this.controller)||this.controller.compress},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){var t,n,i,r;return a(this,(function(o){return t=new this.controller.doc.AcroFormCheckBox,n=A.formScale(this.controller,this),(i={}).maxFontSize=this.height*n*e.FONT_SIZE_SCALE,i.caption=e.CHECKMARK_READONLY_SYMBOL,i.textAlign="center",i.fieldName=this.fieldName,i.readOnly=this.context.readOnly,i.color=this.formBorderColor,i.value=!!this.context.checked&&"On",i.AS=this.context.checked?"/On":"/Off",i.context=this.context,i.Rect=A.createAcroformRect(A.scaleRect(this,n)),this.controller.doc.addField(t),null===(r=this.question.survey)||void 0===r||r.getUpdatedCheckItemAcroformOptions(i),t.maxFontSize=i.maxFontSize,t.caption=i.caption,t.textAlign=i.textAlign,t.fieldName=i.fieldName,t.readOnly=i.readOnly,t.color=i.color,t.value=i.value,t.AS=i.AS,t.Rect=i.Rect,A.renderFlatBorders(this.controller,this),[2]}))}))},e.prototype.renderReadOnly=function(){return s(this,void 0,void 0,(function(){var t,n,i,r,o;return a(this,(function(s){switch(s.label){case 0:return A.renderFlatBorders(this.controller,this),this.context.checked?(t=A.createPoint(this,!0,!0),n=this.controller.fontName,this.controller.fontName=e.CHECKMARK_READONLY_FONT,i=this.controller.fontSize,this.controller.fontSize=i*e.CHECKMARK_READONLY_FONT_SIZE_SCALE,r=this.controller.measureText(e.CHECKMARK_READONLY_SYMBOL),t.xLeft+=this.width/2-r.width/2,t.yTop+=this.height/2-r.height/2,[4,A.createTextFlat(t,this.question,this.controller,e.CHECKMARK_READONLY_SYMBOL,b)]):[3,3];case 1:return(o=s.sent()).unfold()[0].textColor=this.textColor,this.controller.fontSize=i,[4,o.render()];case 2:s.sent(),this.controller.fontName=n,s.label=3;case 3:return[2]}}))}))},e.FONT_SIZE_SCALE=.7,e.CHECKMARK_READONLY_SYMBOL="3",e.CHECKMARK_READONLY_FONT="zapfdingbats",e.CHECKMARK_READONLY_FONT_SIZE_SCALE=1-Math.E/10,e}(v),V=function(t){function e(e,n,i){return t.call(this,n,i,e.id,{question:e,readOnly:e.isReadOnly,checked:e.checkedValue})||this}return n(e,t),e}(G),U=function(){function t(t,e,n){this.name=t,this.controller=e,this.context=n}return t.prototype.addToPdf=function(t){var e;this._radioGroup=new this.controller.doc.AcroFormRadioButton;var n={};n.fieldName=this.name,n.readOnly=this.readOnly,n.color=t,n.context=this.context,null===(e=this.context.question.survey)||void 0===e||e.getUpdatedRadioGroupWrapOptions(n),this._radioGroup.fieldName=n.fieldName,this._radioGroup.readOnly=n.readOnly,this._radioGroup.color=n.color,this._radioGroup.value="",this.controller.doc.addField(this._radioGroup)},Object.defineProperty(t.prototype,"radioGroup",{get:function(){return this._radioGroup},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"readOnly",{get:function(){return this.context.readOnly},enumerable:!1,configurable:!0}),t}(),Q=function(t){function e(e,n,i,r){var o=t.call(this,i.question,e,n)||this;return o.context=i,o.radioGroupWrap=r,o.textColor=o.formBorderColor,o}return n(e,t),e.prototype.getShouldRenderReadOnly=function(){return this.radioGroupWrap.readOnly&&"acroform"!==A.getReadonlyRenderAs(this.question,this.controller)||this.controller.compress},e.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){var t,e,n,i;return a(this,(function(r){return 0==this.context.index&&this.radioGroupWrap.addToPdf(this.formBorderColor),(t={}).fieldName=this.radioGroupWrap.name+"index"+this.context.index,e=A.formScale(this.controller,this),t.Rect=A.createAcroformRect(A.scaleRect(this,e)),t.color=this.formBorderColor,t.appearance=this.controller.doc.AcroForm.Appearance.RadioButton.Circle,t.radioGroup=this.radioGroupWrap.radioGroup,t.context=this.context,null===(i=this.context.question.survey)||void 0===i||i.getUpdatedRadioItemAcroformOptions(t),n=this.radioGroupWrap.radioGroup.createOption(t.fieldName),this.context.checked?(t.AS||(n.AS="/"+t.fieldName),this.radioGroupWrap.radioGroup.value||(this.radioGroupWrap.radioGroup.value=t.fieldName)):t.AS||(t.AS="/Off"),n.Rect=t.Rect,n.color=t.color,A.renderFlatBorders(this.controller,this),this.radioGroupWrap.radioGroup.setAppearance(t.appearance),[2]}))}))},e.prototype.renderReadOnly=function(){return s(this,void 0,void 0,(function(){var t,n,i,r,o;return a(this,(function(s){switch(s.label){case 0:return A.renderFlatBorders(this.controller,this),this.context.checked?(t=A.createPoint(this,!0,!0),n=this.controller.fontSize,i=this.controller.fontName,this.controller.fontName=e.RADIOMARKER_READONLY_FONT,this.controller.fontSize=n*e.RADIOMARKER_READONLY_FONT_SIZE_SCALE,r=this.controller.measureText(e.RADIOMARKER_READONLY_SYMBOL),t.xLeft+=this.width/2-r.width/2,t.yTop+=this.height/2-r.height/2,[4,A.createTextFlat(t,this.question,this.controller,e.RADIOMARKER_READONLY_SYMBOL,b)]):[3,3];case 1:return(o=s.sent()).unfold()[0].textColor=this.textColor,[4,o.render()];case 2:s.sent(),this.controller.fontSize=n,this.controller.fontName=i,s.label=3;case 3:return[2]}}))}))},e.RADIOMARKER_READONLY_SYMBOL="l",e.RADIOMARKER_READONLY_FONT="zapfdingbats",e.RADIOMARKER_READONLY_FONT_SIZE_SCALE=1-(2+Math.E)/10,e}(v),Y=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatComposite=function(t,e,n){return s(this,void 0,void 0,(function(){var i,r,o,s,l,c,h,f,d;return a(this,(function(a){switch(a.label){case 0:return i=new u,r=A.createRect(t,this.controller.unitWidth,this.controller.unitHeight),o=this.generateFlatItem(A.moveRect(A.scaleRect(r,A.SELECT_ITEM_FLAT_SCALE),t.xLeft),e,n),i.addBrick(o),(s=A.clone(t)).xLeft=o.xRight+this.controller.unitWidth*A.GAP_BETWEEN_ITEM_TEXT,null===e.locText.renderedHtml?[3,2]:(c=(l=i).addBrick,[4,A.createTextFlat(s,this.question,this.controller,e.locText,b)]);case 1:c.apply(l,[a.sent()]),a.label=2;case 2:return e===this.question.otherItem&&(e.value===this.question.value||void 0!==this.question.isOtherSelected&&this.question.isOtherSelected)?((h=A.createPoint(i)).yTop+=this.controller.unitHeight*A.GAP_BETWEEN_ROWS,d=(f=i).addBrick,[4,A.createCommentFlat(h,this.question,this.controller,!1,{index:n,rows:A.OTHER_ROWS_COUNT})]):[3,4];case 3:d.apply(f,[a.sent()]),a.label=4;case 4:return[2,i]}}))}))},e.prototype.getVisibleChoices=function(){return this.question.visibleChoices},e.prototype.getColCount=function(){return this.question.colCount},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r;return a(this,(function(o){switch(o.label){case 0:return e=this.getColCount(),n=this.getVisibleChoices(),i=e,0==e?(i=Math.floor(A.getPageAvailableWidth(this.controller)/this.controller.measureText(A.MATRIX_COLUMN_WIDTH).width)||1,n.length<i&&(i=n.length)):e>1&&(i=A.getColumnWidth(this.controller,e)<this.controller.measureText(A.MATRIX_COLUMN_WIDTH).width?1:e),1!=i?[3,2]:[4,this.generateVerticallyItems(t,n)];case 1:return r=o.sent(),[3,4];case 2:return[4,this.generateHorisontallyItems(t,i)];case 3:r=o.sent(),o.label=4;case 4:return[2,r]}}))}))},e.prototype.generateVerticallyItems=function(t,e){return s(this,void 0,void 0,(function(){var n,i,r,o;return a(this,(function(s){switch(s.label){case 0:n=A.clone(t),i=[],r=0,s.label=1;case 1:return r<e.length?[4,this.generateFlatComposite(n,e[r],r)]:[3,4];case 2:o=s.sent(),n.yTop=o.yBot+A.GAP_BETWEEN_ROWS*this.controller.unitHeight,i.push(o),s.label=3;case 3:return r++,[3,1];case 4:return[2,i]}}))}))},e.prototype.generateHorisontallyItems=function(t,e){return s(this,void 0,void 0,(function(){var n,i,r,o,s,l,c;return a(this,(function(a){switch(a.label){case 0:n=this.getVisibleChoices(),i=A.clone(t),r=[],o=new u,s=0,a.label=1;case 1:return s<n.length?(this.controller.pushMargins(this.controller.margins.left,this.controller.margins.right),A.setColumnMargins(this.controller,e,s%e),i.xLeft=this.controller.margins.left,[4,this.generateFlatComposite(i,n[s],s)]):[3,4];case 2:l=a.sent(),o.addBrick(l),this.controller.popMargins(),s%e!=e-1&&s!==n.length-1||(c=A.createRowlineFlat(A.createPoint(o),this.controller),i.yTop=c.yBot+A.GAP_BETWEEN_ROWS*this.controller.unitHeight,r.push(o,c),o=new u),a.label=3;case 3:return s++,[3,1];case 4:return[2,r]}}))}))},e}(x),X=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.isItemSelected=function(t,e){return void 0===e?t===this.question.otherItem?this.question.isOtherSelected:t.value===this.question.value||void 0!==this.question.isItemSelected&&this.question.isItemSelected(t):e},e.prototype.generateFlatItem=function(t,e,n,r,o,s){void 0===s&&(s={}),0===n?(this.radioGroupWrap=new U(this.question.id+(void 0===r?"":r),this.controller,i({readOnly:this.question.isReadOnly,question:this.question},s)),this.question.pdfRadioGroupWrap=this.radioGroupWrap):void 0===this.radioGroupWrap&&(this.radioGroupWrap=this.question.pdfRadioGroupWrap);var a=this.isItemSelected(e,o);return new Q(this.controller,t,{question:this.question,index:n,checked:a,item:e},this.radioGroupWrap)},e}(Y);F.getInstance().register("radiogroup",X),F.getInstance().register("buttongroup",X);var K=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r,o,s,l;return a(this,(function(a){switch(a.label){case 0:return e=new u,n=this.controller.unitHeight,i=new V(this.question,this.controller,A.moveRect(A.scaleRect(A.createRect(t,n,n),A.SELECT_ITEM_FLAT_SCALE),t.xLeft)),e.addBrick(i),(r=A.clone(t)).xLeft=i.xRight+this.controller.unitWidth*A.GAP_BETWEEN_ITEM_TEXT,null===(o=this.question.isIndeterminate?null:this.question.checkedValue?this.question.locLabelTrue:this.question.locLabelFalse)||null===o.renderedHtml?[3,2]:(l=(s=e).addBrick,[4,A.createTextFlat(r,this.question,this.controller,o,b)]);case 1:l.apply(s,[a.sent()]),a.label=2;case 2:return[2,[e]]}}))}))},e}(x),Z=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.buildItems(),r}return n(e,t),e.prototype.buildItems=function(){var t=this.question,e=new c.ItemValue(void 0!==t.valueFalse&&t.valueFalse),n=new c.ItemValue(void 0===t.valueTrue||t.valueTrue);e.locOwner=t,e.setLocText(t.locLabelFalse),n.locOwner=t,n.setLocText(t.locLabelTrue),this.items=[e,n]},e.prototype.getVisibleChoices=function(){return this.items},e.prototype.getColCount=function(){return 0},e}(X);F.getInstance().register("boolean",Z),F.getInstance().register("boolean-checkbox",K);var J=function(t){function e(e,n,i,r,o){return t.call(this,n,i,e.id+"index"+o,{question:e,readOnly:e.isReadOnly||!r.isEnabled,item:r,checked:e.isItemSelected(r),index:o})||this}return n(e,t),e}(G),$=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatItem=function(t,e,n){return new J(this.question,this.controller,t,e,n)},e}(Y),tt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.getVisibleChoices=function(){return this.controller.tagboxSelectedChoicesOnly?this.question.selectedChoices:t.prototype.getVisibleChoices.call(this)},e}($);F.getInstance().register("tagbox",tt),F.getInstance().register("checkbox",$);var et=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){return a(this,(function(e){return[2,F.getInstance().create(this.survey,this.question,this.controller,this.question.getType()).generateFlatsContent(t)]}))}))},e}(x);F.getInstance().register("custom_model",et);var nt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,A.createCommentFlat(t,this.question,this.controller,!0,{rows:this.question.rows})];case 1:return[2,[e.sent()]]}}))}))},e}(x);F.getInstance().register("comment",nt);var it=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.controller=n,r.question=e,r}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){var t,e,n=this;return a(this,(function(i){return(t=new this.controller.doc.AcroFormComboBox).fieldName=this.question.id,t.Rect=A.createAcroformRect(A.scaleRect(this,A.formScale(this.controller,this))),t.edit=!1,t.color=this.textColor,e=[],this.question.showOptionsCaption&&e.push(this.getCorrectedText(this.question.optionsCaption)),this.question.visibleChoices.forEach((function(t){e.push(n.getCorrectedText(A.getLocString(t.locText)))})),t.setOptions(e),t.fontName=this.controller.fontName,t.fontSize=this.fontSize,t.readOnly=this.question.isReadOnly,t.isUnicode=A.isCustomFont(this.controller,t.fontName),t.V=this.getCorrectedText(A.getDropdownQuestionValue(this.question)),this.controller.doc.addField(t),A.renderFlatBorders(this.controller,this),[2]}))}))},e}(v),rt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r,o;return a(this,(function(s){switch(s.label){case 0:return this.shouldRenderAsComment?[3,1]:(e=new it(this.question,this.controller,A.createTextFieldRect(t,this.controller)),[3,3]);case 1:return[4,A.createCommentFlat(t,this.question,this.controller,!0,{value:A.getDropdownQuestionValue(this.question)})];case 2:e=s.sent(),s.label=3;case 3:return n=new u(e),this.question.isOtherSelected?((i=A.createPoint(n)).yTop+=this.controller.unitHeight*A.GAP_BETWEEN_ROWS,o=(r=n).addBrick,[4,A.createCommentFlat(i,this.question,this.controller,!1,{rows:A.OTHER_ROWS_COUNT})]):[3,5];case 4:o.apply(r,[s.sent()]),s.label=5;case 5:return[2,[n]]}}))}))},e}(x);F.getInstance().register("dropdown",rt);var ot=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,A.createCommentFlat(t,this.question,this.controller,!0,{value:this.question.displayValue,readOnly:!0})];case 1:return[2,[e.sent()]]}}))}))},e}(x);F.getInstance().register("expression",ot);var st=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateFlatItem=function(t,n){return s(this,void 0,void 0,(function(){var i,r,o,s,l;return a(this,(function(a){switch(a.label){case 0:return r=u.bind,[4,A.createLinkFlat(t,this.question,this.controller,void 0===n.name?"image":n.name,n.content)];case 1:return i=new(r.apply(u,[void 0,a.sent()])),A.canPreviewImage(this.question,n,n.content)?((o=A.createPoint(i)).yTop+=this.controller.unitHeight*e.IMAGE_GAP_SCALE,l=(s=i).addBrick,[4,A.createImageFlat(o,this.question,this.controller,{link:n.content,width:n.imageSize.width,height:n.imageSize.height,objectFit:e.DEFAULT_IMAGE_FIT})]):[3,3];case 2:l.apply(s,[a.sent()]),a.label=3;case 3:return[2,i]}}))}))},e.prototype.addLine=function(t,e,n){n!==this.question.previewValue.length-1&&(t[t.length-1].addBrick(A.createRowlineFlat(e,this.controller)),e.yTop+=A.EPSILON,t.push(new u))},e.prototype.getImagePreviewContentWidth=function(t){return s(this,void 0,void 0,(function(){return a(this,(function(n){return[2,Math.max(t.imageSize.width,e.TEXT_MIN_SCALE*this.controller.unitWidth)]}))}))},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var e,n,r,o,s,l,c,h,f,d;return a(this,(function(a){switch(a.label){case 0:return 0!==this.question.previewValue.length?[3,2]:[4,A.createTextFlat(t,this.question,this.controller,this.question.noFileChosenCaption,b)];case 1:return[2,[a.sent()]];case 2:e=[new u],n=A.clone(t),r=n.yTop,o=0,a.label=3;case 3:return o<this.question.previewValue.length?(s=i({},this.question.previewValue[o]),(l=A.canPreviewImage(this.question,s,s.content))?(c=s,[4,A.getCorrectedImageSize(this.controller,{imageWidth:this.question.imageWidth,imageHeight:this.question.imageHeight,imageLink:this.question.previewValue[o].content,defaultImageWidth:200,defaultImageHeight:150})]):[3,5]):[3,12];case 4:c.imageSize=a.sent(),a.label=5;case 5:return h=this.controller.paperWidth-this.controller.margins.right-n.xLeft,l?[4,this.getImagePreviewContentWidth(s)]:[3,8];case 6:return f=a.sent(),h<f&&(n.xLeft=t.xLeft,n.yTop=r,this.addLine(e,n,o)),this.controller.pushMargins(n.xLeft,this.controller.paperWidth-n.xLeft-f),[4,this.generateFlatItem(n,s)];case 7:return d=a.sent(),e[e.length-1].addBrick(d),n.xLeft+=d.width,r=Math.max(r,d.yBot),this.controller.popMargins(),[3,10];case 8:return h<this.controller.unitWidth&&(n.xLeft=t.xLeft,n.yTop=r,this.addLine(e,n,o)),[4,this.generateFlatItem(n,s)];case 9:d=a.sent(),e[e.length-1].addBrick(d),n.xLeft+=d.xRight-d.xLeft,r=Math.max(r,d.yBot),a.label=10;case 10:n.xLeft+=this.controller.unitWidth,a.label=11;case 11:return o++,[3,3];case 12:return[2,e]}}))}))},e.IMAGE_GAP_SCALE=.195,e.TEXT_MIN_SCALE=5,e.DEFAULT_IMAGE_FIT="contain",e}(x);F.getInstance().register("file",st);var at=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r}return n(e,t),e.prototype.chooseRender=function(t){return/<[^>]*style[^<]*>/.test(t)||/<[^>]*table[^<]*>/.test(t)||/&\w+;/.test(t)?"image":"standard"},e.prototype.correctHtml=function(t){return e.correctHtmlRules.forEach((function(e){t=t.replace(e.searchRegExp,e.replaceString)})),t},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r,o,s,l,c,h,u;return a(this,(function(a){switch(a.label){case 0:return e=this.question.renderAs,A.hasDocument?("auto"===e&&(e=this.controller.htmlRenderAs),"auto"===e&&(e=this.chooseRender(A.getLocString(this.question.locHtml))),n=A.createHtmlContainerBlock(A.getLocString(this.question.locHtml),this.controller,e),"image"!==e?[3,3]:(i=A.getPageAvailableWidth(this.controller),[4,A.htmlToImage(n,i,this.controller)])):[2,[new B(A.createRect(t,0,0))]];case 1:return r=a.sent(),o=r.url,s=r.aspect,l=i/s,[4,A.createImageFlat(t,this.question,this.controller,{link:o,width:i,height:l})];case 2:return[2,[a.sent()]];case 3:return h=(c=A).splitHtmlRect,u=[this.controller],[4,A.createHTMLFlat(t,this.question,this.controller,this.correctHtml(n))];case 4:return[2,[h.apply(c,u.concat([a.sent()]))]]}}))}))},e.correctHtmlRules=[{searchRegExp:/(<\/?br\s*?\/?\s*?>\s*){2,}/g,replaceString:"<br>"}],e}(x);c.Serializer.removeProperty("html","renderAs"),c.Serializer.addProperty("html",{name:"renderAs",default:"auto",visible:!1,choices:["auto","standard","image"]}),F.getInstance().register("html",at);var lt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.getCorrectImageSize=function(){return s(this,void 0,void 0,(function(){return a(this,(function(t){switch(t.label){case 0:return[4,A.getCorrectedImageSize(this.controller,{imageWidth:this.question.imageWidth,imageHeight:this.question.imageHeight,imageLink:this.question.imageLink})];case 1:return[2,t.sent()]}}))}))},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return[4,this.getCorrectImageSize()];case 1:return e=n.sent(),[4,A.createImageFlat(t,this.question,this.controller,{link:this.question.imageLink,width:e.width,height:e.height})];case 2:return[2,[n.sent()]]}}))}))},e}(x);F.getInstance().register("image",lt);var ct=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateFlatItem=function(t,e,n){return s(this,void 0,void 0,(function(){var i,r,o,s,l,c,h;return a(this,(function(a){switch(a.label){case 0:return i=A.getPageAvailableWidth(this.controller),[4,A.createImageFlat(t,this.question,this.controller,{link:e.imageLink,width:i,height:i/A.IMAGEPICKER_RATIO})];case 1:return r=a.sent(),o=new u(r),s=A.createPoint(o),this.question.showLabel?[4,A.createTextFlat(s,this.question,this.controller,e.text||e.value,b)]:[3,3];case 2:l=a.sent(),o.addBrick(l),s=A.createPoint(l),a.label=3;case 3:return c=this.controller.unitHeight,h=A.createRect(s,i,c),this.question.multiSelect?o.addBrick(new G(this.controller,h,this.question.id+"index"+n,{readOnly:this.question.isReadOnly||!e.isEnabled,question:this.question,item:e,checked:-1!==this.question.value.indexOf(e.value),index:n})):o.addBrick(this.radio.generateFlatItem(h,e,n)),[2,o]}}))}))},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r,o,s,l,c,h,f,d,p;return a(this,(function(a){switch(a.label){case 0:this.radio=this.question.multiSelect?null:new X(this.survey,this.question,this.controller),e=[new u],n=A.getImagePickerAvailableWidth(this.controller)/A.IMAGEPICKER_COUNT,i=~~(A.getPageAvailableWidth(this.controller)/n)||1,r=this.question.visibleChoices.length,i=i<=r?i:r,o=~~Math.ceil(r/i),s=A.clone(t),l=0,a.label=1;case 1:if(!(l<o))return[3,7];c=s.yTop,this.controller.pushMargins(),h=this.controller.margins.left,f=0,a.label=2;case 2:return f<i?(d=l*i+f)==r?[3,5]:(this.controller.margins.left=h,this.controller.margins.right=this.controller.paperWidth-h-n,h=this.controller.paperWidth-this.controller.margins.right+this.controller.unitWidth,s.xLeft=this.controller.margins.left,[4,this.generateFlatItem(s,this.question.visibleChoices[d],d)]):[3,5];case 3:p=a.sent(),e[e.length-1].addBrick(p),c=Math.max(c,p.yBot),a.label=4;case 4:return f++,[3,2];case 5:this.controller.popMargins(),s.xLeft=t.xLeft,s.yTop=c,l!==o-1&&(e[e.length-1].addBrick(A.createRowlineFlat(s,this.controller)),s.yTop+=A.EPSILON,e.push(new u)),a.label=6;case 6:return l++,[3,1];case 7:return[2,e]}}))}))},e}(x);F.getInstance().register("imagepicker",ct);var ht=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var n,i,r,o,s,l;return a(this,(function(a){switch(a.label){case 0:n=[],i=A.clone(t),r=0,o=this.question.panels,a.label=1;case 1:return r<o.length?(s=o[r],[4,y.generateFlatsPanel(this.survey,this.controller,s,i)]):[3,4];case 2:0!==(l=a.sent()).length&&(i.yTop=A.mergeRects.apply(A,l).yBot,i.yTop+=this.controller.unitHeight*e.GAP_BETWEEN_PANELS,n.push.apply(n,l)),a.label=3;case 3:return r++,[3,1];case 4:return[2,n]}}))}))},e.GAP_BETWEEN_PANELS=.75,e}(x);F.getInstance().register("paneldynamic",ht);var ut=function(t){function e(e,n,i,r){var o=t.call(this,e,n,i)||this;return o.mark=r,o.question=e,o.textColor=o.formBorderColor,o}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){var t,e,n,i;return a(this,(function(r){switch(r.label){case 0:return A.renderFlatBorders(this.controller,this),t=A.createPoint(this,!0,!0),e=this.controller.fontSize,this.controller.fontSize=e*G.CHECKMARK_READONLY_FONT_SIZE_SCALE,n=this.controller.measureText(this.mark),t.xLeft+=this.width/2-n.width/2,t.yTop+=this.height/2-n.height/2,[4,A.createTextFlat(t,this.question,this.controller,this.mark,b)];case 1:return(i=r.sent()).unfold()[0].textColor=this.textColor,this.controller.fontSize=e,[4,i.render()];case 2:return r.sent(),[2]}}))}))},e}(v),ft=function(t){function e(e,n,i,r,o){var s=t.call(this,void 0,e,n)||this;return s.color=i,s.renderWidth=r,s.renderHeight=o,s}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){var t,e,n;return a(this,(function(i){return t=this.controller.doc.getFillColor(),this.controller.doc.setFillColor(this.color||"black"),this.controller.doc.rect(this.xLeft,this.yTop,null!==(e=this.renderWidth)&&void 0!==e?e:this.width,null!==(n=this.renderHeight)&&void 0!==n?n:this.height,"F"),this.controller.doc.setFillColor(t),[2]}))}))},e}(v),dt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatComposite=function(t,e,n){return s(this,arguments,void 0,(function(t,e,n,i){var r,o,s,l,c;return void 0===i&&(i=!1),a(this,(function(a){switch(a.label){case 0:return r=A.createRect(t,this.controller.unitWidth,this.controller.unitHeight),o=A.moveRect(A.scaleRect(r,A.SELECT_ITEM_FLAT_SCALE),t.xLeft),s=new ut(this.question,this.controller,o,i?"-":this.question.getNumberByIndex(n)),(l=A.clone(t)).xLeft=s.xRight+this.controller.unitWidth*A.GAP_BETWEEN_ITEM_TEXT,[4,A.createTextFlat(l,this.question,this.controller,e.locText,b)];case 1:return c=a.sent(),[2,new u(s,c)]}}))}))},e.prototype.generateChoicesColumn=function(t,e){return s(this,arguments,void 0,(function(t,e,n){var i,r,o,s;return void 0===n&&(n=!1),a(this,(function(a){switch(a.label){case 0:i=A.clone(t),r=[],o=0,a.label=1;case 1:return o<e.length?[4,this.generateFlatComposite(i,e[o],o,n)]:[3,4];case 2:s=a.sent(),i.yTop=s.yBot+A.GAP_BETWEEN_ROWS*this.controller.unitHeight,r.push(s),a.label=3;case 3:return o++,[3,1];case 4:return[2,r]}}))}))},e.prototype.generateSelectToRankItemsVertically=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r,o,s,l,c,h;return a(this,(function(a){switch(a.label){case 0:return e=A.clone(t),n=[],0===this.question.rankingChoices.length?[3,2]:(r=(i=n.push).apply,o=[n],[4,this.generateChoicesColumn(e,this.question.rankingChoices)]);case 1:r.apply(i,o.concat([a.sent()])),e.yTop=n[n.length-1].yBot+A.GAP_BETWEEN_ROWS*this.controller.unitHeight*2,a.label=2;case 2:return s=A.createRect({xLeft:e.xLeft,yTop:e.yTop-A.GAP_BETWEEN_ROWS*this.controller.unitHeight-.5},this.controller.paperWidth-this.controller.margins.right-e.xLeft,1),n.push(new ft(this.controller,s,A.FORM_BORDER_COLOR)),c=(l=n.push).apply,h=[n],[4,this.generateChoicesColumn(e,this.question.unRankingChoices,!0)];case 3:return c.apply(l,h.concat([a.sent()])),[2,n]}}))}))},e.prototype.generateSelectToRankItemsHorizontally=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r,o,s,l,c,h,f,d,p,g;return a(this,(function(a){switch(a.label){case 0:e=2,n=A.clone(t),i=[],r=Math.max(this.question.unRankingChoices.length,this.question.rankingChoices.length),o=new u,s=0,a.label=1;case 1:if(!(s<r))return[3,8];l=0,c=0,h=[this.question.unRankingChoices[s],this.question.rankingChoices[s]],a.label=2;case 2:return c<h.length?(f=h[c])?(this.controller.pushMargins(this.controller.margins.left,this.controller.margins.right),A.setColumnMargins(this.controller,e,l),n.xLeft=this.controller.margins.left,[4,this.generateFlatComposite(n,f,s,0==l)]):[3,4]:[3,6];case 3:d=a.sent(),o.addBrick(d),this.controller.popMargins(),a.label=4;case 4:l++,a.label=5;case 5:return c++,[3,2];case 6:p=A.createRowlineFlat(A.createPoint(o),this.controller),i.push(o,p),g=A.createRect({xLeft:this.controller.margins.left+A.getPageAvailableWidth(this.controller)/2-.5,yTop:n.yTop},0,0),o.addBrick(new ft(this.controller,g,A.FORM_BORDER_COLOR,1,p.yBot-n.yTop+(s!==r-1?A.GAP_BETWEEN_ROWS*this.controller.unitHeight:0))),n.yTop=p.yBot+A.GAP_BETWEEN_ROWS*this.controller.unitHeight,o=new u,a.label=7;case 7:return s++,[3,1];case 8:return[2,i]}}))}))},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){return a(this,(function(e){return this.question.selectToRankEnabled?"vertical"==this.question.selectToRankAreasLayout?[2,this.generateSelectToRankItemsVertically(t)]:[2,this.generateSelectToRankItemsHorizontally(t)]:[2,this.generateChoicesColumn(t,this.question.rankingChoices)]}))}))},e}(x);F.getInstance().register("ranking",dt);var pt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.questionRating=n,r}return n(e,t),e.prototype.generateFlatHorisontalComposite=function(t,e,n){return s(this,void 0,void 0,(function(){var i,r,o,s,l,c,h;return a(this,(function(a){switch(a.label){case 0:return i=A.getRatingItemText(this.questionRating,n,e.locText),this.controller.pushMargins(),r=this.controller.unitWidth/2,this.controller.margins.left+=r,this.controller.margins.right+=r,(o=A.clone(t)).xLeft+=r,l=u.bind,[4,A.createBoldTextFlat(o,this.questionRating,this.controller,i)];case 1:return s=new(l.apply(u,[void 0,a.sent()])),this.controller.popMargins(),(c=s.width)<A.getRatingMinWidth(this.controller)?(s.xLeft+=(A.getRatingMinWidth(this.controller)-c)/2-r,c=A.getRatingMinWidth(this.controller)):c+=this.controller.unitWidth,(h=A.createPoint(s)).xLeft=t.xLeft,s.addBrick(this.generateFlatItem(A.createRect(h,c,this.controller.unitHeight),e,n,void 0,this.question.value==e.value)),[2,s]}}))}))},e.prototype.generateFlatComposite=function(t,e,n){return s(this,void 0,void 0,(function(){var i,r,o,s,l,c,h;return a(this,(function(a){switch(a.label){case 0:return i=new u,r=A.createRect(t,this.controller.unitHeight,this.controller.unitHeight),o=this.generateFlatItem(A.moveRect(A.scaleRect(r,A.SELECT_ITEM_FLAT_SCALE),t.xLeft),e,n,void 0,this.question.value==e.value),i.addBrick(o),(s=A.clone(t)).xLeft=o.xRight+this.controller.unitWidth*A.GAP_BETWEEN_ITEM_TEXT,null==(l=A.getRatingItemText(this.questionRating,n,e.locText))?[3,2]:(h=(c=i).addBrick,[4,A.createTextFlat(s,this.question,this.controller,l,b)]);case 1:h.apply(c,[a.sent()]),a.label=2;case 2:return[2,i]}}))}))},e.prototype.generateHorisontallyItems=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r,o;return a(this,(function(s){switch(s.label){case 0:e=[new u],n=A.clone(t),i=0,s.label=1;case 1:return i<this.questionRating.visibleRateValues.length?[4,this.generateFlatHorisontalComposite(n,this.questionRating.visibleRateValues[i],i)]:[3,4];case 2:r=s.sent(),e[e.length-1].addBrick(r),o=this.controller.paperWidth-this.controller.margins.right-r.xRight,A.getRatingMinWidth(this.controller)<=o+A.EPSILON?n.xLeft=r.xRight:(n.xLeft=t.xLeft,n.yTop=r.yBot,i!==this.questionRating.visibleRateValues.length-1&&(e[e.length-1].addBrick(A.createRowlineFlat(n,this.controller)),n.yTop+=A.EPSILON,e.push(new u))),s.label=3;case 3:return i++,[3,1];case 4:return[2,e]}}))}))},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var e,n,i;return a(this,(function(r){for(e=!1,n=0;n<this.questionRating.visibleRateValues.length;n++)i=A.getRatingItemText(this.questionRating,n,this.questionRating.visibleRateValues[n].locText),this.controller.measureText(i).width>this.controller.measureText(A.RATING_COLUMN_WIDTH).width&&(e=!0);return[2,e?this.generateVerticallyItems(t,this.questionRating.visibleRateValues):this.generateHorisontallyItems(t)]}))}))},e}(X);F.getInstance().register("rating",pt);var gt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateBackgroundImage=function(t){return s(this,void 0,void 0,(function(){return a(this,(function(e){switch(e.label){case 0:return[4,A.createImageFlat(t,this.question,this.controller,{link:this.question.backgroundImage,width:A.pxToPt(this.question.signatureWidth),height:A.pxToPt(this.question.signatureHeight),objectFit:"cover"},!0)];case 1:return[2,e.sent()]}}))}))},e.prototype.getSignImageUrl=function(){return this.question.storeDataAsText||!this.question.loadedData?this.question.value:this.question.loadedData},e.prototype.generateSign=function(t){return s(this,void 0,void 0,(function(){var n,i,r,o=this;return a(this,(function(s){switch(s.label){case 0:return n=A.pxToPt(this.question.signatureWidth),i=A.pxToPt(this.question.signatureHeight),this.question.value?[4,A.createImageFlat(t,this.question,this.controller,{link:this.getSignImageUrl(),width:n,height:i},!1)]:[3,2];case 1:return r=s.sent(),[3,3];case 2:r=new B(A.createRect(t,n,i)),s.label=3;case 3:return"none"!==e.BORDER_STYLE&&(r.afterRenderCallback=function(){var t={height:r.width,width:r.width,yTop:r.yTop,yBot:r.yBot,xLeft:r.xLeft,xRight:r.xRight,formBorderColor:r.formBorderColor,rounded:!1,outside:!0,dashStyle:"dashed"==e.BORDER_STYLE?{dashArray:[5],dashPhase:0}:void 0};A.renderFlatBorders(o.controller,t)}),[2,r]}}))}))},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r,o;return a(this,(function(s){switch(s.label){case 0:return e=new u,this.question.backgroundImage?(i=(n=e).addBrick,[4,this.generateBackgroundImage(t)]):[3,2];case 1:i.apply(n,[s.sent()]),s.label=2;case 2:return o=(r=e).addBrick,[4,this.generateSign(t)];case 3:return o.apply(r,[s.sent()]),[2,[e]]}}))}))},e.BORDER_STYLE="dashed",e}(x);F.getInstance().register("signaturepad",gt);var mt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.question=n,r}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var n;return a(this,(function(i){switch(i.label){case 0:return this.shouldRenderAsComment?[4,A.createCommentFlat(t,this.question,this.controller,!0,{rows:e.MULTILINE_TEXT_ROWS_COUNT})]:(n=A.createTextFieldRect(t,this.controller),[2,[new P(this.question,this.controller,n)]]);case 1:return[2,[i.sent()]]}}))}))},e.MULTILINE_TEXT_ROWS_COUNT=1,e}(x);F.getInstance().register("text",mt);var yt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.generateFlatsHeader=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r,o,s;return a(this,(function(a){switch(a.label){case 0:e=[],n=A.clone(t),this.question.hasRows&&(n.xLeft+=this.rowTitleWidth+this.controller.unitWidth*A.GAP_BETWEEN_COLUMNS),i=0,a.label=1;case 1:return i<this.question.visibleColumns.length?(this.controller.pushMargins(),this.controller.margins.left=n.xLeft,this.controller.margins.right+=A.getPageAvailableWidth(this.controller)-this.columnWidth,o=(r=e).push,[4,A.createBoldTextFlat(n,this.question,this.controller,this.question.visibleColumns[i].locText)]):[3,4];case 2:o.apply(r,[a.sent()]),n.xLeft+=this.columnWidth+this.controller.unitWidth*A.GAP_BETWEEN_COLUMNS,this.controller.popMargins(),a.label=3;case 3:return i++,[3,1];case 4:return[2,[s=new(u.bind.apply(u,l([void 0],e,!1))),A.createRowlineFlat(A.createPoint(s),this.controller)]]}}))}))},e.prototype.generateFlatsRows=function(t,n){return s(this,void 0,void 0,(function(){var i,r,o,s,l;return a(this,(function(a){switch(a.label){case 0:i=[],r=A.clone(t),o=0,a.label=1;case 1:return o<this.question.visibleRows.length?(s="row"+o,[4,new vt(this.survey,this.question,this.controller,this.question.visibleRows[o],o,s,0==o,n,this.rowTitleWidth,this.columnWidth).generateFlatsContent(r)]):[3,4];case 2:l=a.sent(),(r=A.createPoint(A.mergeRects.apply(A,l))).yTop+=this.controller.unitHeight*e.GAP_BETWEEN_ROWS,i.push.apply(i,l),a.label=3;case 3:return o++,[3,1];case 4:return[2,i]}}))}))},e.prototype.calculateColumnsWidthes=function(){var t=A.getPageAvailableWidth(this.controller);this.question.hasRows&&this.question.rowTitleWidth?(this.controller.pushMargins(),this.rowTitleWidth=A.parseWidth(this.question.rowTitleWidth,t),this.controller.margins.left+=this.rowTitleWidth+this.controller.unitWidth*A.GAP_BETWEEN_COLUMNS,this.columnWidth=A.getColumnWidth(this.controller,this.question.visibleColumns.length),this.controller.popMargins()):this.columnWidth=this.rowTitleWidth=A.getColumnWidth(this.controller,this.question.visibleColumns.length+(this.question.hasRows?1:0))},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var n,i,r,o,s,l,c;return a(this,(function(a){switch(a.label){case 0:return this.calculateColumnsWidthes(),n="list"===this.question.renderAs||"list"===this.controller.matrixRenderAs||this.columnWidth<this.controller.measureText(A.MATRIX_COLUMN_WIDTH).width,i=A.clone(t),r=[],n||!this.question.showHeader||0==this.question.visibleColumns.length?[3,2]:[4,this.generateFlatsHeader(i)];case 1:o=a.sent(),(i=A.createPoint(A.mergeRects.apply(A,o))).yTop+=e.GAP_BETWEEN_ROWS*this.controller.unitHeight,r.push.apply(r,o),a.label=2;case 2:return l=(s=r.push).apply,c=[r],[4,this.generateFlatsRows(i,n)];case 3:return l.apply(s,c.concat([a.sent()])),[2,r]}}))}))},e.GAP_BETWEEN_ROWS=.5,e}(x),vt=function(t){function e(e,n,i,r,o,s,a,l,c,h){void 0===a&&(a=!1),void 0===l&&(l=!1);var u=t.call(this,e,n,i)||this;return u.survey=e,u.controller=i,u.row=r,u.rowIndex=o,u.key=s,u.isFirst=a,u.isVertical=l,u.rowTitleWidth=c,u.columnWidth=h,u.questionMatrix=n,u}return n(e,t),e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var e;return a(this,(function(n){switch(n.label){case 0:return this.isVertical?[4,this.generateFlatsVerticallyCells(t)]:[3,2];case 1:return e=n.sent(),[3,4];case 2:return[4,this.generateFlatsHorizontallyCells(t)];case 3:e=n.sent(),n.label=4;case 4:return[2,e]}}))}))},e.prototype.generateTextComposite=function(t,e,n){return s(this,void 0,void 0,(function(){var i,r,o,s,l;return a(this,(function(a){switch(a.label){case 0:return i=A.clone(t),r=this.row.value==e.value,o=A.createRect(i,A.getPageAvailableWidth(this.controller),this.controller.unitHeight),s=this.generateFlatItem(o,e,n,this.key,r,{row:this.row,rowIndex:this.rowIndex}),i.yTop=s.yBot+this.controller.unitHeight*A.GAP_BETWEEN_ITEM_TEXT,[4,A.createTextFlat(i,this.questionMatrix,this.controller,this.questionMatrix.getCellDisplayLocText(this.row.name,e),b)];case 1:return l=a.sent(),[2,new u(s,l)]}}))}))},e.prototype.generateItemCompoiste=function(t,e,n){return s(this,void 0,void 0,(function(){var i,r,o,s,l;return a(this,(function(a){switch(a.label){case 0:return i=A.clone(t),r=this.row.value==e.value,o=A.createRect(i,this.controller.unitHeight,this.controller.unitHeight),s=this.generateFlatItem(A.moveRect(A.scaleRect(o,A.SELECT_ITEM_FLAT_SCALE),o.xLeft),e,n,this.key,r,{row:this.row,rowIndex:this.rowIndex}),i.xLeft=s.xRight+this.controller.unitWidth*A.GAP_BETWEEN_ITEM_TEXT,[4,A.createTextFlat(i,this.questionMatrix,this.controller,e.locText,b)];case 1:return l=a.sent(),[2,new u(s,l)]}}))}))},e.prototype.generateFlatsHorizontallyCells=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r,o,s,c,h,f,d,p;return a(this,(function(a){switch(a.label){case 0:return e=[],n=A.clone(t),this.questionMatrix.hasRows?(this.controller.pushMargins(),n.xLeft=this.controller.margins.left,this.controller.margins.right+=A.getPageAvailableWidth(this.controller)-this.rowTitleWidth,r=(i=e).push,[4,A.createTextFlat(n,this.questionMatrix,this.controller,this.row.locText,b)]):[3,2];case 1:r.apply(i,[a.sent()]),n.xLeft+=this.rowTitleWidth+this.controller.unitWidth*A.GAP_BETWEEN_COLUMNS,this.controller.popMargins(),a.label=2;case 2:o=0,a.label=3;case 3:return o<this.questionMatrix.visibleColumns.length?(s=this.questionMatrix.visibleColumns[o],c=this.row.value==s.value,this.controller.pushMargins(),this.controller.margins.left=n.xLeft,this.controller.margins.right+=A.getPageAvailableWidth(this.controller)-this.columnWidth,this.questionMatrix.hasCellText?(f=(h=e).push,[4,this.generateTextComposite(n,s,o)]):[3,5]):[3,8];case 4:return f.apply(h,[a.sent()]),[3,6];case 5:d=A.createRect(n,this.controller.unitHeight,this.controller.unitHeight),e.push(this.generateFlatItem(A.moveRect(A.scaleRect(d,A.SELECT_ITEM_FLAT_SCALE),n.xLeft),s,o,this.key,c,{row:this.row,rowIndex:this.rowIndex})),a.label=6;case 6:n.xLeft+=this.columnWidth+this.controller.unitWidth*A.GAP_BETWEEN_COLUMNS,this.controller.popMargins(),a.label=7;case 7:return o++,[3,3];case 8:return[2,[p=new(u.bind.apply(u,l([void 0],e,!1))),A.createRowlineFlat(A.createPoint(p),this.controller)]]}}))}))},e.prototype.generateFlatsVerticallyCells=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r,o,s,c;return a(this,(function(a){switch(a.label){case 0:return e=[],n=A.clone(t),this.questionMatrix.hasRows?[4,A.createTextFlat(n,this.questionMatrix,this.controller,this.row.locText,b)]:[3,2];case 1:i=a.sent(),n.yTop=i.yBot+x.CONTENT_GAP_VERT_SCALE*this.controller.unitHeight,e.push(i),a.label=2;case 2:return this.generateFlatComposite=this.questionMatrix.hasCellText?this.generateTextComposite:this.generateItemCompoiste,o=(r=e.push).apply,s=[e],[4,this.generateVerticallyItems(n,this.questionMatrix.visibleColumns)];case 3:return o.apply(r,s.concat([a.sent()])),[2,[c=new(u.bind.apply(u,l([void 0],e,!1))),A.createRowlineFlat(A.createPoint(c),this.controller)]]}}))}))},e}(X);c.Serializer.removeProperty("matrix","renderAs"),c.Serializer.addProperty("matrix",{name:"renderAs",default:"auto",visible:!1,choices:["auto","list"]}),F.getInstance().register("matrix",yt);var bt=function(t){function e(e,n,i,r){void 0===r&&(r=!0);var o=t.call(this,e,n,i)||this;return o.survey=e,o.isMultiple=r,o.question=n,o}return n(e,t),Object.defineProperty(e.prototype,"visibleRows",{get:function(){return this.visibleRowsValue||(this.visibleRowsValue=this.question.renderedTable.rows.filter((function(t){return t.visible}))),this.visibleRowsValue},enumerable:!1,configurable:!0}),e.prototype.generateFlatsCellTitle=function(t,e){return s(this,void 0,void 0,(function(){var n,i,r;return a(this,(function(o){switch(o.label){case 0:return n=new u,r=(i=n).addBrick,[4,A.createTextFlat(t,this.question,this.controller,e,b)];case 1:return r.apply(i,[o.sent()]),[2,n]}}))}))},e.prototype.generateFlatsCell=function(t,e,n){return s(this,arguments,void 0,(function(t,e,n,i){var r,o,s,l,c,h,f,d,p,g;return void 0===i&&(i=!0),a(this,(function(a){switch(a.label){case 0:return r=new u,e.hasQuestion?"footer"!=n||e.question.isAnswered?[3,1]:[3,4]:[3,5];case 1:return i&&e.isChoice?(o=F.getInstance().create(this.survey,e.question,this.controller,e.question.getType()),s=A.moveRect(A.scaleRect(A.createRect(t,this.controller.unitHeight,this.controller.unitHeight),A.SELECT_ITEM_FLAT_SCALE),t.xLeft),r.addBrick(o.generateFlatItem(s,e.item,e.choiceIndex)),[3,4]):[3,2];case 2:return e.question.titleLocation=A.TITLE_LOCATION_MATRIX,c=(l=r.addBrick).apply,h=[r],[4,A.generateQuestionFlats(this.survey,this.controller,e.question,t)];case 3:c.apply(l,h.concat([a.sent()])),a.label=4;case 4:return[3,9];case 5:return e.hasTitle?"header"!=n?[3,7]:(d=(f=r).addBrick,[4,A.createBoldTextFlat(t,this.question,this.controller,e.locTitle)]):[3,9];case 6:return d.apply(f,[a.sent()]),[3,9];case 7:return g=(p=r).addBrick,[4,A.createTextFlat(t,this.question,this.controller,e.locTitle,b)];case 8:g.apply(p,[a.sent()]),a.label=9;case 9:return[2,r]}}))}))},Object.defineProperty(e.prototype,"hasDetailPanel",{get:function(){var t=this;return this.visibleRows.some((function(e){return e.row&&t.question.hasDetailPanel(e.row)}))},enumerable:!1,configurable:!0}),e.prototype.ignoreCell=function(t,e,n,i){return void 0===i&&(i=!0),!(i||"footer"!=n||!t.hasQuestion||t.question.isAnswered)||!(t.hasQuestion||t.hasTitle||this.isMultiple&&(this.hasDetailPanel?1==e:0==e))},e.prototype.getRowLocation=function(t){return t===this.question.renderedTable.headerRow?"header":this.question.renderedTable.footerRow===t?"footer":void 0},e.prototype.generateFlatsRowHorisontal=function(t,e,n){return s(this,void 0,void 0,(function(){var i,r,o,s,l,c,h;return a(this,(function(a){switch(a.label){case 0:i=new u,r=A.clone(t),o=this.controller.paperWidth-this.controller.margins.left+this.controller.unitWidth*A.GAP_BETWEEN_COLUMNS,this.controller.pushMargins(),s=0,l=this.getRowLocation(e),c=0,a.label=1;case 1:return c<e.cells.length?this.ignoreCell(e.cells[c],c,l)?[3,3]:(this.controller.margins.left=this.controller.paperWidth-o+this.controller.unitWidth*A.GAP_BETWEEN_COLUMNS,this.controller.margins.right=this.controller.paperWidth-this.controller.margins.left-n[s],o=this.controller.margins.right,r.xLeft=this.controller.margins.left,[4,this.generateFlatsCell(r,e.cells[c],l)]):[3,4];case 2:(h=a.sent()).isEmpty||i.addBrick(h),s++,a.label=3;case 3:return c++,[3,1];case 4:return this.controller.popMargins(),[2,i]}}))}))},e.prototype.generateFlatsRowVertical=function(t,n){return s(this,void 0,void 0,(function(){var i,r,o,s,l,c,h,f,d,p;return a(this,(function(a){switch(a.label){case 0:i=new u,r=A.clone(t),o=this.getRowLocation(n),s=0,a.label=1;case 1:return s<n.cells.length?this.ignoreCell(n.cells[s],s,o,!1)?[3,5]:this.question.renderedTable.showHeader&&(!this.isMultiple||s>0)&&(null===(p=null===(d=n.cells[s].cell)||void 0===d?void 0:d.column)||void 0===p?void 0:p.locTitle)?(c=(l=i).addBrick,[4,this.generateFlatsCellTitle(r,n.cells[s].cell.column.locTitle)]):[3,3]:[3,6];case 2:c.apply(l,[a.sent()]),r.yTop=i.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,a.label=3;case 3:return f=(h=i).addBrick,[4,this.generateFlatsCell(r,n.cells[s],o,!1)];case 4:f.apply(h,[a.sent()]),r.yTop=i.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,a.label=5;case 5:return s++,[3,1];case 6:return[2,i]}}))}))},e.prototype.getAvalableWidth=function(t){return A.getPageAvailableWidth(this.controller)-(t-1)*this.controller.unitWidth*A.GAP_BETWEEN_COLUMNS},e.prototype.calculateColumnWidth=function(t,e){for(var n=this,i=this.getAvalableWidth(e),r=i,o=e,s=[],a=[],l=t[0].cells.filter((function(t,e){return!n.ignoreCell(t,e)})),c=0;c<e;c++){var h=A.parseWidth(l[c].width,i,e)||0;r-=h,0!==h?o--:a.push(l[c]),s.push(h)}if(0===o)return s;var u=this.controller.measureText(A.MATRIX_COLUMN_WIDTH).width;return a.sort((function(t,n){var r=A.parseWidth(t.minWidth,i,e)||0;return(A.parseWidth(n.minWidth,i,e)||0)>r?1:-1})).forEach((function(t){var n=r/o,a=A.parseWidth(t.minWidth,i,e)||0;a>n&&a>u&&(r-=a,o--),s[l.indexOf(t)]=Math.max(u,a,n)})),s},e.prototype.generateOneRow=function(t,e,n,i){return s(this,void 0,void 0,(function(){return a(this,(function(r){switch(r.label){case 0:return n?[4,this.generateFlatsRowHorisontal(t,e,i)]:[3,2];case 1:case 3:return[2,r.sent()];case 2:return[4,this.generateFlatsRowVertical(t,e)]}}))}))},e.prototype.generateFlatsRows=function(t,n,i,r){return s(this,void 0,void 0,(function(){var o,s,l,c,h,f,d,p,g,m;return a(this,(function(a){switch(a.label){case 0:o=A.clone(t),s=[],l=0,a.label=1;case 1:return l<n.length?[4,this.generateOneRow(o,n[l],r,this.calculateColumnWidth(n,i))]:[3,6];case 2:if((c=a.sent()).isEmpty&&(!n[l].row||!n[l].row.hasPanel))return[3,5];if(c.isEmpty||(l!==n.length-1&&(o.yTop=c.yBot,c.addBrick(A.createRowlineFlat(o,this.controller))),s.push(c),o.yTop=c.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight),!n[l].row||!n[l].row.hasPanel)return[3,5];for(n[l].row.showDetailPanel(),h=n[l].row.detailPanel,f=0;f<h.questions.length;f++)h.questions[f].id+="_"+l;return[4,y.generateFlatsPanel(this.survey,this.controller,h,o)];case 3:return d=a.sent(),(p=new u).addBrick.apply(p,d),o.yTop=p.yBot+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,s.push(p),l!==n.length-1&&this.question.renderedTable.showHeader&&r?[4,this.generateOneRow(o,n[0],r,this.calculateColumnWidth(n,i))]:[3,5];case 4:g=a.sent(),m=p.yBot,g.isEmpty||(m=g.yBot,s.push(g)),o.yTop=m+e.GAP_BETWEEN_ROWS*this.controller.unitHeight,a.label=5;case 5:return l++,[3,1];case 6:return[2,s]}}))}))},e.prototype.calculateIsWide=function(t,e){var n=[];if(t.showHeader&&n.push(t.headerRow),n.push.apply(n,this.visibleRows),0===n.length)return!0;var i=this.calculateColumnWidth(n,e).reduce((function(t,e){return t+e}),0);return"list"!==this.question.renderAs&&"list"!==this.controller.matrixRenderAs&&Math.floor(i)<=Math.floor(this.getAvalableWidth(e))},e.prototype.getRowsToRender=function(t,e,n){var i=[],r=this.visibleRows;return t.showHeader&&n&&i.push(t.headerRow),i.push.apply(i,r),t.hasRemoveRows&&e&&i.pop(),t.showFooter&&i.push(t.footerRow),i},e.prototype.getColCount=function(t,e){var n=this;return e[0]?e[0].cells.filter((function(t,e){return!n.ignoreCell(t,e)})).length:t.showHeader&&t.headerRow?t.headerRow.cells.length:t.showFooter&&t.footerRow?t.footerRow.cells.length:0},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var e,n,i,r,o;return a(this,(function(s){switch(s.label){case 0:return e=this.question.renderedTable,n="vertical"===this.question.columnLayout,0!==(i=this.getColCount(e,this.visibleRows))||this.hasDetailPanel?((r=this.calculateIsWide(e,i))||(this.question.isMobile=!0,n=!1,e=this.question.renderedTable,this.visibleRowsValue=void 0,i=this.getColCount(e,this.visibleRows)),o=this.getRowsToRender(e,n,r),[4,this.generateFlatsRows(t,o,i,r)]):[2,[new u(A.createRowlineFlat(t,this.controller))]];case 1:return[2,s.sent()]}}))}))},e.GAP_BETWEEN_ROWS=.5,e}(x);c.Serializer.removeProperty("matrixdropdown","renderAs"),c.Serializer.addProperty("matrixdropdown",{name:"renderAs",default:"auto",visible:!1,choices:["auto","list"]}),F.getInstance().register("matrixdropdown",bt);var xt=function(t){function e(e,n,i){var r=t.call(this,e,n,i,!1)||this;return r.survey=e,r}return n(e,t),e}(bt);c.Serializer.removeProperty("matrixdynamic","renderAs"),c.Serializer.addProperty("matrixdynamic",{name:"renderAs",default:"auto",visible:!1,choices:["auto","list"]}),F.getInstance().register("matrixdynamic",xt);var Tt=function(t){function e(e,n,i){var r=t.call(this,e,n,i)||this;return r.survey=e,r.controller=i,r.question=n,r}return n(e,t),e.prototype.getVisibleRows=function(){return this.question.getRows().filter((function(t){return t.isVisible}))},e.prototype.generateFlatItem=function(t,e,n,i){return s(this,void 0,void 0,(function(){var e,n,r,o,s,l,c,h;return a(this,(function(a){switch(a.label){case 0:return e=A.getPageAvailableWidth(this.controller),this.controller.pushMargins(),this.controller.margins.right=this.controller.paperWidth-this.controller.margins.left-e*A.MULTIPLETEXT_TEXT_PERS,r=u.bind,[4,A.createBoldTextFlat(t,this.question,this.controller,i.locTitle)];case 1:return n=new(r.apply(u,[void 0,a.sent()])),this.controller.popMargins(),o=F.getInstance().create(this.survey,i.editor,this.controller,"text"),s=A.createTextFieldRect({xLeft:t.xLeft+e*A.MULTIPLETEXT_TEXT_PERS,yTop:t.yTop},this.controller),c=(l=n.addBrick).apply,h=[n],[4,o.generateFlatsContent(s)];case 2:return c.apply(l,h.concat([a.sent()])),[2,n]}}))}))},e.prototype.generateFlatsContent=function(t){return s(this,void 0,void 0,(function(){var n,i,r,o,s,l,c;return a(this,(function(a){switch(a.label){case 0:n=[],i=A.clone(t),r=this.getVisibleRows(),o=0,a.label=1;case 1:if(!(o<r.length))return[3,7];n.push(new u),s=i.yTop,this.controller.pushMargins(),l=0,a.label=2;case 2:return l<r[o].cells.length?(this.controller.pushMargins(),A.setColumnMargins(this.controller,this.question.colCount,l),i.xLeft=this.controller.margins.left,[4,this.generateFlatItem(i,o,l,r[o].cells[l].item)]):[3,5];case 3:c=a.sent(),n[n.length-1].addBrick(c),s=Math.max(s,c.yBot),this.controller.popMargins(),a.label=4;case 4:return l++,[3,2];case 5:this.controller.popMargins(),i.xLeft=t.xLeft,i.yTop=s,n[n.length-1].addBrick(A.createRowlineFlat(i,this.controller)),i.yTop+=A.EPSILON,i.yTop+=this.controller.unitHeight*e.ROWS_GAP_SCALE,a.label=6;case 6:return o++,[3,1];case 7:return[2,n]}}))}))},e.ROWS_GAP_SCALE=.195,e}(x);F.getInstance().register("multipletext",Tt);var Ft=function(t){function e(e,n,i){var r=t.call(this,e,n,i(n.helperDoc,e,0,0))||this;return r.renderFunc=i,r}return n(e,t),e.prototype.renderInteractive=function(){return s(this,void 0,void 0,(function(){var t=this;return a(this,(function(e){switch(e.label){case 0:return[4,new Promise((function(e){t.renderFunc(t.controller.doc,t.question,t.xLeft,t.yTop),e()}))];case 1:return e.sent(),[2]}}))}))},e}(v);(0,c.checkLibraryVersion)("".concat("2.0.0-rc.3"),"survey-pdf")})(),o})()));