(function(n,t){var i,r;if(typeof exports=="object"&&typeof module=="object")module.exports=t(require("knockout"),require("jquery"));else if(typeof define=="function"&&define.amd)define(["knockout","jquery"],t);else{i=typeof exports=="object"?t(require("knockout"),require("jquery")):t(n.ko,n.jQuery);for(r in i)(typeof exports=="object"?exports:n)[r]=i[r]}})(this,function(n,t){return function(n){function t(r){if(i[r])return i[r].exports;var u=i[r]={i:r,l:!1,exports:{}};return n[r].call(u.exports,u,u.exports,t),u.l=!0,u.exports}var i={};return t.m=n,t.c=i,t.d=function(n,i,r){t.o(n,i)||Object.defineProperty(n,i,{enumerable:!0,get:r})},t.r=function(n){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"});Object.defineProperty(n,"__esModule",{value:!0})},t.t=function(n,i){var r,u;if((i&1&&(n=t(n)),i&8)||i&4&&typeof n=="object"&&n&&n.__esModule)return n;if(r=Object.create(null),t.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:n}),i&2&&typeof n!="string")for(u in n)t.d(r,u,function(t){return n[t]}.bind(null,u));return r},t.n=function(n){var i=n&&n.__esModule?function(){return n["default"]}:function(){return n};return t.d(i,"a",i),i},t.o=function(n,t){return Object.prototype.hasOwnProperty.call(n,t)},t.p="",t(t.s=12)}([function(t){t.exports=n},,,function(n,t,i){"use strict";function s(n,t){function i(){this.constructor=n}if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");r(n,t);n.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}function h(n,t,i,r){var f=arguments.length,u=f<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,i):r,e,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")u=Reflect.decorate(n,t,i,r);else for(o=n.length-1;o>=0;o--)(e=n[o])&&(u=(f<3?e(u):f>3?e(t,i,u):e(t,i))||u);return f>3&&u&&Object.defineProperty(t,i,u),u}function u(n){return this instanceof u?(this.v=n,this):new u(n)}var r,f,e,o;i.d(t,"b",function(){return s});i.d(t,"a",function(){return h});r=function(n,t){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])},r(n,t)};f=function(){return f=Object.assign||function(n){for(var t,r,i=1,u=arguments.length;i<u;i++){t=arguments[i];for(r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},f.apply(this,arguments)};e=Object.create?function(n,t,i,r){r===undefined&&(r=i);var u=Object.getOwnPropertyDescriptor(t,i);(!u||("get"in u?!t.__esModule:u.writable||u.configurable))&&(u={enumerable:!0,get:function(){return t[i]}});Object.defineProperty(n,r,u)}:function(n,t,i,r){r===undefined&&(r=i);n[r]=t[i]};o=Object.create?function(n,t){Object.defineProperty(n,"default",{enumerable:!0,value:t})}:function(n,t){n["default"]=t}},function(n,t,i){"use strict";function s(n){for(var i=window.atob(n),r=i.length,u=new Uint8Array(r),t=0;t<r;t++)u[t]=i.charCodeAt(t);return u.buffer}function h(n){return["AT","BE","BG","HR","CY","CZ","DK","EE","FI","FR","DE","EL","HU","IE","IT","LV","LT","LU","MT","NL","PL","PT","RO","SK","SI","ES","SE"].indexOf(!!n&&n.toUpperCase())!==-1}function e(n,t,i){var u=window.dataLayer||[],r;window.dataLayer=u;r=Math.abs(t);u.push({event:t>0?"add_to_cart":"remove_from_cart",ecommerce:{quantity:r,currency:i,Value:n.total,items:[{item_id:n.product(),item_name:n.title(),price:n.price,quantity:r}]}})}var u,o;i.d(t,"b",function(){return s});i.d(t,"c",function(){return h});i.d(t,"d",function(){return u});i.d(t,"e",function(){return e});i.d(t,"a",function(){return o});var r=i(0),c=i.n(r),f=i(5),l=i.n(f);u={"":{title:"Choose product to add..."},"1":{title:"SurveyJS Creator (including PDF)"},"2":{title:"SurveyJS PDF"},"3":{title:"SurveyJS Analytics"},"4":{title:"SurveyJS Pro"},"5":{title:"SurveyJS Basic"},"100":{title:"SurveyJS Creator (including PDF) Renewal"},"101":{title:"SurveyJS Creator (including PDF) Renewal"},"102":{title:"SurveyJS PDF Renewal"},"103":{title:"SurveyJS Analytics Renewal"},"104":{title:"SurveyJS Pro Renewal"},"105":{title:"SurveyJS Basic Renewal"},"204":{title:"SurveyJS Upgrade to Pro"}};o=function(){function n(n,t,i,e,o,s,h,c){var a=this,l;this.recalc=function(n,t){n===void 0&&(n=!1);!a.id||f.ajax({url:"/api/Cart/"+(n?"recalc":"update"),type:"POST",data:{Product:a.product(),Count:a.quantity,Id:a.id,Country:model.country(),CompanyName:model.companyName(),CompanyVATNumber:model.companyVATNumber(),Currency:model.currency()},success:function(n){updateOrderDetails(n);updateCartTopBarItem(n);!t||t(n)},error:function(){}})};this.forceRecalc=function(){a.recalc(!0)};l=this;l.product=r.observable(""+n||"1");l._quantity=r.observable(""+t||"1");l.id=i;l.personalDiscount=e;l.volumeDiscount=o;l.price=s;l.total=h;l.comment=c;l.title=r.computed(function(){return u[""+l.product()||""].title});l.totalDiscount=e>=0?e||o:Math.abs(e)+o;l.discountTitle=r.computed(function(){return!l.comment?l.title()+(!e?" (VOLUME DISCOUNT)":" (PERSONAL DISCOUNT)"):l.title()+" ("+l.comment+")"});l._productSubscr=l.product.subscribe(function(){return l.recalc()})}return Object.defineProperty(n.prototype,"quantity",{get:function(){return this._quantity()},set:function(n){var t=this._quantity();if(n!==t){this._quantity(n);this.onQuantityChanged(t,n)}},enumerable:!1,configurable:!0}),n.prototype.onQuantityChanged=function(n,t){var i=this;this.recalc(!1,function(){var r=parseInt(n),u=parseInt(t);e(i,u-r,model.currency())})},n.prototype.getJson=function(){return{id:this.id,product:this.product(),title:this.title(),quantity:this.quantity,price:this.price,total:this.total,personalDiscount:this.personalDiscount,volumeDiscount:this.volumeDiscount,totalDiscount:this.totalDiscount,discountTitle:this.discountTitle(),comment:this.comment}},n.prototype.dispose=function(){this._productSubscr.dispose();this.title.dispose()},n}()},function(n){n.exports=t},,,,,,,function(n,t,i){"use strict";function nt(n){var t=l(new Date(n.CreatedAt)),i=l(new Date(n.UpdatedOn));return new c(n.Name,t,n.Id,n.ResultId,n.PostId,n.PublishId,n.CreatorId,i,n.IsPublished,n.IsArchived)}function l(n){return n.toLocaleString("en-GB",{month:"short",day:"numeric",year:"numeric"})}function u(n){return n?"accessKey="+n:""}function rt(n){var t=document.createElement("textarea");return t.innerHTML=n,t.value}var f,h,y;i.r(t);i.d(t,"ExampleCodeCore",function(){return e});i.d(t,"ExampleCodeViewerItem",function(){return s});i.d(t,"ExampleCodeViewer",function(){return b});i.d(t,"ExampleCodeSandbox",function(){return k});i.d(t,"ExamplePlunker",function(){return d});i.d(t,"ExampleCodePen",function(){return g});i.d(t,"SurveyInfoModel",function(){return c});i.d(t,"createSurveyObject",function(){return nt});i.d(t,"getAccessKeyUrlComponent",function(){return u});i.d(t,"SurveyResultAccessModel",function(){return a});i.d(t,"SurveyStoreIPModel",function(){return v});i.d(t,"SurveyResults",function(){return tt});i.d(t,"NameEditorViewModel",function(){return it});i.d(t,"surveyHtmlDecode",function(){return rt});i.d(t,"_base64ToArrayBuffer",function(){return f.b});i.d(t,"isEUCountry",function(){return f.c});i.d(t,"productDescriptions",function(){return f.d});i.d(t,"writeCartChangedEvent",function(){return f.e});i.d(t,"Product",function(){return f.a});i.d(t,"TourViewModel",function(){return h});i.d(t,"tourDescription",function(){return y});var o=i(3),r=i(0),e=function(){function n(n,t,i,u,f,e){f===void 0&&(f="");e===void 0&&(e=undefined);this.name=n;this.product=t;this.platform=i;this.theme=u;this.version=f;this.themeModuleName=e;this.state=r.observable("empty")}return n.prototype.setSurveyJSON=function(n){this.surveyJSON=n},n.prototype.setThemeJSON=function(n){this.themeJSON=n;this.themeFile&&(this.replaceJsonFileContent(this.themeFile,this.themeJSON),this.updateThemeFileContent(this.themeFile))},Object.defineProperty(n.prototype,"isLoading",{get:function(){return this.state()==="loading"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isError",{get:function(){return this.state()==="error"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isReady",{get:function(){return this.state()==="ready"},enumerable:!1,configurable:!0}),n.prototype.isJsonFileName=function(n){return!!n&&(n.endsWith("json.js")||n.endsWith("json.ts"))},n.prototype.isThemeJsonFileName=function(n){return!!n&&(n.endsWith("theme.js")||n.endsWith("theme.ts"))},n.prototype.updateThemeFileContent=function(){},n.prototype.load=function(){if(this.state()==="ready"){this.onPerform();return}var n=new XMLHttpRequest,t=this;this.state("loading");n.onreadystatechange=function(){var r,i;if(n.readyState==4)if(n.status==200){if(r=n.responseText,!r){console.error("can't open the example in the CodeSandbox");return}if(i=JSON.parse(r),!!i&&Array.isArray(i.files)){t.onLoadFiles(i.files);t.onLoad(i);t.state("ready");t.onPerform()}else t.state("error")}else console.error("Something get wrong with 'GetCodeSandboxModel' api method"),t.state("error")};n.open("POST",this.getAPIUrl());n.setRequestHeader("Content-Type","application/json;charset=UTF-8");typeof themeModuleName!="undefined"&&window.themeModuleName||(window.themeModuleName="Default");n.send(JSON.stringify({id:this.name,platform:this.platform,product:this.product,theme:this.theme,version:this.version,themeModuleName:this.themeModuleName||themeModuleName}))},n.prototype.getAPIUrl=function(){return"/api/CodeViewer/getfiles"},n.prototype.onLoad=function(){},n.prototype.onLoadFiles=function(n){for(var i,t=0;t<n.length;t++)i=n[t].name,this.surveyJSON&&this.isJsonFileName(i)&&this.replaceJsonFileContent(n[t],this.surveyJSON),this.isThemeJsonFileName(i)&&(this.themeFile=n[t],this.themeJSON&&this.replaceJsonFileContent(n[t],this.themeJSON))},n.prototype.replaceJsonFileContent=function(n,t){var i=n.content,r=i.indexOf("=");r>-1&&r<30&&(i=i.substring(0,r+1)+" "+t,n.content=i)},n.prototype.onPerform=function(){},n.prototype.createForm=function(n,t){var i=document.getElementById(n);return!i?(i=document.createElement("form"),i.id=n,i.style.display="none !important",i.method="post",i.target="_blank",i.action=t,document.body.appendChild(i),i):i},n.prototype.createInput=function(n,t,i){var r=document.createElement("input");return r.setAttribute("type","hidden"),r.name=t,!i||(r.value=i),n.appendChild(r),r},n}(),p=20,w="/Content/Images/code-viewer/",s=function(){function n(n,t){this.fullName=n;this.content=t;this.isSelected=r.observable(!1);var i=n.split("/");this.level=i.length-1;this.name=i[this.level];this.isDirectory=this.name.indexOf(".")<0;this.padding=this.level*p+"px";this.imageSrc=w+this.getImageName()+".svg"}return Object.defineProperty(n.prototype,"cursor",{get:function(){return this.isDirectory?"arrow":"pointer"},enumerable:!1,configurable:!0}),n.prototype.getImageName=function(){if(this.isDirectory)return"folder";if(this.name==="package.json")return"npm";var n=this.name.split("."),t=n.length,i=t>1?n[t-1]:"js";return i==="scss"?"css":i},n}(),b=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t.selectorCodeElement=".source-code-dynamic code",t.items=r.observableArray(),t.selectedItem=r.observable(null),t.onClickItem=function(n){n&&!n.isDirectory&&t.selectItem(n)},t}return Object(o.b)(t,n),t.prototype.loadCode=function(){this.load()},Object.defineProperty(t.prototype,"currentContent",{get:function(){return!this.selectedItem()?"":this.selectedItem().content},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"currentClass",{get:function(){if(!this.selectedItem())return"";var n=this.selectedItem().fullName;return n.indexOf(".html")>-1?"content-html language-html":n.indexOf(".css")>-1||n.indexOf(".scss")>-1?"content-css language-css":n.indexOf(".json")>-1?"content-json language-json":"content-js language-javascript"},enumerable:!1,configurable:!0}),t.prototype.selectItem=function(n){var t,i;if(n&&!n.isDirectory&&(!this.selectedItem()||this.selectedItem().isSelected(!1),this.selectedItem(n),n.isSelected(!0),t=document.querySelectorAll(this.selectorCodeElement),t.length!==0))if(i=t[0],n.prettyContent)i.innerHTML=n.prettyContent;else{if(i.className=this.currentClass,i.textContent=n.content,!n.content)return;window.prettyElements&&(window.prettyElements(this.selectorCodeElement,!0),n.prettyContent=t[0].innerHTML)}},t.prototype.onLoad=function(n){var i=this,t=[],r={};n.files.forEach(function(n){i.createDirectories(t,r,n.name);t.push(new s(n.name,n.content))});this.items(t);this.selectItem(this.getFirstSelectedItem(t,n.defaultName));this.onLoadItems&&this.onLoadItems()},t.prototype.updateThemeFileContent=function(n){for(var t=undefined,r=this.items(),i=0;i<r.length;i++)if(r[i].fullName===n.name){t=r[i];break}t&&(t.content=n.content,t.prettyContent=undefined,t===this.selectedItem()&&this.selectItem(t))},t.prototype.getFirstSelectedItem=function(n,t){for(var u=null,i,r=0;r<n.length;r++)if((i=n[r],!i.isDirectory)&&(!t||(u||(u=i),i.fullName===t)))return i;return u},t.prototype.createDirectories=function(n,t,i){var e=i.split("/"),r,u,f;if(!(e.length<2))for(r="",u=0;u<e.length-1;u++)r+=e[u],t[r]||(f=new s(r,""),t[f.fullName]=f,n.push(f)),r+="/"},t}(e),k=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return Object(o.b)(t,n),t.prototype.createCodeSandbox=function(){this.form||(this.form=this.createForm("codeSandboxForm","https://codesandbox.io/api/v1/sandboxes/define"),this.parametersInput=this.createInput(this.form,"parameters"));this.load()},t.prototype.removeThemeJSON=function(){this.isThemeRemoved=!0},t.prototype.getAPIUrl=function(){return"/api/CodeViewer/getcodesandboxfiles"},t.prototype.onLoad=function(n){var t,i;this.parameters={files:this.convertDataToFiles(n)};t=this.parameters.files["package.json"];!t||!t.content||(i=JSON.parse(t.content.replace(/'/g,'"').replace(/\n/g,"")),this.parameters.files["package.json"].content=i);this.parameters.files["sandbox.config.json"]={content:{infiniteLoopProtection:!1}}},t.prototype.onPerform=function(){this.parametersInput.value=this.getParameters();this.form.submit();this.parametersInput.value=""},t.prototype.convertDataToFiles=function(n){var t=this,i={};return n.files.forEach(function(n){(t.isThemeRemoved!==!0||n!==t.themeFile)&&(i[n.name]={content:n.content})}),i},t.prototype.compress=function(n){return LZString.compressToBase64(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")},t.prototype.getParameters=function(){return this.compress(JSON.stringify(this.parameters))},t}(e),d=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return Object(o.b)(t,n),t.prototype.createPlunker=function(n){this.form||(this.form=this.createForm("plnkrForm_"+this.platform,"https://plnkr.co/edit/?p=preview"));this.form.innerHTML="";this.createInput(this.form,"tags[0]","surveyjs");this.createInput(this.form,"tags[1]",this.platform);this.createInput(this.form,"tags[2]","example");this.createInput(this.form,"private","true");this.createInput(this.form,"description",n);this.load()},t.prototype.submit=function(){this.form&&this.form.submit()},t.prototype.setThemeJSON=function(t){n.prototype.setThemeJSON.call(this,t);this.themeInput&&this.themeFile&&(this.themeInput.value=this.themeFile.content)},t.prototype.getAPIUrl=function(){return"/api/CodeViewer/getplunkerfiles"},t.prototype.onLoad=function(n){var t=this;n.files.forEach(function(n){t.addInput(n)})},t.prototype.onPerform=function(){this.form.submit()},t.prototype.addInput=function(n){var t=document.createElement("input");t.setAttribute("type","hidden");t.setAttribute("name","files["+n.name+"]");t.setAttribute("value",n.content);this.form.appendChild(t);this.isThemeJsonFileName(n.name)&&(this.themeInput=t)},t}(e),g=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return Object(o.b)(t,n),t.prototype.createCodePen=function(n){this.title=n;this.form||(this.form=this.createForm("codePenForm","https://codepen.io/pen/define"),this.parametersInput=this.createInput(this.form,"data"));this.load()},t.prototype.getAPIUrl=function(){return"/api/CodeViewer/getcodepenfiles"},t.prototype.onLoad=function(n){this.parameters=this.convertDataToFiles(n)},t.prototype.onPerform=function(){this.parametersInput.value=this.getParameters();this.form.submit();this.parametersInput.value=""},t.prototype.convertDataToFiles=function(n){var t={},i="";return n.files.forEach(function(n){n.name.indexOf(".js")>0?i+=n.content:t[n.name]=n.content}),!i||!t.js||(t.js=i+"\n"+t.js),!this.title||(t.title="SurveyJS "+this.product+" for "+this.platform+" : "+this.title),t.tags=["surveyjs",this.platform,this.product],t},t.prototype.getParameters=function(){return JSON.stringify(this.parameters)},t}(e),c=function(){function n(n,t,i,u,f,e,o,s,h,c){this.createdAt=t;this.id=i;this.resultId=u;this.postId=f;this.publishId=e;this.creatorId=o;this.updatedOn=s;this.name=r.observable();this.editingName=r.observable();this.showInfo=r.observable(!1);this.isEditing=r.observable(!1);this.isValid=r.observable(!1);this.isPublished=r.observable(null);this.name(n);this.editingName(n);this.isValid(!!i);this.isPublished(h);this.isArchived=c}return n}();var a=function(n,t,i,f){var e=this;this.id=n;this.accesstype=r.observable(t=="True");this.url=i;e.changeAccessType=function(n){$.ajax({url:e.url+"makeResultPublic?"+u(f)+"&id="+e.id+"&makeResultPublic="+n,type:"PUT",success:function(n){e.accesstype(n)}})};e.allowAccess=function(){e.changeAccessType(!0)};e.disableAccess=function(){e.changeAccessType(!1)}},v=function(n,t,i,f){var e=this;this.id=n;this.storeIP=r.observable(t=="True");this.url=i;e.changeStoreIP=function(n){$.ajax({url:e.url+"storeIPAddressInResult?"+u(f)+"&id="+e.id+"&storeIPAddress="+n,type:"PUT",success:function(n){e.storeIP(n)}})};e.allowStoreIP=function(){e.changeStoreIP(!0)};e.disableStoreIP=function(){e.changeStoreIP(!1)}},tt=function(){function n(n,t,i,f,e,o,s,h){var c=this,l,y,w,p;e===void 0&&(e=!1);o===void 0&&(o=null);s===void 0&&(s="https://api.surveyjs.io/private/Surveys/");h===void 0&&(h="");this.surveyJson=n;this.surveyId=t;this.isTrustedAccess=e;this.postId=o;this.url=s;this.accessKey=h;this.currentLocale=r.observable(window.Survey.surveyLocalization.currentLocale||"en");this.showSurveyResult=function(n){var t=c.surveyAnalyticsTabulator.data[n];c.surveyWindow.survey.data=t;c.surveyWindow.survey.currentPage=0;c.surveyWindow.isExpanded=!0;c.surveyWindow.show()};this.clearAllVisible=r.observable(!1);this.clearAllName=r.observable("");this.clearAllEnabled=r.computed(function(){return"@Model.Survey.Name"===c.clearAllName()});this.preventSendingAJAX=!1;this.isLoading=r.observable(!1);this.saveTableState=function(n,t){$.ajax({url:this.url+"setResultTableState?"+u(this.accessKey),type:"PUT",data:{Id:n,Json:JSON.stringify(t)},success:function(){console.info("table state successfully saved")}})};this.saveSummaryState=function(n,t){$.ajax({url:c.url+"setResultSummaryState?"+u(c.accessKey),type:"PUT",data:{Id:n,Json:JSON.stringify(t)},success:function(){console.info("summary state successfully saved")}})};this.savePermissions=function(n,t){$.ajax({url:c.url+"setResultPermissions?"+u(c.accessKey),type:"PUT",data:{Id:n,Json:JSON.stringify(t)},success:function(){console.info("results permissions successfully saved")}})};this.activeTab=r.observable("");this.totalResponses=r.observable(0);this.firstResponseAt=r.observable("");this.lastResponseAt=r.observable("");l=this;y="survey-results-page__survey-window";this.surveyWindow=new window.Survey.SurveyWindow(n);this.surveyWindow.survey.mode="display";w=this.surveyWindow.expandedChangedCallback;this.surveyWindow.expandedChangedCallback=function(){w();l.surveyWindow.windowElement.className=l.surveyWindow.isExpanded?y:y+" survey-results-page__survey-window--closed"};this.surveyWindow.windowElement.className=y;this.resultAccessModel=new a(t,i,s,h);this.storeIpModel=new v(t,f,s,h);this.usedLocales=(this.surveyWindow.survey.getUsedLocales()||[]).map(function(n){return{locName:n,locTitle:window.Survey.surveyLocalization.localeNames[n]}});p=this.survey.locale||window.Survey.surveyLocalization.currentLocale||"en";this.usedLocales.length>0&&!this.usedLocales.some(function(n){return n.locName===p})&&(p=this.usedLocales[0].locName);this.currentLocale(p);this.currentLocale.subscribe(function(n){c.survey.locale=n;c.surveyAnalyticsTabulator&&c.surveyAnalyticsTabulator.update(!0);c.surveyAnalyticsVisPanel&&c.surveyAnalyticsVisPanel.refresh(!0)})}return Object.defineProperty(n.prototype,"survey",{get:function(){var n=this.surveyWindow.survey,i,t;return n.getQuestionByName("HappendAt")||(i=n.addNewPage("page1"),i.addNewQuestion("text","HappendAt"),t=n.getQuestionByName("HappendAt"),t.visible=!1,t.title="Submitted"),n},enumerable:!1,configurable:!0}),n.prototype.ensureIPAddressQuestionExists=function(){var n=this.survey,i,t;n.getQuestionByName("IPAddress")||(i=n.addNewPage("page1"),i.addNewQuestion("text","IPAddress"),t=n.getQuestionByName("IPAddress"),t.visible=!1,t.title="IPAddress")},n.prototype.insertParameter=function(n,t){n=encodeURI(n);t=encodeURI(t);for(var i=document.location.search.substr(1).split("&"),r=i.length,u;r--;)if(u=i[r].split("="),u[0]==n){u[1]=t;i[r]=u.join("=");break}r<0&&(i[i.length]=[n,t].join("="));document.location.search=i.join("&")},n.prototype.showClearAll=function(n){n.clearAllVisible(!0);document.getElementById("ctrlClearAll").style.visibility="visible"},n.prototype.doClearAllResults=function(){var n=confirm("Are you absolutely sure that you want to delete all results ?");n&&(this.isLoading(!0),$.ajax({url:this.url+"deleteAllResults?"+u(this.accessKey)+"&id="+this.surveyId,type:"DELETE",success:function(){window.location.reload()}}))},n.prototype.deleteSurveyResult=function(n){var t=this,i;(t.isLoading(!0),i=t.surveyAnalyticsTabulator.data[n.getDataPosition()].InstanceId,t.postId&&i)&&$.ajax({url:this.url+"deleteResult?"+u(this.accessKey)+"&postId="+t.postId+"&instanceId="+i,type:"DELETE",success:function(){n.remove();t.surveyAnalyticsTabulator.data.splice(n.getDataPosition(),1)},complete:function(){window.location.reload()}})},n.prototype.removeTableState=function(){var n=confirm("Are you absolutely sure that you want to remove table state ?");n&&$.ajax({url:this.url+"setResultTableState?"+u(this.accessKey),type:"PUT",data:{Id:this.surveyId,Json:null},success:function(){window.location.reload()}})},n.prototype.removeSummaryState=function(){var n=confirm("Are you absolutely sure that you want to remove summary state ?");n&&$.ajax({url:this.url+"setResultSummaryState?"+u(this.accessKey),type:"PUT",data:{Id:this.surveyId,Json:null},success:function(){window.location.reload()}})},n.prototype.normalizeWrongDisplayNameLetterCase=function(n){var t,i;if(!!n)for(t=0;t<n.elements.length;t++)i=n.elements[t].displayname,i&&!n.elements[t].displayName&&(n.elements[t].displayName=i);return n},n.prototype.render=function(n,t,i,r){var u=this;r&&this.ensureIPAddressQuestionExists();this.renderTabulator(n,this.normalizeWrongDisplayNameLetterCase(i));this.renderVizPanel(n,this.normalizeWrongDisplayNameLetterCase(t));this.totalResponses(n.length);setTimeout(function(){var t=new Date(864e13),i=new Date(-864e13);n.forEach(function(n){if(n.HappendAt){var r=new Date(n.HappendAt);t>r&&(t=r);i<r&&(i=r)}});u.firstResponseAt(t.toLocaleString());u.lastResponseAt(i.toLocaleString())},100)},n.prototype.renderVizPanel=function(n,t){var i=this,r=this,u={};r.isTrustedAccess&&(u.allowMakeQuestionsPrivate=!0);window.SurveyAnalytics.VisualizationManager.unregisterVisualizerForAll(window.SurveyAnalytics.WordCloud);r.surveyAnalyticsVisPanel=new window.SurveyAnalytics.VisualizationPanel(r.survey.getAllQuestions().slice(0,15),n,u,undefined);r.surveyAnalyticsVisPanel.onPermissionsChangedCallback=function(n){if(!i.preventSendingAJAX){var t=n.permissions;i.savePermissions(i.surveyId,t,i.isLoading);i.preventSendingAJAX=!0;i.surveyAnalyticsTabulator.permissions=t;i.surveyAnalyticsTabulator.refresh(!0);i.preventSendingAJAX=!1}};r.surveyAnalyticsVisPanel.showHeader=!0;r.surveyAnalyticsVisPanel.render(document.getElementById("summaryContent"));r.surveyAnalyticsVisPanel.onStateChanged.add(function(n,t){i.saveSummaryState(i.surveyId,t,i.isLoading)});r.surveyAnalyticsVisPanel.state=t},n.prototype.renderTabulator=function(n,t){var i=this,r=this;window.SurveyAnalyticsTabulator.TableExtensions.registerExtension({location:"details",name:"showinsurvey",visibleIndex:0,render:function(n,t){return window.SurveyAnalyticsTabulator.DocumentHelper.createElement("button","rounded-button",{innerHTML:"Show in Survey",onclick:function(n){n.stopPropagation();r.showSurveyResult(t.row.getDataPosition())}})}});r.isTrustedAccess&&(window.SurveyAnalyticsTabulator.TableExtensions.registerExtension({location:"details",name:"delete",visibleIndex:1,render:function(n,t){return window.SurveyAnalyticsTabulator.DocumentHelper.createElement("button","rounded-button rounded-button--danger",{innerHTML:"Delete Result",onclick:function(n){n.stopPropagation();var i=confirm("Are you sure you want to delete the result ?");i&&r.deleteSurveyResult(t.row)}})}}),window.SurveyAnalyticsTabulator.TableExtensions.findExtension("column","makepublic").visibleIndex=2);r.surveyAnalyticsTabulator=new window.SurveyAnalyticsTabulator.Tabulator(r.survey,n,{},[]);r.surveyAnalyticsTabulator.onPermissionsChangedCallback=function(n){if(!i.preventSendingAJAX){var t=n.permissions;i.savePermissions(i.surveyId,t,i.isLoading);i.preventSendingAJAX=!0;i.surveyAnalyticsVisPanel.permissions=t;i.preventSendingAJAX=!1}};r.surveyAnalyticsTabulator.render(document.getElementById("dataTablesContainer").children[0]);r.surveyAnalyticsTabulator.onStateChanged.add(function(n,t){i.saveTableState(i.surveyId,t,i.isLoading)});r.surveyAnalyticsTabulator.state=t;r.surveyAnalyticsTabulator.refresh(!0)},n.prototype.showTable=function(n){var t="table";n.activeTab(t);this.surveyAnalyticsTabulator.layout(!0);window.location.hash="#"+t},n.prototype.showSummary=function(n){var t="summary";n.activeTab(t);this.surveyAnalyticsVisPanel.layout();window.location.hash="#"+t},n.prototype.showInfo=function(n){var t="info";n.activeTab(t);window.location.hash="#"+t},n}(),it=function(){function n(n,t,i,u){var f=this;this.url=t;this.surveyId=i;this.accessKey=u;this.editingName=r.observable();this.prevName=r.observable();this.isEditing=r.observable(!1);this.startEdit=function(n,t){t.stopPropagation();f.editingName(f.prevName());f.isEditing(!0);var i=$;i(t.target).find("input").focus()};this.postEdit=function(n,t){if(t.stopPropagation(),!f.editingName()){f.cancelEdit(n,t);return}t.stopPropagation();f.isEditing(!1);var i=new XMLHttpRequest;i.onreadystatechange=function(){i.readyState==4&&(i.status==200?f.prevName(f.editingName()):(f.editingName(f.prevName()),alert(i.statusText)))};i.open("PUT",f.url+"changeName/"+f.surveyId+"?accessKey="+f.accessKey+"&name="+f.editingName(),!0);i.send()};this.cancelEdit=function(n,t){t.stopPropagation();f.isEditing(!1);f.editingName(f.prevName())};this.nameEditorKeypress=function(n,t){t.stopPropagation();t.keyCode===13?f.postEdit(n,t):t.keyCode===27&&f.cancelEdit(n,t)};this.editingName(n);this.prevName(n)}return n}();f=i(4);h=function(){function n(n){var t=this;this.elementRect=r.observable(undefined);this.currentStep=r.observable(0);this.goTo=function(n){t.currentStep(t.tour.steps.indexOf(n))};this.visible=r.observable(!0);this.tourDescription=n;this.currentStep.subscribe(function(){return t.updatePosition()});this.updatePosition()}return n.prototype.updatePosition=function(){var i=this.step.selector,n=document.querySelectorAll(i)[0],t;n||!this.tourDescription.rollbackSelector||(n=document.querySelectorAll(this.tourDescription.rollbackSelector)[0]);!n||(t=n.getBoundingClientRect(),this.elementRect(t))},n.prototype.isStepAvailable=function(n){var t=this.tour.steps[n],i,r;return t?(i=t.selector,r=document.querySelectorAll(i)[0],!!r):!1},n.prototype.getNextAvailableStep=function(n){for(var t=n+1;t<this.tour.steps.length&&!this.isStepAvailable(t);)t++;return t==this.tour.steps.length?n:t},Object.defineProperty(n.prototype,"tour",{get:function(){return r.unwrap(this.tourDescription)},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"step",{get:function(){return this.tour.steps[this.currentStep()]},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"currentLocation",{get:function(){var n=this.step.selector,t=document.querySelectorAll(n)[0];return!t&&!!this.tour.rollbackLocation?this.tour.rollbackLocation:this.step.location},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"showBackButton",{get:function(){return this.isStartPage||this.currentStep()>1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"showNextButton",{get:function(){return this.currentStep()<this.tour.steps.length},enumerable:!1,configurable:!0}),n.prototype.goBack=function(n){this.isStartPage&&n.currentStep()==0?this.hide(this):n.currentStep()>0&&n.currentStep(n.currentStep()-1)},n.prototype.goNext=function(n){n.currentStep()<n.tour.steps.length-1?n.currentStep(n.getNextAvailableStep(n.currentStep())):this.currentStep()==this.tour.steps.length-1&&this.hide(this)},Object.defineProperty(n.prototype,"backTitle",{get:function(){return this.isStartPage?"Later":"Back"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"nextTitle",{get:function(){return this.isStartPage?"Start Tour":this.currentStep()==this.tour.steps.length-1?"Got It":"Next"},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isStartPage",{get:function(){return this.tourDescription.hasStartPage&&this.currentStep()==0},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isTop",{get:function(){return!this.isStartPage&&this.currentLocation.indexOf("top")!==-1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isBottom",{get:function(){return!this.isStartPage&&this.currentLocation.indexOf("bottom")!==-1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isLeft",{get:function(){return this.currentLocation.indexOf("left")!==-1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isRight",{get:function(){return this.currentLocation.indexOf("right")!==-1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isSide",{get:function(){return this.currentLocation.indexOf("side")!==-1},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"top",{get:function(){if(this.isStartPage)return"50%";var n=this.elementRect();if(!!n){if(this.isBottom)return n.top+n.height+"px";if(this.isSide)return n.top+"px"}return undefined},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"left",{get:function(){var n,t;return this.isStartPage?"50%":(n=this.elementRect(),!!n&&this.isRight)?(t=this.isSide?0:n.width,n.right-t+"px"):undefined},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"right",{get:function(){var n=this.elementRect(),t;return!!n&&this.isLeft?(t=this.isSide?0:n.width,"calc(100% - "+(n.left+t)+"px)"):undefined},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"bottom",{get:function(){var n=this.elementRect();return!!n&&this.isTop?"calc(100% - "+(n.bottom-n.height)+"px)":undefined},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"style",{get:function(){return{top:this.top,left:this.left,right:this.right,bottom:this.bottom}},enumerable:!1,configurable:!0}),n.prototype.hide=function(n){n.visible(!1)},n.prototype.hideForever=function(n){localStorage.setItem("isTourRejected","true");n.hide(n)},n}();!window.ko||r.components.register("tour-component",{viewModel:{createViewModel:function(n){return new h(n.tour)}},template:{element:"tour-component"}});y={hasStartPage:!0,rollbackSelector:".svc-tabbed-menu-item-container:nth-child(1)",rollbackLocation:"bottomright",steps:[{selector:".svc-tabbed-menu-item-container:nth-child(1)",location:"center",title:"Welcome to the free demo Form Builder tool.",description:'<p class="">This is what you will see once you have added the Survey Creator library to your application.\n                                                                        The tool has been developed for <b>demonstration purposes<\/b> to let you explore and evaluate the\n                                                                        capabilities of the Survey Creator and estimate its potential value in your projects.<\/p>\n                                                                        <p class="v2-class---info-panel">Make sure to purchase a developer license if you plan to use the Survey Creator component\n                                                                        for commercial purposes. If you need the form builder tool only to generate a survey JSON\n                                                                        definition for your in-app survey, we offer such functionality free of charge.<\/p>\n                                                                        <p class="v2-class---accent">Now let us walk you through making a simple NPS survey!<\/p>'},{selector:".svc-tabbed-menu-item-container:nth-child(1)",location:"sideright",title:"Designer Tab",description:"<p>The Designer tab allows you to configure your survey.<\/p>\n                                                                        <p>Click the <b>Rating Scale<\/b> question from the Toolbox on\n                                                                        the left, or drag and drop it onto the design surface in\n                                                                        the center. Done? Click 'Next'.<\/p>"},{selector:".sd-question__header .svc-string-editor",location:"topright",title:"On-page Editing",description:"<p>You can configure many survey element settings right on\n                                                                        the design surface.<\/p>\n                                                                        <p>Click the question title to change it and enter or copy/paste the following text: '<b id=\"copy-text-1\">How likely are you to\n                                                                        recommend our company to a friend or colleague?<\/b>' <span style=\"cursor: pointer;\" onclick='copyToClipboard(\"copy-text-1\")'><u>Copy the text to clipboard<\/u><\/span>,\n                                                                        enter it into inplace editor and then click 'Next'.<\/p>"},{selector:".spg-panel .sd-panel__header",location:"sideleft",title:"Property Grid",description:'<p>The Property Grid lets you modify the selected question,\n                                                                        panel, and page settings. To view the Property Grid for\n                                                                        the entire survey, use the <svg class="sv-svg-icon sv-action-bar-item__icon" role="img" aria-label="Survey Settings" style="width: 24px; height: 24px; vertical-align: text-bottom;"><use xlink:href="#icon-settings"><\/use><title>Survey Settings<\/title><\/svg> button.<\/p>\n                                                                        <p>Now, make sure your NPS question is selected, go to\n                                                                        Rate values and increase the current Maximum rate\n                                                                        value up to 10.<\/p>'},{selector:".svc-tabbed-menu-item-container:nth-child(3)",location:"bottomright",title:"Theme Editor",description:"The Theme Editor tab gives you the power to effortlessly build and customize survey UI themes.\n                                                                        As you tweak colors, adjust fonts, or experiment with layouts, every change is instantly visible.\n                                                                        <br/>\n                                                                        Click the Theme dropdown menu and choose one of the predefined themes to kickstart.\n                                                                        Then, set the display mode for your form to Light or Dark. Click 'Next' when ready"},{selector:".svc-tabbed-menu-item-container:nth-child(2)",location:"bottomright",title:"Preview",description:"Now that your survey is configured, visit the\n                                                                        Preview tab to evaluate the design in effect. Score\n                                                                        the question with any answer choice available and\n                                                                        click 'Complete' to see the survey results in the\n                                                                        table or JSON format."},{selector:".svc-tabbed-menu-item-container:nth-child(4)",location:"bottomright",title:"Logic",description:"<p>Use the Logic tab to define the flow of your survey. You\n                                                                        can apply or modify the existing conditional logic and\n                                                                        branching for the entire survey to ensure your\n                                                                        respondents always get the most relevant questions.<\/p>\n                                                                        <p>We are going to skip this tab for now.<\/p>"},{selector:".svc-tabbed-menu-item-container:nth-child(5)",location:"bottomright",title:"JSON Schema",description:"<p>The JSON Schema tab contains an auto-generated\n                                                                        survey definition in JSON format and lets you preview,\n                                                                        edit, or copy the resulting survey configuration and run\n                                                                        it in your app with the SurveyJS Form Library.<\/p>"}]}}])})