function CertonaProductFinder(e){"use strict";function t(e,t){var n=document.createElement(e);for(var s in t)if(t.hasOwnProperty(s))switch(s){case"html":n.innerHTML=t[s];break;case"text":n.innerText=t[s];break;default:n.setAttribute(s,t[s])}return n}function n(e,t,n){for(var s=0;s'}),h=t("span",{class:"ddl-arrow",html:''}),p=t("div",{class:"ddl-options"});if(e.parentNode.insertBefore(o,e.nextSibling),o.appendChild(h),i){l.appendChild(c),l.appendChild(u),o.appendChild(l);var g=parseFloat(o.style.width)-parseFloat(o.style.paddingLeft)-parseFloat(o.style.paddingRight),m=parseInt(o.style.paddingLeft)+parseInt(o.style.paddingRight),v=h.getBoundingClientRect().width;l.style.width=g-v-m+"px"}else o.appendChild(a);p.style.top=parseFloat(o.style.height)+parseFloat(o.style.paddingBottom)+parseFloat(o.style.borderBottom)+"px";var y=!1;o.addEventListener("click",function(){y||(y=!0,setTimeout(function(){var e=function(){document.removeEventListener("click",e),y=!1,p.style.display="none"};document.addEventListener("click",e)},1)),p.style.display="block"},!1),u.addEventListener("click",function(t){r=0,c.style.visibility="hidden",u.style.visibility="hidden",e.value="";for(var n=0;n-1){x=!0;break}x||(w.selected=!0)}for(var I=0;I0?(c.innerText="("+r+")",c.style.visibility="visible",u.style.visibility="visible"):e.value=[]),o.appendChild(e),e.style.display="none",e.tabIndex=-1;var N=t("select",{class:"certona-pf-input-hidden"});N.tabIndex=0,o.insertBefore(N,e);var _=null;N.addEventListener("focus",function(){o.classList.add("focused")}),N.addEventListener("blur",function(){o.classList.remove("focused")}),N.addEventListener("keydown",function(t){var n=!1;if(t.keyCode)switch(t.keyCode){case 13:case 32:if(n=!0,"block"!==p.style.display)p.style.display="block",null===_&&(_=p.children[0],_.classList.add("hover"));else{if(d(_,"selected")===!0)_.classList.remove("hover"),_.classList.remove("selected"),f(_,"selected",!1),d(_,"option").selected=!1,i?(r--,0===r?(c.style.visibility="hidden",u.style.visibility="hidden",w.selected=!0):c.innerText="("+r+")"):(a.innerText="",e.value="");else if(_.classList.remove("hover"),_.classList.add("selected"),f(_,"selected",!0),d(_,"option").selected=!0,i)r++,c.innerText="("+r+")",1===r&&(c.style.visibility="visible",u.style.visibility="visible",w.selected=!1);else{for(var o=0;o0)e.answers.forEach(function(e){t.answers[e.answerId.toString()]=e,u||null===e.navigationFilter||void 0===e.navigationFilter||""===e.navigationFilter||(u=!0)});else if(e.children&&e.children.length>0){var s=new i,o=1;e.children.forEach(function(e){s[e.questionId.toString()]=new r(e,o),o++}),t.children=s}return t}function o(e){for(var t,n=[],s=e&&e.options,i=0,r=s.length;i":">",'"':""","'":"'","`":"`"},c=/[&<>"'`]/g,u=/[&<>"'`]/;o.extend=n;var h=Object.prototype.toString;o.toString=h;var p=function(e){return"function"==typeof e};p(/x/)&&(p=function(e){return"function"==typeof e&&"[object Function]"===h.call(e)});var p;o.isFunction=p;var d=Array.isArray||function(e){return!(!e||"object"!=typeof e)&&"[object Array]"===h.call(e)};return o.isArray=d,o.escapeExpression=s,o.isEmpty=i,o.appendContextPath=r,o}(e),n=function(){function e(e,n){var s;n&&n.firstLine&&(s=n.firstLine,e+=" - "+s+":"+n.firstColumn);for(var i=Error.prototype.constructor.call(this,e),r=0;r0?(n.ids&&(n.ids=[n.name]),e.helpers.each(t,n)):s(this);if(n.data&&n.ids){var o=m(n.data);o.contextPath=r.appendContextPath(n.data.contextPath,n.name),n={data:o}}return i(t,n)}),e.registerHelper("each",function(e,t){if(!t)throw new o("Must pass iterator to #each");var n,s,i=t.fn,a=t.inverse,l=0,c="";if(t.data&&t.ids&&(s=r.appendContextPath(t.data.contextPath,t.ids[0])+"."),h(e)&&(e=e.call(this)),t.data&&(n=m(t.data)),e&&"object"==typeof e)if(u(e))for(var p=e.length;l= 2.0.0-beta.1"};i.REVISION_CHANGES=c;var u=r.isArray,h=r.isFunction,p=r.toString,d="[object Object]";i.HandlebarsEnvironment=n,n.prototype={constructor:n,logger:f,log:g,registerHelper:function(e,t){if(p.call(e)===d){if(t)throw new o("Arg not supported with multiple helpers");r.extend(this.helpers,e)}else this.helpers[e]=t},unregisterHelper:function(e){delete this.helpers[e]},registerPartial:function(e,t){p.call(e)===d?r.extend(this.partials,e):this.partials[e]=t},unregisterPartial:function(e){delete this.partials[e]}};var f={methodMap:{0:"debug",1:"info",2:"warn",3:"error"},DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,log:function(e,t){if(f.level<=e){var n=f.methodMap[e];"undefined"!=typeof console&&console[n]&&console[n].call(console,t)}}};i.logger=f;var g=f.log;i.log=g;var m=function(e){var t=r.extend({},e);return t._parent=e,t};return i.createFrame=m,i}(t,n),i=function(e,t,n){function s(e){var t=e&&e[0]||1,n=p;if(t!==n){if(t0)throw new s("Invalid path: "+i,this);".."===u?(o++,a+="../"):this.isScoped=!0}else r.push(u)}this.original=i,this.parts=r,this.string=r.join("."),this.depth=o,this.idName=a+this.string,this.isSimple=1===e.length&&!this.isScoped&&0===o,this.stringModeValue=this.string},PartialNameNode:function(e,n){t.call(this,n),this.type="PARTIAL_NAME",this.name=e.original},DataNode:function(e,n){t.call(this,n),this.type="DATA",this.id=e,this.stringModeValue=e.stringModeValue,this.idName="@"+e.stringModeValue},StringNode:function(e,n){t.call(this,n),this.type="STRING",this.original=this.string=this.stringModeValue=e},NumberNode:function(e,n){t.call(this,n),this.type="NUMBER",this.original=this.number=e,this.stringModeValue=Number(e)},BooleanNode:function(e,n){t.call(this,n),this.type="BOOLEAN",this.bool=e,this.stringModeValue="true"===e},CommentNode:function(e,n){t.call(this,n),this.type="comment",this.comment=e,this.strip={inlineStandalone:!0}}};return n=i}(n),a=function(){var e,t=function(){function e(){this.yy={}}var t={trace:function(){},yy:{},symbols_:{error:2,root:3,program:4,EOF:5,program_repetition0:6,statement:7,mustache:8,block:9,rawBlock:10,partial:11,CONTENT:12,COMMENT:13,openRawBlock:14,END_RAW_BLOCK:15,OPEN_RAW_BLOCK:16,sexpr:17,CLOSE_RAW_BLOCK:18,openBlock:19,block_option0:20,closeBlock:21,openInverse:22,block_option1:23,OPEN_BLOCK:24,CLOSE:25,OPEN_INVERSE:26,inverseAndProgram:27,INVERSE:28,OPEN_ENDBLOCK:29,path:30,OPEN:31,OPEN_UNESCAPED:32,CLOSE_UNESCAPED:33,OPEN_PARTIAL:34,partialName:35,param:36,partial_option0:37,partial_option1:38,sexpr_repetition0:39,sexpr_option0:40,dataName:41,STRING:42,NUMBER:43,BOOLEAN:44,OPEN_SEXPR:45,CLOSE_SEXPR:46,hash:47,hash_repetition_plus0:48,hashSegment:49,ID:50,EQUALS:51,DATA:52,pathSegments:53,SEP:54,$accept:0,$end:1},terminals_:{2:"error",5:"EOF",12:"CONTENT",13:"COMMENT",15:"END_RAW_BLOCK",16:"OPEN_RAW_BLOCK",18:"CLOSE_RAW_BLOCK",24:"OPEN_BLOCK",25:"CLOSE",26:"OPEN_INVERSE",28:"INVERSE",29:"OPEN_ENDBLOCK",31:"OPEN",32:"OPEN_UNESCAPED",33:"CLOSE_UNESCAPED",34:"OPEN_PARTIAL",42:"STRING",43:"NUMBER",44:"BOOLEAN",45:"OPEN_SEXPR",46:"CLOSE_SEXPR",50:"ID",51:"EQUALS",52:"DATA",54:"SEP"},productions_:[0,[3,2],[4,1],[7,1],[7,1],[7,1],[7,1],[7,1],[7,1],[10,3],[14,3],[9,4],[9,4],[19,3],[22,3],[27,2],[21,3],[8,3],[8,3],[11,5],[11,4],[17,3],[17,1],[36,1],[36,1],[36,1],[36,1],[36,1],[36,3],[47,1],[49,3],[35,1],[35,1],[35,1],[41,2],[30,1],[53,3],[53,1],[6,0],[6,2],[20,0],[20,1],[23,0],[23,1],[37,0],[37,1],[38,0],[38,1],[39,0],[39,2],[40,0],[40,1],[48,1],[48,2]],performAction:function(e,t,n,s,i,r,o){var a=r.length-1;switch(i){case 1:return s.prepareProgram(r[a-1].statements,!0),r[a-1];case 2:this.$=new s.ProgramNode(s.prepareProgram(r[a]),{},this._$);break;case 3:this.$=r[a];break;case 4:this.$=r[a];break;case 5:this.$=r[a];break;case 6:this.$=r[a];break;case 7:this.$=new s.ContentNode(r[a],this._$);break;case 8:this.$=new s.CommentNode(r[a],this._$);break;case 9:this.$=new s.RawBlockNode(r[a-2],r[a-1],r[a],this._$);break;case 10:this.$=new s.MustacheNode(r[a-1],null,"","",this._$);break;case 11:this.$=s.prepareBlock(r[a-3],r[a-2],r[a-1],r[a],!1,this._$);break;case 12:this.$=s.prepareBlock(r[a-3],r[a-2],r[a-1],r[a],!0,this._$);break;case 13:this.$=new s.MustacheNode(r[a-1],null,r[a-2],s.stripFlags(r[a-2],r[a]),this._$);break;case 14:this.$=new s.MustacheNode(r[a-1],null,r[a-2],s.stripFlags(r[a-2],r[a]),this._$);break;case 15:this.$={strip:s.stripFlags(r[a-1],r[a-1]),program:r[a]};break;case 16:this.$={path:r[a-1],strip:s.stripFlags(r[a-2],r[a])};break;case 17:this.$=new s.MustacheNode(r[a-1],null,r[a-2],s.stripFlags(r[a-2],r[a]),this._$);break;case 18:this.$=new s.MustacheNode(r[a-1],null,r[a-2],s.stripFlags(r[a-2],r[a]),this._$);break;case 19:this.$=new s.PartialNode(r[a-3],r[a-2],r[a-1],s.stripFlags(r[a-4],r[a]),this._$);break;case 20:this.$=new s.PartialNode(r[a-2],void 0,r[a-1],s.stripFlags(r[a-3],r[a]),this._$);break;case 21:this.$=new s.SexprNode([r[a-2]].concat(r[a-1]),r[a],this._$);break;case 22:this.$=new s.SexprNode([r[a]],null,this._$);break;case 23:this.$=r[a];break;case 24:this.$=new s.StringNode(r[a],this._$);break;case 25:this.$=new s.NumberNode(r[a],this._$);break;case 26:this.$=new s.BooleanNode(r[a],this._$);break;case 27:this.$=r[a];break;case 28:r[a-1].isHelper=!0,this.$=r[a-1];break;case 29:this.$=new s.HashNode(r[a],this._$);break;case 30:this.$=[r[a-2],r[a]];break;case 31:this.$=new s.PartialNameNode(r[a],this._$);break;case 32:this.$=new s.PartialNameNode(new s.StringNode(r[a],this._$),this._$);break;case 33:this.$=new s.PartialNameNode(new s.NumberNode(r[a],this._$));break;case 34:this.$=new s.DataNode(r[a],this._$);break;case 35:this.$=new s.IdNode(r[a],this._$);break;case 36:r[a-2].push({part:r[a],separator:r[a-1]}),this.$=r[a-2];break;case 37:this.$=[{part:r[a]}];break;case 38:this.$=[];break;case 39:r[a-1].push(r[a]);break;case 48:this.$=[];break;case 49:r[a-1].push(r[a]);break;case 52:this.$=[r[a]];break;case 53:r[a-1].push(r[a])}},table:[{3:1,4:2,5:[2,38],6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],31:[2,38],32:[2,38],34:[2,38]},{1:[3]},{5:[1,4]},{5:[2,2],7:5,8:6,9:7,10:8,11:9,12:[1,10],13:[1,11],14:16,16:[1,20],19:14,22:15,24:[1,18],26:[1,19],28:[2,2],29:[2,2],31:[1,12],32:[1,13],34:[1,17]},{1:[2,1]},{5:[2,39],12:[2,39],13:[2,39],16:[2,39],24:[2,39],26:[2,39],28:[2,39],29:[2,39],31:[2,39],32:[2,39],34:[2,39]},{5:[2,3],12:[2,3],13:[2,3],16:[2,3],24:[2,3],26:[2,3],28:[2,3],29:[2,3],31:[2,3],32:[2,3],34:[2,3]},{5:[2,4],12:[2,4],13:[2,4],16:[2,4],24:[2,4],26:[2,4],28:[2,4],29:[2,4],31:[2,4],32:[2,4],34:[2,4]},{5:[2,5],12:[2,5],13:[2,5],16:[2,5],24:[2,5],26:[2,5],28:[2,5],29:[2,5],31:[2,5],32:[2,5],34:[2,5]},{5:[2,6],12:[2,6],13:[2,6],16:[2,6],24:[2,6],26:[2,6],28:[2,6],29:[2,6],31:[2,6],32:[2,6],34:[2,6]},{5:[2,7],12:[2,7],13:[2,7],16:[2,7],24:[2,7],26:[2,7],28:[2,7],29:[2,7],31:[2,7],32:[2,7],34:[2,7]},{5:[2,8],12:[2,8],13:[2,8],16:[2,8],24:[2,8],26:[2,8],28:[2,8],29:[2,8],31:[2,8],32:[2,8],34:[2,8]},{17:21,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:27,30:22,41:23,50:[1,26],52:[1,25],53:24},{4:28,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{4:29,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],28:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{12:[1,30]},{30:32,35:31,42:[1,33],43:[1,34],50:[1,26],53:24},{17:35,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:36,30:22,41:23,50:[1,26],52:[1,25],53:24},{17:37,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[1,38]},{18:[2,48],25:[2,48],33:[2,48],39:39,42:[2,48],43:[2,48],44:[2,48],45:[2,48],46:[2,48],50:[2,48],52:[2,48]},{18:[2,22],25:[2,22],33:[2,22],46:[2,22]},{18:[2,35],25:[2,35],33:[2,35],42:[2,35],43:[2,35],44:[2,35],45:[2,35],46:[2,35],50:[2,35],52:[2,35],54:[1,40]},{30:41,50:[1,26],53:24},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],52:[2,37],54:[2,37]},{33:[1,42]},{20:43,27:44,28:[1,45],29:[2,40]},{23:46,27:47,28:[1,45],29:[2,42]},{15:[1,48]},{25:[2,46],30:51,36:49,38:50,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],47:57,48:58,49:60,50:[1,59],52:[1,25],53:24},{25:[2,31],42:[2,31],43:[2,31],44:[2,31],45:[2,31],50:[2,31],52:[2,31]},{25:[2,32],42:[2,32],43:[2,32],44:[2,32],45:[2,32],50:[2,32],52:[2,32]},{25:[2,33],42:[2,33],43:[2,33],44:[2,33],45:[2,33],50:[2,33],52:[2,33]},{25:[1,61]},{25:[1,62]},{18:[1,63]},{5:[2,17],12:[2,17],13:[2,17],16:[2,17],24:[2,17],26:[2,17],28:[2,17],29:[2,17],31:[2,17],32:[2,17],34:[2,17]},{18:[2,50],25:[2,50],30:51,33:[2,50],36:65,40:64,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],46:[2,50],47:66,48:58,49:60,50:[1,59],52:[1,25],53:24},{50:[1,67]},{18:[2,34],25:[2,34],33:[2,34],42:[2,34],43:[2,34],44:[2,34],45:[2,34],46:[2,34],50:[2,34],52:[2,34]},{5:[2,18],12:[2,18],13:[2,18],16:[2,18],24:[2,18],26:[2,18],28:[2,18],29:[2,18],31:[2,18],32:[2,18],34:[2,18]},{21:68,29:[1,69]},{29:[2,41]},{4:70,6:3,12:[2,38],13:[2,38],16:[2,38],24:[2,38],26:[2,38],29:[2,38],31:[2,38],32:[2,38],34:[2,38]},{21:71,29:[1,69]},{29:[2,43]},{5:[2,9],12:[2,9],13:[2,9],16:[2,9],24:[2,9],26:[2,9],28:[2,9],29:[2,9],31:[2,9],32:[2,9],34:[2,9]},{25:[2,44],37:72,47:73,48:58,49:60,50:[1,74]},{25:[1,75]},{18:[2,23],25:[2,23],33:[2,23],42:[2,23],43:[2,23],44:[2,23],45:[2,23],46:[2,23],50:[2,23],52:[2,23]},{18:[2,24],25:[2,24],33:[2,24],42:[2,24],43:[2,24],44:[2,24],45:[2,24],46:[2,24],50:[2,24],52:[2,24]},{18:[2,25],25:[2,25],33:[2,25],42:[2,25],43:[2,25],44:[2,25],45:[2,25],46:[2,25],50:[2,25],52:[2,25]},{18:[2,26],25:[2,26],33:[2,26],42:[2,26],43:[2,26],44:[2,26],45:[2,26],46:[2,26],50:[2,26],52:[2,26]},{18:[2,27],25:[2,27],33:[2,27],42:[2,27],43:[2,27],44:[2,27],45:[2,27],46:[2,27],50:[2,27],52:[2,27]},{17:76,30:22,41:23,50:[1,26],52:[1,25],53:24},{25:[2,47]},{18:[2,29],25:[2,29],33:[2,29],46:[2,29],49:77,50:[1,74]},{18:[2,37],25:[2,37],33:[2,37],42:[2,37],43:[2,37],44:[2,37],45:[2,37],46:[2,37],50:[2,37],51:[1,78],52:[2,37],54:[2,37]},{18:[2,52],25:[2,52],33:[2,52],46:[2,52],50:[2,52]},{12:[2,13],13:[2,13],16:[2,13],24:[2,13],26:[2,13],28:[2,13],29:[2,13],31:[2,13],32:[2,13],34:[2,13]},{12:[2,14],13:[2,14],16:[2,14],24:[2,14],26:[2,14],28:[2,14],29:[2,14],31:[2,14],32:[2,14],34:[2,14]},{12:[2,10]},{18:[2,21],25:[2,21],33:[2,21],46:[2,21]},{18:[2,49],25:[2,49],33:[2,49],42:[2,49],43:[2,49],44:[2,49],45:[2,49],46:[2,49],50:[2,49],52:[2,49]},{18:[2,51],25:[2,51],33:[2,51],46:[2,51]},{18:[2,36],25:[2,36],33:[2,36],42:[2,36],43:[2,36],44:[2,36],45:[2,36],46:[2,36],50:[2,36],52:[2,36],54:[2,36]},{5:[2,11],12:[2,11],13:[2,11],16:[2,11],24:[2,11],26:[2,11],28:[2,11],29:[2,11],31:[2,11],32:[2,11],34:[2,11]},{30:79,50:[1,26],53:24},{29:[2,15]},{5:[2,12],12:[2,12],13:[2,12],16:[2,12],24:[2,12],26:[2,12],28:[2,12],29:[2,12],31:[2,12],32:[2,12],34:[2,12]},{25:[1,80]},{25:[2,45]},{51:[1,78]},{5:[2,20],12:[2,20],13:[2,20],16:[2,20],24:[2,20],26:[2,20],28:[2,20],29:[2,20],31:[2,20],32:[2,20],34:[2,20]},{46:[1,81]},{18:[2,53],25:[2,53],33:[2,53],46:[2,53],50:[2,53]},{30:51,36:82,41:55,42:[1,52],43:[1,53],44:[1,54],45:[1,56],50:[1,26],52:[1,25],53:24},{25:[1,83]},{5:[2,19],12:[2,19],13:[2,19],16:[2,19],24:[2,19],26:[2,19],28:[2,19],29:[2,19],31:[2,19],32:[2,19],34:[2,19]},{18:[2,28],25:[2,28],33:[2,28],42:[2,28],43:[2,28],44:[2,28],45:[2,28],46:[2,28],50:[2,28],52:[2,28]},{18:[2,30],25:[2,30],33:[2,30],46:[2,30],50:[2,30]},{5:[2,16],12:[2,16],13:[2,16],16:[2,16],24:[2,16],26:[2,16],28:[2,16],29:[2,16],31:[2,16],32:[2,16],34:[2,16]}],defaultActions:{4:[2,1],44:[2,41],47:[2,43],57:[2,47],63:[2,10],70:[2,15],73:[2,45]},parseError:function(e,t){throw new Error(e)},parse:function(e){function t(){var e;return e=n.lexer.lex()||1,"number"!=typeof e&&(e=n.symbols_[e]||e),e}var n=this,s=[0],i=[null],r=[],o=this.table,a="",l=0,c=0,u=0;this.lexer.setInput(e),this.lexer.yy=this.yy,this.yy.lexer=this.lexer,this.yy.parser=this,"undefined"==typeof this.lexer.yylloc&&(this.lexer.yylloc={});var h=this.lexer.yylloc;r.push(h);var p=this.lexer.options&&this.lexer.options.ranges;"function"==typeof this.yy.parseError&&(this.parseError=this.yy.parseError);for(var d,f,g,m,v,y,w,x,S,I={};;){if(g=s[s.length-1],this.defaultActions[g]?m=this.defaultActions[g]:(null!==d&&"undefined"!=typeof d||(d=t()),m=o[g]&&o[g][d]),"undefined"==typeof m||!m.length||!m[0]){var b="";if(!u){S=[];for(y in o[g])this.terminals_[y]&&y>2&&S.push("'"+this.terminals_[y]+"'");b=this.lexer.showPosition?"Parse error on line "+(l+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+S.join(", ")+", got '"+(this.terminals_[d]||d)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==d?"end of input":"'"+(this.terminals_[d]||d)+"'"),this.parseError(b,{text:this.lexer.match,token:this.terminals_[d]||d,line:this.lexer.yylineno,loc:h,expected:S})}}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+g+", token: "+d);switch(m[0]){case 1:s.push(d),i.push(this.lexer.yytext),r.push(this.lexer.yylloc),s.push(m[1]),d=null,f?(d=f,f=null):(c=this.lexer.yyleng,a=this.lexer.yytext,l=this.lexer.yylineno,h=this.lexer.yylloc,u>0&&u--);break;case 2:if(w=this.productions_[m[1]][1],I.$=i[i.length-w],I._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},p&&(I._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),v=this.performAction.call(I,a,c,l,this.yy,m[1],i,r),"undefined"!=typeof v)return v;w&&(s=s.slice(0,-1*w*2),i=i.slice(0,-1*w),r=r.slice(0,-1*w)),s.push(this.productions_[m[1]][0]),i.push(I.$),r.push(I._$),x=o[s[s.length-2]][s[s.length-1]],s.push(x);break;case 3:return!0}}return!0}},n=function(){var e={EOF:1,parseError:function(e,t){if(!this.yy.parser)throw new Error(e);this.yy.parser.parseError(e,t)},setInput:function(e){return this._input=e,this._more=this._less=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var e=this._input[0];this.yytext+=e,this.yyleng++,this.offset++,this.match+=e,this.matched+=e;var t=e.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),e},unput:function(e){var t=e.length,n=e.split(/(?:\r\n?|\n)/g);this._input=e+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t-1),this.offset-=t;var s=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:n?(n.length===s.length?this.yylloc.first_column:0)+s[s.length-n.length].length-n[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-t]),this},more:function(){return this._more=!0,this},less:function(e){this.unput(this.match.slice(e))},pastInput:function(){var e=this.matched.substr(0,this.matched.length-this.match.length);return(e.length>20?"...":"")+e.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var e=this.match;return e.length<20&&(e+=this._input.substr(0,20-e.length)),(e.substr(0,20)+(e.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var e=this.pastInput(),t=new Array(e.length+1).join("-");return e+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var e,t,n,s,i;this._more||(this.yytext="",this.match="");for(var r=this._currentRules(),o=0;ot[0].length)||(t=n,s=o,this.options.flex));o++);return t?(i=t[0].match(/(?:\r\n?|\n).*/g),i&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],e=this.performAction.call(this,this.yy,this,r[s],this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e?e:void 0):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var e=this.next();return"undefined"!=typeof e?e:this.lex()},begin:function(e){this.conditionStack.push(e)},popState:function(){return this.conditionStack.pop()},_currentRules:function(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function(e){this.begin(e)}};return e.options={},e.performAction=function(e,t,n,s){function i(e,n){return t.yytext=t.yytext.substr(e,t.yyleng-n)}switch(n){case 0:if("\\\\"===t.yytext.slice(-2)?(i(0,1),this.begin("mu")):"\\"===t.yytext.slice(-1)?(i(0,1),this.begin("emu")):this.begin("mu"),t.yytext)return 12;break;case 1:return 12;case 2:return this.popState(),12;case 3:return t.yytext=t.yytext.substr(5,t.yyleng-9),this.popState(),15;case 4:return 12;case 5:return i(0,4),this.popState(),13;case 6:return 45;case 7:return 46;case 8:return 16;case 9:return this.popState(),this.begin("raw"),18;case 10:return 34;case 11:return 24;case 12:return 29;case 13:return this.popState(),28;case 14:return this.popState(), 28;case 15:return 26;case 16:return 26;case 17:return 32;case 18:return 31;case 19:this.popState(),this.begin("com");break;case 20:return i(3,5),this.popState(),13;case 21:return 31;case 22:return 51;case 23:return 50;case 24:return 50;case 25:return 54;case 26:break;case 27:return this.popState(),33;case 28:return this.popState(),25;case 29:return t.yytext=i(1,2).replace(/\\"/g,'"'),42;case 30:return t.yytext=i(1,2).replace(/\\'/g,"'"),42;case 31:return 52;case 32:return 44;case 33:return 44;case 34:return 43;case 35:return 50;case 36:return t.yytext=i(1,2),50;case 37:return"INVALID";case 38:return 5}},e.rules=[/^(?:[^\x00]*?(?=(\{\{)))/,/^(?:[^\x00]+)/,/^(?:[^\x00]{2,}?(?=(\{\{|\\\{\{|\\\\\{\{|$)))/,/^(?:\{\{\{\{\/[^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=[=}\s\/.])\}\}\}\})/,/^(?:[^\x00]*?(?=(\{\{\{\{\/)))/,/^(?:[\s\S]*?--\}\})/,/^(?:\()/,/^(?:\))/,/^(?:\{\{\{\{)/,/^(?:\}\}\}\})/,/^(?:\{\{(~)?>)/,/^(?:\{\{(~)?#)/,/^(?:\{\{(~)?\/)/,/^(?:\{\{(~)?\^\s*(~)?\}\})/,/^(?:\{\{(~)?\s*else\s*(~)?\}\})/,/^(?:\{\{(~)?\^)/,/^(?:\{\{(~)?\s*else\b)/,/^(?:\{\{(~)?\{)/,/^(?:\{\{(~)?&)/,/^(?:\{\{!--)/,/^(?:\{\{![\s\S]*?\}\})/,/^(?:\{\{(~)?)/,/^(?:=)/,/^(?:\.\.)/,/^(?:\.(?=([=~}\s\/.)])))/,/^(?:[\/.])/,/^(?:\s+)/,/^(?:\}(~)?\}\})/,/^(?:(~)?\}\})/,/^(?:"(\\["]|[^"])*")/,/^(?:'(\\[']|[^'])*')/,/^(?:@)/,/^(?:true(?=([~}\s)])))/,/^(?:false(?=([~}\s)])))/,/^(?:-?[0-9]+(?:\.[0-9]+)?(?=([~}\s)])))/,/^(?:([^\s!"#%-,\.\/;->@\[-\^`\{-~]+(?=([=~}\s\/.)]))))/,/^(?:\[[^\]]*\])/,/^(?:.)/,/^(?:$)/],e.conditions={mu:{rules:[6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38],inclusive:!1},emu:{rules:[2],inclusive:!1},com:{rules:[5],inclusive:!1},raw:{rules:[3,4],inclusive:!1},INITIAL:{rules:[0,1,38],inclusive:!0}},e}();return t.lexer=n,e.prototype=t,t.Parser=e,new e}();return e=t}(),l=function(e){function t(e,t){return{left:"~"===e.charAt(2),right:"~"===t.charAt(t.length-3)}}function n(e,t,n,s,l,u){if(e.sexpr.id.original!==s.path.original)throw new c(e.sexpr.id.original+" doesn't match "+s.path.original,e);var h=n&&n.program,p={left:e.strip.left,right:s.strip.right,openStandalone:r(t.statements),closeStandalone:i((h||t).statements)};if(e.strip.right&&o(t.statements,null,!0),h){var d=n.strip;d.left&&a(t.statements,null,!0),d.right&&o(h.statements,null,!0),s.strip.left&&a(h.statements,null,!0),i(t.statements)&&r(h.statements)&&(a(t.statements),o(h.statements))}else s.strip.left&&a(t.statements,null,!0);return l?new this.BlockNode(e,h,t,p,u):new this.BlockNode(e,t,h,p,u)}function s(e,t){for(var n=0,s=e.length;n0&&(t+=", "+n.join(", "));for(var s in this.aliases)this.aliases.hasOwnProperty(s)&&(t+=", "+s+"="+this.aliases[s]);var i=["depth0","helpers","partials","data"];this.useDepths&&i.push("depths");var r=this.mergeSource(t);return e?(i.push(r),Function.apply(this,i)):"function("+i.join(",")+") {\n "+r+"}"},mergeSource:function(e){for(var t,n,s="",i=!this.forceBuffer,r=0,o=this.source.length;rthis.stackVars.length&&this.stackVars.push("stack"+this.stackSlot),this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var e=this.inlineStack;if(e.length){this.inlineStack=[];for(var t=0,s=e.length;t0&&(t=document.cookie,n=t.indexOf(e+"="),n!==-1))return n+=e.length+1,s=t.indexOf(";",n),s===-1&&(s=t.length),decodeURIComponent(t.slice(n,s))}catch(e){console.log(e)}return null},c=!1,u=!1,h={},p={},d=function(e,t){if(e.getAttribute("cpfId")){var n=h[e.getAttribute("cpfId")];if(n.hasOwnProperty(t))return n[t]}else;},f=function(e,t,n){var s;if(e.getAttribute("cpfId"))s=e.getAttribute("cpfId");else{for(s=Math.floor(2147483647*Math.random())+1;h.hasOwnProperty(s.toString());)s=Math.floor(2147483647*Math.random())+1;e.setAttribute("cpfId",s),h[s]={}}h[s][t]=n},g=function(e,t){if(window.getComputedStyle){var n=getComputedStyle(e,null);return n[t]}return e.currentStyle[t]},m=function(e){return g(e,"width")},v={rootUrl:"https://api.certona.com",resxHost:"res-x.com",surveyEventPrefix:"productfinder",surveyId:"",applicationId:"",surveyName:"",firstQuestion:null,insertionElementId:"output",resxTrackingId:null,resxSessionId:null,token:"",autoStart:!0,previewMode:!1,finishFunction:void 0,progressBar:{show:!1,insertionElementId:"progressBarOutput",animationDuration:1e3,template:"progress-bar",outerId:"product-finder-progress-outer",innerId:"product-finder-progress-inner"},resultsAsYouGo:{enabled:!1,scheme:null,num:20,rrcall:null},symbols:{answerBreadcrumbs:{separator:null,unanswered:null,questionGroupSeparator:"
------------
",multiSelectSeparator:", "}}},y={render:function(){},surveyLoaded:function(){}};e.hasOwnProperty("render")&&"function"==typeof e.render&&(y.render=e.render),e.hasOwnProperty("surveyLoaded")&&"function"==typeof e.surveyLoaded&&(y.surveyLoaded=e.surveyLoaded);var w,x={getSurveyUrl:"{{rootUrl}}/Resonance/Application/{{appId}}/ProductFinder/Survey/{{surveyId}}/User/{{trackingId}}?callback=processCPFAPIResponse&_=",answerQuestionUrl:"{{rootUrl}}/Resonance/Application/{{appId}}/ProductFinder/Answer/{{token}}",getDynamicAnswerUrl:"{{rootUrl}}/Resonance/Application/{{appId}}/ProductFinder/GetDynamicAnswers?_=",getUserAttributesUrl:"{{rootUrl}}/Resonance/Application/{{appId}}/Discover/User/{{token}}",postUserAttributesUrl:"{{rootUrl}}/Resonance/Application/{{appId}}/User/{{token}}",get surveyUrl(){return x.getSurveyUrl.replace(/\{\{rootUrl\}\}/,v.rootUrl).replace(/{{appId}}/,v.applicationId).replace(/{{surveyId}}/,v.surveyId).replace(/{{trackingId}}/,v.resxTrackingId)},get answerUrl(){return x.answerQuestionUrl.replace(/{{rootUrl}}/,v.rootUrl).replace(/{{appId}}/,v.applicationId).replace(/{{token}}/,v.token)},get surveyStartEvent(){return v.surveyEventPrefix+"start"},get surveyCompletionEvent(){return v.surveyEventPrefix+"completion"},get dynamicAnswersUrl(){return x.getDynamicAnswerUrl.replace(/{{rootUrl}}/,v.rootUrl).replace(/{{appId}}/,v.applicationId)},get discoverUserAttributesUrl(){return x.getUserAttributesUrl.replace(/\{\{rootUrl\}\}/,v.rootUrl).replace(/{{appId}}/,v.applicationId).replace(/{{token}}/,v.token)},get updateUserAttributesUrl(){return x.postUserAttributesUrl.replace(/\{\{rootUrl\}\}/,v.rootUrl).replace(/{{appId}}/,v.applicationId).replace(/{{token}}/,v.token)}},S=null,I=[],b=[],k=function(e,t){for(w in e)e.hasOwnProperty(w)&&("object"==typeof e[w]?k(e[w],t[w]):t[w]=e[w])};if(k(e,v),"function"==typeof v.resultsAsYouGo.rrcall){var E="cpfcallback"+(new Date).getTime();window[E]=v.resultsAsYouGo.rrcall,v.resultsAsYouGo.rrcall=E}var P=function(){function e(e){e.forEach(function(e){e.selected&&e.navigationFilter&&""!==e.navigationFilter&&(t.length>9&&(t+=";"),t+=e.navigationFilter.replace(/&/g,";"))})}var t="pfilter=;";return I.forEach(function(t){t.children?t.children.forEach(function(t){e(t.answers)}):e(t.answers)}),t.length>9?t:""};"function"!=typeof v.finishFunction&&(v.finishFunction=function(e){"object"==typeof window.certona&&"string"==typeof window.certona.productfinderresultsurl&&(v.finishedUrl=window.certona.productfinderresultsurl),v.finishedUrl.indexOf("?")>-1?window.location=v.finishedUrl+"&"+e.filters:window.location=v.finishedUrl+"?"+e.filters}),null===v.resxTrackingId&&(v.resxTrackingId=l("RES_TRACKINGID")),null===v.resxSessionId&&(v.resxSessionId=l("RES_SESSIONID"));var N=new i,_=["","select_one","multi_select","product_rating","select_one_ddl","multi_select_ddl"],O=this,A=function(e){try{return N.hasOwnProperty(e)?N[e]:null}catch(e){console.log(e)}},T=function(){try{N.forEach(function(e){e.isFirst&&(S=e)})}catch(e){console.log(e)}};this.getSurvey=function(){try{window.processCPFAPIResponse=function(t){if(t.success){var n=t.productFinder.settings;for(var s in n)if(n.hasOwnProperty(s))if("object"==typeof n[s])for(var i in n[s])n[s].hasOwnProperty(i)&&(v[s][i]=n[s][i]);else v[s]=n[s];e.hasOwnProperty("resultsAsYouGo")&&e.resultsAsYouGo.hasOwnProperty("num")&&(v.resultsAsYouGo.num=e.resultsAsYouGo.num);for(var o=0;o=s&&clearInterval(o)},1e3/60)},M=function(e,t){try{var n=v.progressBar,s=q(t),i=m(document.getElementById(n.outerId)),r=document.getElementById(n.template).innerHTML,o=document.getElementById(n.insertionElementId),l=a.Handlebars.compile(r);o.innerHTML=l(s);var c=document.getElementById(n.innerId);t?H(c,"width",parseFloat(i),parseInt(n.animationDuration)||250):H(c,"width",(parseFloat(i)/s.total-1)*I.length,parseInt(n.animationDuration)||250)}catch(e){console.log(e)}};this.finish=function(){v.previewMode||(window.resx=new Object,window.resx.event=x.surveyCompletionEvent,window.resx.host=v.resxHost,window.resx.appid=v.applicationId,window.resx.itemid=v.surveyId,certonaResx.run()),v.progressBar.show&&M(S,!0),v.filters=P(),v.finishFunction(v)};var D=function(e,t){function n(e){e.answers.forEach(function(e){e.selected=!1;var t=document.querySelector('div[data-answer-id="'+e.answerId+'"]');t&&t.classList&&t.classList.remove("selected")})}t=t||S,t.children?e?n(t.children[e]):t.children.forEach(function(e){n(e)}):n(t)},B=function(e){try{var t=[],n=null,s=[],i=!0,r={},o=!1,e=e||!1;if(e||4!==S.questionTypeId&&5!==S.questionTypeId&&2!==S.responseType&&5!==S.responseType||(n=S.nextQuestionId,i=!1),S.children&&S.children.length&&S.children.length>0){var a={qId:S.questionId,questions:[]},l=1,c=S.children.length;for(l;l<=c;l++){var u=S.children.find("order",l);s=[],u.answers.forEach(function(e){if(e.selected&&(s.push(e.answerId),null!==e.navigationFilter&&void 0!==e.navigationFilter&&""!==e.navigationFilter)){o=!0;for(var t=e.navigationFilter.split(";"),n=0;n0&&(n+=v.symbols.answerBreadcrumbs.multiSelectSeparator),n+=e.rating?"Rated":r.answerText.length>0?r.answerText:r.answerName):(n.length>0&&(n+=v.symbols.answerBreadcrumbs.multiSelectSeparator),n+='');t>0&&(n=v.symbols.answerBreadcrumbs.questionGroupSeparator+n),o+=n}),b.push(o)}else{for(v.previewMode||(t={productFinder:{ surveyId:v.surveyId,questionId:e.questionId,trackingId:v.resxTrackingId,sessionId:v.resxSessionId,answerId:e.answers,itemId:""}},null!==e.itemId&&(t.productFinder.itemId=e.itemId),i=new XMLHttpRequest,i.open("POST",x.answerUrl,!0),i.setRequestHeader("Content-Type","application/json; charset=utf-8"),i.onload=function(){200!==i.status&&console.log(i.responseText),g(e.questionId)},h[e.questionId]=!1,d[e.questionId]={xhr:i,data:JSON.stringify(t)}),n="",s=0;s0&&(n+=v.symbols.answerBreadcrumbs.multiSelectSeparator),n+=null!==r?e.rating?"Rated":S.answers[r].answerText.length>0?S.answers[r].answerText:S.answers[r].answerName:'';b.push(n)}}),o&&"giftfinder"!==v.surveyEventPrefix){var m={user:{attributes:[],customerId:v.resxTrackingId}};for(var y in r)if(r.hasOwnProperty(y)&&p.hasOwnProperty(y)){var w=p[y];w.value=r[y],m.user.attributes.push(w)}var k=new XMLHttpRequest;k.open("POST",x.updateUserAttributesUrl,!0),k.setRequestHeader("Content-Type","application/json; charset=utf-8"),k.onload=function(){200!==k.status&&console.log(k.responseText),g("attributes")},h.attributes=!1,d.attributes={xhr:k,data:JSON.stringify(m)}}for(var E in d)if(d.hasOwnProperty(E)){var k=d[E].xhr;k.send(d[E].data)}I.push(S),null!=S&&(e||"undefined"==typeof n||null===n||""===n||n===-1?(f=!0,g()):(S=A(n),S?G():(f=!0,g())))}catch(e){console.log(e)}},$=function(e){var t=P();void 0!==e&&null!==e&&""!==e&&(t.length>0?t+=";":t="pfilter=;",t+=e.replace(/&/g,";")),"undefined"!=typeof window.RAOPFPV?window.RAOPFPV.getRecommendationResults(t):v.resultsAsYouGo.enabled&&(window.resx=new Object,window.resx.host=v.resxHost,window.resx.appid=v.applicationId,window.resx.itemid=v.surveyId,window.resx.rrelem=v.resultsAsYouGo.scheme,window.resx.rrqs=t,window.resx.rrnum=v.resultsAsYouGo.num,window.resx.rrec=!0,null!==v.resultsAsYouGo.rrcall&&"string"==typeof v.resultsAsYouGo.rrcall&&(window.resx.rrcall=v.resultsAsYouGo.rrcall),certonaResx.run())},F=function(){var e=I.pop();b.pop(),S=e,G()},U=function(){if(D(),I.push(S),b.push(null),!v.previewMode){var e={productFinder:{surveyId:v.surveyId,questionId:S.questionId,trackingId:v.resxTrackingId,sessionId:v.resxSessionId,answerId:[-1],itemId:"",questionGroupQuestionId:null}},t=new XMLHttpRequest;t.open("POST",x.answerUrl,!0),t.setRequestHeader("Content-Type","application/json; charset=utf-8"),t.onload=function(){200!==t.status&&console.log(t.responseText)},t.send(JSON.stringify(e))}var n;if(4===S.questionTypeId||5===S.questionTypeId||2===S.responseType||5===S.responseType)n=S.nextQuestionId;else{var s=Object.keys(S.answers)[0];n=S.answers[s].nextQuestionId}n!==-1&&null!==n?(S=A(n),G()):O.finish()},j=function(e,t){for(Element.prototype.matches||(Element.prototype.matches=Element.prototype.matchesSelector||Element.prototype.mozMatchesSelector||Element.prototype.msMatchesSelector||Element.prototype.oMatchesSelector||Element.prototype.webkitMatchesSelector||function(e){for(var t=(this.document||this.ownerDocument).querySelectorAll(e),n=t.length;--n>=0&&t.item(n)!==this;);return n>-1});e&&e!==document;e=e.parentNode)if(e.matches(t))return e;return null},V=function(e){var n=this,s=parseInt(n.parentNode.getAttribute("data-answer-id")),i=parseInt(j(n,".question").getAttribute("data-question-id")),r=document.getElementById("answer_info_"+s);if(r)r.parentNode.removeChild(r);else{var o=isNaN(i)?S.answers[s].answerInfo:S.children[i].answers[s].answerInfo,a=t("div",{text:o,id:"answer_info_"+s,class:"answer-info-box"});n.appendChild(a),a.style.left=n.offsetWidth+"px",a.style.bottom=n.offsetHeight+"px"}e.stopPropagation(),e.preventDefault()},Q={rh:function(e,t,n,s){if("function"==typeof n){var i=function(e){try{n.call(this,e)}catch(e){console.log(e)}},r=document;s&&(r=document.getElementById(v.insertionElementId));var o=r.querySelectorAll(e),a=0;for(a;a input","focus",function(){j(this,".certona-pf-input-container").classList.add("focused")},!0)},blur:function(){Q.rh(".certona-pf-input-container > input","blur",function(){j(this,".certona-pf-input-container").classList.remove("focused")},!0)},keypress:function(){Q.rh(".certona-pf-input-container > input","keypress",function(e){var t=e.charCode||e.keyCode;32!==t&&13!==t||j(this,".certona-pf-input-container").click()},!0)},register:function(){Q.ada.focus(),Q.ada.blur(),Q.ada.keypress()}},startOver:function(){Q.rh("#start-over","click",O.startSurvey,!0)},back:function(){Q.rh("#back","click",F,!0)},skip:function(){Q.rh("#skip-question","click",U,!0)},finish:function(){Q.rh("#finish-survey","click",function(){B(!0)},!0)},answerInfo:function(){Q.rh(".answer-info","click",V,!0)},groupQuestionContinue:function(){Q.rh("#question-group-continue","click",function(){var e=!1;S.children.forEach(function(t){var n=!1;if(t.answers.forEach(function(e){if(e.selected)return n=!0,!0}),n)return e=!0,!0}),e&&B()},!0)},selectOne:function(){Q.rh(".select-one","click",function(){var e=this,t=parseInt(e.getAttribute("data-answer-id")),n=parseInt(j(e,".question").getAttribute("data-question-id"));D(n),isNaN(n)?(S.answers[t].selected=!0,B()):(S.children[n].answers[t].selected=!0,e.classList.add("selected"))},!0)},selectOneRayg:function(){Q.rh(".select-one-rayg","click",function(){var e=this,t=null,n=e.getAttribute("data-answer-id"),s=parseInt(j(e,".question").getAttribute("data-question-id"));D(s),isNaN(s)?(S.answers[n].selected=!0,t=S.answers[n].navigationFilter):S.children[s].answers[n].selected=!0,e.classList.add("selected"),$(t)},!0)},selectOneRaygContinue:function(){Q.rh("#select-one-rayg-continue","click",function(){var e=this,t=j(e,".question").querySelector(".options");t.querySelectorAll(".select-one-rayg.selected").length>0&&B()},!0)},selectOneDdl:function(){Q.rh("select:not([multiple=multiple]):not([data-rayg=true])","change",function(){var e=this,t=o(e),n=parseInt(j(e,".question").getAttribute("data-question-id"));D(n),isNaN(n)?(S.answers[t].selected=!0,B()):(S.children[n].answers[t].selected=!0,e.classList.add("selected"))},!0)},selectOneDdlRayg:function(){Q.rh("select[data-rayg=true]:not([multiple=multiple])","change",function(){var e=this,t=null,n=o(e),s=parseInt(j(e,".question").getAttribute("data-question-id"));D(s),""!==n&&(isNaN(s)?(S.answers[n].selected=!0,t=S.answers[n].navigationFilter):(S.children[s].answers[n].selected=!0,e.classList.add("selected"))),$(t)},!0)},selectOneDdlRaygContinue:function(){Q.rh("#select-one-ddl-rayg-continue","click",function(){var e=this,t=j(e,".question").querySelector("select[data-rayg=true]");""!==t.value&&null!==t.value&&void 0!==t.value&&B()},!0)},productRating:function(){Q.rh(".product-rating","click",function(){var e=this,t=parseInt(e.getAttribute("data-answer-id")),n=parseInt(j(e,".question").getAttribute("data-question-id"));D(n),isNaN(n)?(S.answers[t].selected=!0,B()):(S.children[n].answers[t].selected=!0,e.classList.add("selected"))},!0)},productRatingRayg:function(){Q.rh(".product-rating-rayg","click",function(){var e=this,t=null,n=e.getAttribute("data-answer-id"),s=parseInt(j(e,".question").getAttribute("data-question-id"));D(s),isNaN(s)?(S.answers[n].selected=!0,t=S.answers[n].navigationFilter):S.children[s].answers[n].selected=!0,e.classList.add("selected"),$(t)},!0)},productRatingRaygContinue:function(){Q.rh("#product-rating-rayg-continue","click",function(){var e=this,t=j(e,".question").querySelector(".options");t.querySelectorAll(".product-rating-rayg.selected").length>0&&B()},!0)},multiSelect:function(){Q.rh(".multi-select","click",function(){var e=this,t="",n=e.getAttribute("data-answer-id"),s=parseInt(j(e,".question").getAttribute("data-question-id")),i=isNaN(s)?S:S.children[s];if(e.classList.contains("unselected")?(e.classList.remove("unselected"),e.classList.add("selected"),i.answers[n].selected=!0):(e.classList.remove("selected"),e.classList.add("unselected"),i.answers[n].selected=!1),isNaN(s)){var r=!1;i.answers.forEach(function(e){e.selected&&(r=!0)});var o=document.getElementById("multi-select-continue");r?o.removeAttribute("disabled"):o.setAttribute("disabled","disabled")}v.resultsAsYouGo.enabled&&(i.answers.forEach(function(e){if(e.selected){var n=e.navigationFilter;n.length>0&&(0===t.length?t=n:t+="&"+n)}}),$(t))},!0)},multiSelectContinue:function(){Q.rh("#multi-select-continue","click",function(){var e=this,t=j(e,".question").querySelector(".options");t.querySelectorAll(".multi-select.selected").length>0&&B()},!0)},multiSelectDdl:function(){Q.rh("select[multiple=multiple]","change",function(){var e=this,t="",n=o(e),s=parseInt(j(e,".question").getAttribute("data-question-id")),i=isNaN(s)?S:S.children[s];if(D(s),n.length>0&&""!==n[0]&&n.forEach(function(e){i.answers[e].selected=!0,t+=i.answers[e].navigationFilter}),isNaN(s)){var r=!1;i.answers.forEach(function(e){e.selected&&(r=!0)});var a=document.getElementById("multi-select-ddl-continue");r?a.removeAttribute("disabled"):a.setAttribute("disabled","disabled")}v.resultsAsYouGo.enabled&&$(t)},!0)},multiSelectDdlContinue:function(){Q.rh("#multi-select-ddl-continue","click",function(){var e=this,t=j(e,".question"),n=t.querySelectorAll("select"),s=n[n.length-1],i=o(s);i.length>0&&""!==i[0]&&B()},!0)},select_one:function(){Q.selectOne()},select_one_rayg:function(){Q.selectOneRayg(),Q.selectOneRaygContinue()},select_one_ddl:function(){Q.selectOneDdl()},select_one_ddl_rayg:function(){Q.selectOneDdlRayg(),Q.selectOneDdlRaygContinue()},multi_select:function(){Q.multiSelect(),Q.multiSelectContinue()},multi_select_ddl:function(){Q.multiSelectDdl(),Q.multiSelectDdlContinue()},product_rating:function(){Q.productRating()},product_rating_rayg:function(){Q.productRatingRayg(),Q.productRatingRaygContinue()},question_group:function(){Q.groupQuestionContinue()},always:function(){Q.startOver(),Q.finish(),Q.answerInfo()}},G=function(){var e=function(e){r++;var n=new XMLHttpRequest;n.open("POST",x.dynamicAnswersUrl+(new Date).getTime(),!0),n.setRequestHeader("Content-Type","application/json; charset=utf-8"),n.onload=function(){if(200===n.status){r--;var s=e.answers;e.answers=new i;for(var a=JSON.parse(n.responseText).GetDynamicQuestionAnswersResult.answers.sort(function(e,t){var n=e.answerText.toLowerCase(),s=t.answerText.toLowerCase();return n>s?1:s>n?-1:0}),c=1;c<=a.length;c++){var u=a[c-1];u.selected=s[u.answerId].selected,u.order=c,e.answers[u.answerId.toString()]=u,l=!0}if(0===r&&o){if(!l)return void(null===S.nextQuestionId||"-1"===S.nextQuestionId.toString()?O.finish():(S=N[S.nextQuestionId],G()));t()}console.log(n.responseText)}},n.send(JSON.stringify({sqid:e.questionId,filters:P().replace("pfilter=;","")}))},t=function(){if(5===S.questionTypeId&&0===S.answers.length)return void(null===S.nextQuestionId||"-1"===S.nextQuestionId.toString()?O.finish():(S=N[S.nextQuestionId],G()));null!==S.children&&S.children.length>0?n="question_group":(n=_[S.responseType],1!==S.responseType&&3!==S.responseType&&4!==S.responseType||!v.resultsAsYouGo.enabled||(n+="_rayg"));var e,t=[],i=document.getElementById(n).innerHTML,r=document.getElementById(v.insertionElementId),o=a.Handlebars.compile(i),l={};for(e in S)S.hasOwnProperty(e)&&(l[e]=S[e]);l.showBackButton=I.length>0,l.answerBreadcrumbs=b;var c=[],u=1;for(u=1;u<=l.answers.length;u++)c.push(l.answers.find("order",u));if(l.answers=c,r.innerHTML=o(l),Q.hasOwnProperty(n)&&t.push(Q[n]),null!==S.children&&S.children.length>0&&r.querySelectorAll(".question-group > .questions").length>0){r=r.querySelector(".question-group > .questions");var h=1,p=S.children.length;for(h;h<=p;h++){var d=S.children.find("order",h);if(d.answers.length>0){var f={};for(e in d)d.hasOwnProperty(e)&&(f[e]=d[e]);for(f.qIdx=h-1,c=[],u=1;u<=f.answers.length;u++)c.push(f.answers.find("order",u));if(f.answers=c,0===f.answers.length)continue;n=_[f.responseType],1!==f.responseType&&3!==f.responseType||!v.resultsAsYouGo.enabled||(n+="_rayg");var g=n+"_qgq";document.getElementById(g)&&(n=g),i=document.getElementById(n).innerHTML,o=a.Handlebars.compile(i),r.innerHTML+=o(f);var m=n.replace(/_qgq/,"");Q.hasOwnProperty(m)&&t.indexOf(Q[m])===-1&&t.push(Q[m])}}r=document.getElementById(v.insertionElementId)}else if(2===S.responseType||5===S.responseType){var w=!1;S.answers.forEach(function(e){e.selected&&(w=!0)});var x=document.getElementById(5===S.responseType?"multi-select-ddl-continue":"multi-select-continue");w?x.removeAttribute("disabled"):x.setAttribute("disabled","disabled")}t.forEach(function(e){e()});for(var k=r.querySelectorAll("select[data-certona-ddl=true]"),E=0;E0&&(l=!0),s===S.children.length-1&&(o=!0),0===r&&o){if(!l)return void(null===S.nextQuestionId||"-1"===S.nextQuestionId.toString()?O.finish():(S=N[S.nextQuestionId],G()));t()}})}else{var c=new XMLHttpRequest;c.open("POST",x.dynamicAnswersUrl+(new Date).getTime(),!0),c.setRequestHeader("Content-Type","application/json; charset=utf-8"),c.onload=function(){if(200===c.status){var e=S.answers;S.answers=new i;for(var n=JSON.parse(c.responseText).GetDynamicQuestionAnswersResult.answers.sort(function(e,t){var n=e.answerText.toLowerCase(),s=t.answerText.toLowerCase();return n>s?1:s>n?-1:0}),s=1;s<=n.length;s++){var r=n[s-1];r.selected=e[r.answerId].selected,r.order=s,S.answers[r.answerId.toString()]=r}t(),console.log(c.responseText)}},c.send(JSON.stringify({sqid:S.questionId,filters:P().replace("pfilter=;","")}))}else t()}catch(e){console.log(e)}};if(this.startSurvey=function(){return c?(I=[],b=[],N.forEach(function(e){D(void 0,e)}),v.previewMode||(window.resx=new Object,window.resx.event=x.surveyStartEvent,window.resx.host=v.resxHost,window.resx.appid=v.applicationId,window.resx.itemid=v.surveyId,certonaResx.run()),"undefined"!=typeof S&&null!==S&&S.isFirst===!0||T(),void G()):void setTimeout(O.startSurvey,100)},null!==v.resxTrackingId&&null!==v.resxSessionId)try{this.getSurvey()}catch(e){console.log(e)}else if(window.resx=new Object,window.resx.host=v.resxHost,window.resx.appid=v.applicationId,window.resx.itemid=v.surveyId,certonaResx.run(),v.resxTrackingId=l("RES_TRACKINGID"),v.resxSessionId=l("RES_SESSIONID"),null!==v.resxTrackingId&&null!==v.resxSessionId)try{this.getSurvey()}catch(e){console.log(e)}else console.log("Resonance Tracking and/or Session cookie(s) missing!")}