d=b.valueB):(c=b.valueB,d=a.fieldValue),"number"===a.fieldType||"scale"===a.fieldType||"rating"===a.fieldType)switch(e.operator){case"==":returnparseInt(c)===parseInt(d);case"!==":returnparseInt(c)!==parseInt(d);case">":returnparseInt(c)>parseInt(d);case">=":returnparseInt(c)>parseInt(d);case"<":returnparseInt(c)<parseInt(d);case"<=":returnparseInt(c)<=parseInt(d);default:return!1}elseswitch(e.operator){case"==":returnc===d;case"!==":returnc!==d;case"contains":returnc.indexOf(d)>-1;case"!contains":return!(c.indexOf(d)>-1);case"begins":returnc.startsWith(d);case"!begins":return!c.startsWith(d);case"ends":returnc.endsWith(d);case"!ends":returnc.endsWith(d);default:return!1}}},n=function(){if(null===h.selected)throwconsole.error("current active field is null"),newError("current active field is null");returnh.selected._id===j?h.myform.form_fields.length-1:h.selected.index};h.isActiveField=function(a){returnh.selected._id===a._id},h.setActiveField=d.setActiveField=function(a,b,d){if(null!==h.selected&&(a||null!==b)){if(a){if(null===b){b=h.myform.visible_form_fields.length;for(vare=0;e<h.myform.visible_form_fields.length;e++){varg=h.myform.visible_form_fields[e];if(g._id==a){b=e;break}}}}elsea=h.myform.visible_form_fields[b]._id;if(h.selected._id!==a){h.selected._id=a,h.selected.index=b;varj=c("formValidity")(h.myform);h.translateAdvancementData={done:j,total:k,answers_not_completed:k-j},d&&(i=!0,setTimeout(function(){f.scrollToElement(angular.element(".activeField"),-10,200).then(function(){i=!1,setTimeout(function(){document.querySelectorAll(".activeField .focusOn").length?document.querySelectorAll(".activeField .focusOn")[0].focus():document.querySelectorAll(".activeField input").length?document.querySelectorAll(".activeField input")[0].focus():document.querySelectorAll(".activeField .selectize-input")[0].focus()})})}))}}},h.$watch("selected.index",function(a,c){a!==c&&c<h.myform.form_fields.length&&(h.myform.submitted||(console.log("SendVisitorData.send()"),e.send(h.myform,c,b.getTimeElapsed())))}),g.onscroll=function(){if(!i){vara,b=$(window).scrollTop(),c=document.getElementsByClassName("activeField")[0].getBoundingClientRect(),d=c.top,e=c.bottom,f=$(".activeField").height(),g=$(".form-actions").height(),k=$(document).height()-$(window).height(),l=($("form_fields").height(),"form > .field-directive:nth-of-type("+String(h.myform.visible_form_fields.length-1)+")"),m=$(l).height(),n=k-g-1.2*m,o=.9;h.selected.index===h.myform.visible_form_fields.length?b<n&&(a=h.selected.index-1,h.setActiveField(null,a,!1)):h.selected.index===h.myform.visible_form_fields.length-1&&b>n?(a=h.selected.index+1,h.setActiveField(j,a,!1)):e<f*o&&h.selected.index<h.myform.visible_form_fields.length-1?(a=h.selected.index+1,h.setActiveField(null,a,!1)):0!==h.selected.index&&d>f*o&&(a=h.selected.index-1,h.setActiveField(null,a,!1))}h.$apply()},d.nextField=h.nextField=function(){if(h.selected&&h.selected.index>-1)if(h.selected._id!==j){vara=h.myform.visible_form_fields[h.selected.index];a.logicJump&&a.logicJump.jumpTo&&m(a)?h.setActiveField(a.logicJump.jumpTo,null,!0):h.selected.index<h.myform.visible_form_fields.length-1?h.setActiveField(null,h.selected.index+1,!0):h.setActiveField(j,null,!0)}elsed.setActiveField(null,0,!0);elsed.setActiveField(null,0,!0)},d.prevField=h.prevField=function(){console.log("prevField"),console.log(h.selected);vara=h.selected.index-1;h.selected.index>0&&h.setActiveField(null,a,!0)},d.goToInvalid=h.goToInvalid=function(){vara=$(".row.field-directive .ng-invalid.focusOn, .row.field-directive .ng-untouched.focusOn:not(.ng-valid)").first().parents(".row.field-directive").first().attr("data-id");h.setActiveField(a,null,!0)},h.exitStartPage=function(){h.myform.startPage.showStart=!1,h.myform.visible_form_fields.length>0&&(h.selected._id=h.myform.visible_form_fields[0]._id)};varo=function(){vara=newMobileDetect(window.navigator.userAgent),b="other";returna.tablet()?b="tablet":a.mobile()?b="mobile":a.is("bot")||(b="desktop"),{type:b,name:window.navigator.platform}},p=function(){$.ajaxSetup({async:!1}