survey-pdf 1.12.21 → 2.0.0-rc.1
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.
- package/package.json +2 -2
- package/survey.pdf.d.ts +1 -1
- package/survey.pdf.fonts.js +2 -2
- package/survey.pdf.fonts.min.js +1 -1
- package/survey.pdf.js +4 -4
- package/survey.pdf.min.js +2 -2
package/survey.pdf.min.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* surveyjs - SurveyJS PDF library
|
|
2
|
+
* surveyjs - SurveyJS PDF library v2.0.0-rc.1
|
|
3
3
|
* Copyright (c) 2015-2025 Devsoft Baltic OÜ - http://surveyjs.io/
|
|
4
4
|
* License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
|
5
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})];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("1.12.21"),"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){/**
|
|
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.1"),"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
7
|
* @license
|
|
8
8
|
* Copyright (c) 2016 Alexander Weidt,
|
|
9
9
|
* https://github.com/BiggA94
|