/***************************************
* @preserve
* ForeSee Web SDK: Feedback
* Built January 21, 19 10:11:52
* Code version: 19.8.1
* Template version: 19.8.1
***************************************/
_fsDefine(["require","fs",_fsNormalizeUrl("$fs.utils.js"),_fsNormalizeUrl("$fs.survey.js"),"feedbackconfig"],function(t,fs,utils,k,_){var e=fs.toLowerCase(window.location.href.toString()),s={};if((-1)[^\t]*)'/g,"$1\r").replace(/\t=(.*?)%>/g,"',$1,'").split("\t").join("');").split("%>").join("p.push('").split("\r").join("\\'")+"');}return p.join('');")(t||{})},d=function(e){var t,i=window._acsURL||window.location.toString();function s(e){if(!Array.isArray(e))return!1;for(t=0;t');e.setAttribute("alt","loading survey"),this.$el=e};o.prototype.center=function(e){var t=this.$el.parentNode.offsetWidth,i=(this.$el.parentNode.offsetHeight,this.$el.offsetWidth);this.$el.offsetHeight;this.$el.css({left:(t-i)/2+"px",top:e?(t-i)/2+"px":"auto"})},o.prototype.remove=function(){this.$el.parentNode.removeChild(this.$el)};var E=function(e,t){this.br=e,this.cfg=t};E.prototype.platformOK=function(){var e=this.cfg,t=this.br;return!(e.browser_cutoff[t.browser.name]&&t.browser.actualVersion'),this.sv.cfg.privacyuri=this.sv.cfg.privacyuri?this.sv.cfg.privacyuri:"http://www.foresee.com/about-us/privacy-policy/",this.sv.cfg.privacytext=this.sv.cfg.privacytext?this.sv.cfg.privacytext:"Privacy policy",this.sv.SubmitClicked.subscribe(function(){this.$content.removeClass("acsVisible"),this._showWait(),this._postSurveyData(function(){this.jrny.addEventObj({name:"feedback_submitted",properties:{mid:[i.mid]}}),this.$content.addClass("acsVisible"),this._showThankyou(),this._removeWait(),this.SurveySubmitted.fire()}.bind(this))}.bind(this)),this.networkError.subscribe(this.onNetworkError.bind(this)),this._getSurveyData(function(e){this.survey=e,this.show()}.bind(this))};p.prototype.onNetworkError=function(e){this._removeWait(),e&&e.type?this.jrny&&this.jrny.addEventObj({name:"feedback_survey_"+e.type,properties:{mid:[k.cfg.mid]}}):this.jrny&&this.jrny.addEventObj({name:"feedback_server_error",properties:{mid:[k.cfg.mid]}}),this.$content=f(''),this.$el=f(''),this.$closebtn=f(''),this.$content.innerHTML=a(this.errTemplate,this.survey);var t=this.$content.$(".acs-serviceunavailable__message")[0];if("expired"===e.type){for(;t.firstChild;)t.removeChild(t.firstChild);this.sv.cfg.fbexpiremessage?t.appendChild(f(""+this.sv.cfg.fbexpiremessage+"
")):t.appendChild(f("This is an expired survey!
"))}else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(f("Feedback isn't available right now.
Please check back later.
"))}utils.Bind(this.$closebtn,"feedback:click",function(e){this.hide(e,!0)}.bind(this)),this.$el.appendChild(this.$closebtn),this.$el.appendChild(this.$content);var i=this.$el.$(".acs-close-button")[0];utils.Bind(i,"feedback:click",function(e){this.hide(e,!0)}.bind(this)),this.$content.addClass("acsVisible"),window.document.body.innerHTML="",window.document.body.appendChild(this.$el)},p.prototype._renderSurvey=function(){var e=e||window,t=(this.sv.cfg,this),i=e.document.body;if(!this.sv.cfg.preview){var s=function(e){27==e.keyCode&&(t.jrny.addEventObj({name:"feedback_abandoned",properties:{mid:[t.cfg.mid]}}),t.hide(e,!1)),utils.Unbind(document.body,"feedback:keyup",s)};utils.Bind(document.body,"feedback:keyup",s)}i.innerHTML="",0===this.$el.children.length&&(this.$closebtn=f(''),this.$content=f(''),this.$el.appendChild(this.$closebtn),this.$el.appendChild(this.$content)),i.appendChild(this.$el),this.sv.cfg.preview||utils.Bind(this.$closebtn,"feedback:click",function(e){this.hide(e,!1)}.bind(this)),this._showWait()},p.prototype._showWait=function(){this._removeWait(),this._wait=new o,this.$el.appendChild(this._wait.$el),this._wait.center();var e=utils.getScroll(window),t=utils.getSize(window);this._wait.$el.css({position:"absolute",top:e.y+(t.h-this._wait.$el.offsetHeight)/2+"px",left:e.x+(t.w-this._wait.$el.offsetWidth)/2+"px"})},p.prototype._removeWait=function(){this._wait&&(this._wait.remove(),this._wait=null)},p.prototype.hide=function(e,t){window.document.body.innerHTML="";for(var i=0;i'),this.sv.cfg.preview||utils.Bind(this.$closebtn,"feedback:click",function(e){this.hide(e,!0)}.bind(this),!0),this.$content.innerHTML=e,this.jrny&&this.jrny.addEventObj({name:"feedback_thankyou_shown",properties:{mid:[this.cfg.mid]}}),this.$el.removeChild(this.$el.childNodes[0]),this.$el.removeChild(this.$el.childNodes[0]),this.$el.appendChild(this.$closebtn),this.$el.appendChild(this.$content);for(var t=this.$el.$(".acs-close-button")[0],i=this.$el.$("h1"),s=0;s"+this.sv.cfg.fbexpiremessage+"
"));else{var n=this._unencodeHTML(this.sv.defaultCfg.expired);s.appendChild(f(n))}}else{for(;s.firstChild;)s.removeChild(s.firstChild);var r=this._unencodeHTML(this.sv.defaultCfg.unavailable);s.appendChild(f(r))}for(var o=0;o")},m.prototype._showWait=function(){this._removeWait(),this._wait=new o,this.$el.appendChild(this._wait.$el),this._wait.center();var e=utils.getScroll(window),t=utils.getSize(window);this._wait.$el.css({top:e.y+(t.h-this._wait.$el.offsetHeight)/2+"px"})},m.prototype._removeWait=function(){this._wait&&(this._wait.remove(),this._wait=null)},m.prototype.remove=function(){this.$el&&this.$el.parentNode&&(utils.Unbind("feedbackModal:*"),this.$el.parentNode.removeChild(this.$el),C.onFeedbackClosed.fire(this.$el))},m.prototype.add=function(e){var t=(e=e||window).document.body,i=e.document.documentElement,s=Math.max(t.scrollHeight,t.offsetHeight,i.clientHeight,i.scrollHeight,i.offsetHeight),n="acsModalContainer--"+this.instcfg.template,r=this.sv.cfg,o=f(''),a=f('');if(this.browser.isIE&&10==this.browser.browser.version&&(n+=" acsIE10"),this.$el=f(''),this.$el.css({height:s}),!this.cfg.preview){var c=this;utils.Bind(o,"feedbackModal:click",function(e){(this.survey||this.networkError.didFire)&&(c.jrny&&c.jrny.addEventObj({name:"feedback_abandoned",properties:{mid:[r.mid]}}),this.remove())}.bind(this));utils.Bind(document.body,"feedbackModal:keyup",function(e){27==e.keyCode&&(c.jrny&&c.jrny.addEventObj({name:"feedback_abandoned",properties:{mid:[r.mid]}}),c.remove(),c.focusOnBadge())}),utils.Bind(a,"feedbackModal:click",function(e){var t=e.target;t&&t==a&&(c.jrny&&c.jrny.addEventObj({name:"feedback_abandoned",properties:{mid:[r.mid]}}),c.remove(),c.focusOnBadge())})}var d=this.head=f(''),h=f(''),l=f('');(this.$head=h).appendChild(l),d.appendChild(h),this.$content=f(''),d.appendChild(this.$content),a.appendChild(d),this.$el.appendChild(o),this.$el.appendChild(a),e.document.body.appendChild(this.$el),this.cfg.preview||(utils.Bind(l,"feedbackModal:click",function(e){this.jrny&&this.jrny.addEventObj({name:"feedback_abandoned",properties:{mid:[this.cfg.mid]}}),this.remove(),this.focusOnBadge()}.bind(this)),utils.Bind(l,"feedbackModal:keypress",function(e){(13===e.keyCode||"Enter"===e.key)&&(this.jrny.addEventObj({name:"feedback_abandoned",properties:{mid:[this.cfg.mid]}}),this.remove(),this.focusOnBadge())}.bind(this))),fs.nextTick(function(){o.addClass("_acsActive")}),this._showWait(),this._trapKeyBoard(d,l)},m.prototype.renderSurvey=function(){var e;this._removeWait(),this.$head.addClass("acsVisible"),this.survey.ansLogoSrc=fs.makeURI("$p_b_foresee.svg"),this.survey.meta.prologuetext=this._addTitleDescIds(this.survey.meta.prologuetext),this.survey.meta.epiloguetext=this._addTitleDescIds(this.survey.meta.epiloguetext),e=a(this.modaltemplate,this.survey),this.$content.innerHTML=e,this.sv.bind(this.$content),this.positionModal(),this.$content.addClass("acsVisible"),C.onFeedbackShown.fire(this.$el),this.jrny&&this.jrny.addEventObj({name:"feedback_survey_shown",properties:{mid:[this.cfg.mid]}}),C.onModalCssRetrieved.subscribe(function(){document.getElementById("fsrModalFocus").focus()}.bind(this),!0,!0)},m.prototype._addTitleDescIds=function(e){var t=document.createElement("div");t.innerHTML=e;var i=t.childNodes[0],s=t.childNodes[1],n="";if(2i&&(e=Math.max(0,(t.h-i-50)/2)+"px"),this.head.style.marginTop=e,s&&s.FBALTOVERFLOW&&this.$el.css({"overflow-y":"scroll",display:"block"})},m.prototype.show=function(){this.positionModal(),this.$el.css({display:"block"}),C.onFeedbackShown.fire(this.$el)},m.prototype.focusOnBadge=function(){var e=this.instcfg.badge&&this.instcfg.badge.$el;e&&e.focus()},m.prototype._trapKeyBoard=function(s,n){n=n||s,utils.Bind(document.body,"feedbackModal:focus",function(e){var t=(e=e||window.event).target||e.srcElement,i=document.getElementById("acsMainInvite")||document.getElementById("fsrInvite");i&&utils.DOMContains(i,t)||utils.DOMContains(s,t)||n&&(e.stopPropagation(),n.focus())},!1)},m.prototype._getSurveyData=function(){if(this.sv.isExpired())this.networkError.fire({type:"expired"});else{var e={mid:this.sv.cfg.mid,cachebust:(new Date).getTime()};this.sv.cfg.version&&(e.version=this.sv.cfg.version),this._surveyTimer=setTimeout(function(){this.networkError.fire({type:"timedout"})}.bind(this),1e4),this.ajax.send({url:this.sv.cfg.datauri,data:e,method:"GET",skipEncode:!1,success:function(e){this.networkError.didFire||(clearTimeout(this._surveyTimer),this.sv.SurveyData.fire(e,function(e){this.survey=e,this.renderSurvey()}.bind(this)))}.bind(this),failure:function(e){this.networkError.didFire||this.networkError.fire({type:"getdata_failed"})}.bind(this)})}},m.prototype._postSurveyData=function(t){if(this.cfg.preview)fs.nextTick(function(){t&&t()});else{var e=JSON.parse(this.sv._serialize());this.jrny&&this.jrny.config&&this.jrny.config.disable_cpps&&-1