"use strict";var __assign=undefined&&undefined.__assign||function(){return __assign=Object.assign||function(n){for(var t,i,r=1,u=arguments.length;r<u;r++){t=arguments[r];for(i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},__assign.apply(this,arguments)},__extends=undefined&&undefined.__extends||function(){var n=function(t,i){return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i])},n(t,i)};return function(t,i){function r(){this.constructor=t}n(t,i);t.prototype=i===null?Object.create(i):(r.prototype=i.prototype,new r)}}(),__decorate=undefined&&undefined.__decorate||function(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};define("utils/query-string",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.UpdateQueryString=function(n,t,i){var u,r,f;return i||(i=window.location.href),u=new RegExp("([?&])"+n+"=.*?(&|#|$)(.*)","gi"),u.test(i)?typeof t!="undefined"&&t!==null?i.replace(u,"$1"+n+"="+t+"$2$3"):(r=i.split("#"),i=r[0].replace(u,"$1$3").replace(/(&|\?)$/,""),typeof r[1]!="undefined"&&r[1]!==null&&(i+="#"+r[1]),i):typeof t!="undefined"&&t!==null?(f=i.indexOf("?")!==-1?"&":"?",r=i.split("#"),i=r[0]+f+n+"="+t,typeof r[1]!="undefined"&&r[1]!==null&&(i+="#"+r[1]),i):i},n.GetQueryString=function(n){var r=window.location.href,i,t;return(n=n.replace(/[\[\]]/g,"\\$&"),i=new RegExp("[?&]"+n+"(=([^&#]*)|&|#|$)"),t=i.exec(r),!t)?null:t[2]?decodeURIComponent(t[2].replace(/\+/g," ")):""},n}();t["default"]=i});define("components/account-chooser",["require","exports","utils/query-string"],function(n,t,i){function r(){$(".account-chooser--full-page .account-chooser_search").val(i["default"].GetQueryString("searchTerm"));$("body").on("keydown",".account-chooser--full-page .account-chooser_search",function(n){n.keyCode===13&&(n.preventDefault,window.location.href=i["default"].UpdateQueryString("searchTerm",n.target.value,window.location.href))});$("body").on("keyup",".account-chooser:not(.account-chooser--full-page) .account-chooser_search",function(n){var t=$(n.target).val();t?Array.from($(".account-chooser:not(.account-chooser--full-page) .dropdown-item")).forEach(function(n){n.innerText.toLocaleLowerCase().indexOf(t.toLocaleLowerCase())>=0?$(n).show():$(n).attr("style","display:none !important")}):$(".account-chooser:not(.account-chooser--full-page) .dropdown-item").show()})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=r});define("utils/cookies",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.set=function(n,t){var i=new Date,r=t;return i.setTime(i.getTime()+6048e5),document.cookie=n+"="+r+"; expires="+i.toUTCString()+"; path=/",this.get(n)},n.get=function(n){var i="; "+document.cookie,t=i.split("; "+n+"=");if(t.length==2)return t.pop().split(";").shift()},n.remove=function(n){var t=new Date;t.setTime(t.getTime()+-864e5);document.cookie=n+"=; expires="+t.toUTCString()+"; path=/"},n}();t["default"]=i});define("components/alerts",["require","exports","utils/cookies"],function(n,t,i){function r(){var n="ch-alerts";$(".alert__popup").each(function(){var r=$(this).data("alert-id"),u,t,f;if(r){if(u=r.toString(),t=i["default"].get(n),!t){$(this).removeClass("d-none");return}f=t.split(",");f.indexOf(u)===-1?$(this).removeClass("d-none"):$(this).remove()}});$(".alert__popup").on("closed.bs.alert",function(){var t=$(this).data("alert-id").toString(),r,u;t&&(r=i["default"].get(n),r?(u=r.split(","),u.push(t),i["default"].set(n,u.toString())):i["default"].set(n,t))})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=r});define("utils/number-helper",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.formatCurrency=function(n){return n.toFixed(2).toString().replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1,")},n}();t["default"]=i});define("components/bill-breakdown-chart",["require","exports","utils/number-helper"],function(n,t,i){function r(n){function o(n,t,i,r){var u=Math.atan((t-r)/Math.abs(n-i));return u*180/Math.PI}var h;if($("#billbreakdownchart").length>0){var s=function(n){var t=n.chart.ctx,c=$("#billbreakdownchart").width(),u=$("#billbreakdownchart").height(),i=c/2,r=u/2,f=i+n.outerRadius+15,e=i-(n.outerRadius+15),s=[],h=[];n.data.datasets.forEach(function(c,l){var a=n.getDatasetMeta(l);a.hidden||a.data.forEach(function(c,l){var p=c._model.label,b=t.measureText(p).width,v=c.getCenterPoint();if(t.fillStyle=n.options.labelColor[l],t.strokeStyle="black",t.lineWidth=2,t.textAlign="left",t.textBaseline="middle",t.font=screen.width<parseInt("768px")&&screen.width>parseInt("576px")?"normal 16px MyriadPro":screen.width<parseInt("576px")?"normal 12px MyriadPro":"normal 20px MyriadPro",v.x<i){var y=o(i,r,v.x,v.y),w=i-n.outerRadius*Math.cos(y*Math.PI/180),a=r-n.outerRadius*Math.sin(y*Math.PI/180);a<10?a=a+10:a>u-10&&(a=a-10);s.forEach(function(n){a>=n-20&&a<n&&(a=a-20);a<=n+20&&a>n&&(a=a+20)});t.beginPath();t.moveTo(w,a);t.lineTo(e,a);t.stroke();t.fillText(p,e-(b+5),a);s.push(a)}else{var y=o(i,r,v.x,v.y),w=i+n.outerRadius*Math.cos(y*Math.PI/180),a=r-n.outerRadius*Math.sin(y*Math.PI/180);a<10?a=a+10:a>u-10&&(a=a-10);h.forEach(function(n){a>=n-15&&a<=n+15&&(a=a+15)});t.beginPath();t.moveTo(w,a);t.lineTo(f,a);t.stroke();t.fillText(p,f+5,a);h.push(a)}})})},t=$("#billbreakdownchart").first(),r=[],u=[],f=[],e=[];$(t).data("gas-delivery")!="0"&&(r.push(parseFloat($(t).data("gas-delivery"))),u.push($(t).data("gas-delivery-label")),f.push("#001970"),e.push("#003366"));$(t).data("gas-supply")!="0"&&(r.push(parseFloat($(t).data("gas-supply"))),u.push($(t).data("gas-supply-label")),f.push("#006EAD"),e.push("#003366"));$(t).data("other")!="0"&&(r.push(parseFloat($(t).data("other"))),u.push($(t).data("other-label")),f.push("#b8b8b8"),e.push("#000000"));$(t).data("taxes")!="0"&&(r.push(parseFloat($(t).data("taxes"))),u.push($(t).data("taxes-label")),f.push("#f6ce3c"),e.push("#000000"));$(t).data("electric-supply")!="0"&&(r.push(parseFloat($(t).data("electric-supply"))),u.push($(t).data("electric-supply-label")),f.push("#def0e6"),e.push("#007833"));$(t).data("electric-delivery")!="0"&&(r.push(parseFloat($(t).data("electric-delivery"))),u.push($(t).data("electric-delivery-label")),f.push("#007833"),e.push("#007833"));h=new n(t,{type:"doughnut",data:{datasets:[{data:r,backgroundColor:f}],labels:u},options:{labelColor:e,aspectRatio:3,cutoutPercentage:75,elements:{center:[{text:"$"+i["default"].formatCurrency(Number($(t).data("total-charges"))),fontStyle:"MyriadPro",sidePadding:50},{text:$(t).data("total-charges-label"),fontStyle:"MyriadPro",sidePadding:40}]},tooltips:{enabled:!0,displayColors:!1,backgroundColor:"white",bodyFontFamily:"MyriadPro",bodyFontSize:32,bodyFontColor:"black",borderColor:"black",borderWidth:1,callbacks:{label:function(n,t){return"$"+i["default"].formatCurrency(Math.round(t.datasets[n.datasetIndex].data[n.index]*100)/100)}}},legend:{display:!1},animation:{onProgress:function(n){n.currentStep!=n.numSteps&&s(n.chart)},onComplete:function(n){s(n.chart)}}},plugins:[{beforeDraw:function(n){var t=n.chart.ctx;n.config.options.elements.center&&n.config.options.elements.center.forEach(function(i){var r=i,f=r.fontStyle||"Arial",e=r.text,s=r.color||"#000",h=r.sidePadding||20,c=h/100*n.innerRadius*2,o,u;t.font="30px "+f;var l=t.measureText(e).width,a=n.innerRadius*2-c,v=a/l,y=Math.floor(30*v),p=n.innerRadius*2,w=Math.min(y,p);t.textAlign="center";t.textBaseline="middle";o=(n.chartArea.left+n.chartArea.right)/2;u=(n.chartArea.top+n.chartArea.bottom)/2.2;r!==n.config.options.elements.center[0]&&(u=(n.chartArea.top+n.chartArea.bottom)/1.7);t.font=w+"px "+f;t.fillStyle=s;t.fillText(e,o,u)})}}]})}}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=r});define("components/bill-comparison-chart",["require","exports"],function(n,t){function i(n){function t(t){var i=new n(t,{type:"bar",data:{datasets:[{label:$(t).data("esco-label"),data:$(t).data("esco").split(",").map(function(n){return parseFloat(n)}),backgroundColor:"rgba(0, 100, 200, 0.5)"},{label:$(t).data("cenhud-label"),data:$(t).data("cenhud").split(",").map(function(n){return parseFloat(n)}),type:"line",borderColor:"rgb(75, 75, 90)",backgroundColor:"rgba(0,0,0,0)"}],labels:$(t).data("dates").split(",")},options:{maintainAspectRatio:!1,scales:{yAxes:[{ticks:{beginAtZero:!0,min:0,stepSize:200,precision:2,callback:function(n){return"$"+n}}}]},legend:{position:"bottom"}}})}if($(".billcomparisonchart").length>0){var i=$(".billcomparisonchart"),r=$(".tab-pane:not('.active')");i.each(function(n,i){return t(i)});r.addClass("active")}}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=i});define("utils/alerts-helper",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.showAlert=function(t,i){var u=$("#dynamic-alert"),f=u.find("#dynamic-alert-content"),e=u.find("#dynamic-alert-close"),r;f.length>0&&$(f[0]).html(t);u.css("display","block");r="alert-";switch(i){case 1:r+="secondary";break;case 2:r+="success";break;case 3:r+="warning";break;case 4:r+="error";break;case 0:default:r+="primary"}u.addClass(r);e.on("click keydown",function(t){(t.keyCode===13||t.type==="click")&&n.closeAlertAction(u,r)});setTimeout(function(){n.closeAlertAction(u,r)},4e3)},n.closeAlert=function(){var t=$("#dynamic-alert");n.closeAlertAction(t)},n.closeAlertAction=function(n,t){t===void 0&&(t="alert-secondary alert-success alert-warning alert-error alert-primary");n.fadeOut();n.removeClass(t)},n}();t["default"]=i});define("utils/error-messages",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.get=function(n){var t=window.ERROR_MESSAGES;switch(n){case 2:return t.invalidRequestMessage;case 3:return t.notFoundMessage;case 4:return t.resultsNotFoundMessage;case 5:return t.serverErrorMessage;case 6:return t.unauthorizedMessage;case 7:return t.contactUsMessage;case 0:case 1:default:return""}},n.getByStatusCode=function(n){var t=window.ERROR_MESSAGES;switch(n){case 401:return t.invalidRequestMessage;case 403:return t.unauthorizedMessage;case 404:return t.notFoundMessage;case 500:default:return t.serverErrorMessage}},n}();t["default"]=i});define("components/budget-billing",["require","exports","utils/alerts-helper","utils/error-messages"],function(n,t,i,r){function u(){$("#flyout_container").on("click keydown",".budget-enrolling_submit",function(n){(n.keyCode===13||n.type==="click")&&(n.preventDefault(),$("#flyout_container .budget-enrolling").waitMe({effect:"rotation"}),$.ajax({type:"PUT",url:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+"/api/accounts/active/budget",dataType:"json",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(n){$("#flyout_container .budget-enrolling").waitMe("hide");n.result?($(".budget-enrolling").hide(),$(".budget-enrolling_enrolled").show()):alert("Something went wrong, please contact Central Hudson Support")},error:function(n){$("#flyout_container .budget-enrolling").waitMe("hide");i["default"].showAlert(r["default"].getByStatusCode(n.status),4)}}))});$("#flyout_container").on("click keydown",".budget-enrolling_done",function(n){(n.keyCode===13||n.type==="click")&&(n.preventDefault(),$("#flyout-close").click(),$("body").waitMe({effect:"rotation"}),window.location.reload())})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=u});define("components/budget-billing-details",["require","exports"],function(n,t){function i(){$(function(){$('[data-toggle="popover"]').popover()})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=i});define("components/flyout",["require","exports","utils/error-messages"],function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){}return n.openFlyout=function(t){$("#header-menu-search").removeClass("visible");$("#flyout_container .flyout__container").waitMe({effect:"rotation"});$(".overlay").addClass("active");$("#flyout_container").addClass("active");$("html").css("overflow","hidden");$("#flyout-close").focus();$.ajax(t,{type:"GET",contentType:"text/html",dataType:"html",beforeSend:n.beforeSendFunc,success:n.successFunc,error:n.errorFunc})},n.closeFlyout=function(){if(n.closeFlyoutCallbacks!=null)for(var t=0;t<n.closeFlyoutCallbacks.length;t++)n.closeFlyoutCallbacks[t]();n.closeFlyoutCallbacks=null;$(".overlay").removeClass("active");$("#flyout_container").removeClass("active");$("html").css("overflow","auto");n.isLoading=!1},n.attachListenerIfInFlyout=function(t,i){$("#flyout_container "+t).length>0&&n.closeFlyoutCallbacks.push(i)},n.init=function(){var t=this;$("body").on("click keydown",".flyoutLink",function(n){if(n.keyCode===13||n.type==="click"){n.preventDefault();var i=$(n.currentTarget);window.history.replaceState("","",location.pathname+"#"+i.data("link")+location.search);t.openFlyout(i.data("link"))}});$("#flyout-close").on("click keydown",n.closeFlyoutState);$(document).on("click",".overlay",function(){$("#flyout_container.active")&&$("#flyout-close").click()});$(document).on("click keydown",".flyout-close",n.closeFlyoutState);$(window).bind("hashchange",n.determineFlyoutState);$(document).ready(n.determineFlyoutState)},n.determineFlyoutState=function(){if(location.hash.replace("#","")=="")n.closeFlyout();else{if(n.checkDataLink(location.hash.replace("#","")))return;var t=location.hash.replace("#","");n.openFlyout(t)}},n.closeFlyoutState=function(t){(t.keyCode===13||t.type==="click")&&(t.preventDefault(),window.history.replaceState("","",location.pathname+location.search),n.closeFlyout())},n.beforeSendFunc=function(){n.isLoading=!0;$("#flyout_container .flyout__container").waitMe({effect:"rotation"});$(".flyout__content").html("")},n.successFunc=function(t){n.isLoading&&(n.closeFlyoutCallbacks=[],$(".flyout__content").html(t),$("#flyout_container .flyout__container").waitMe("hide"),n.isLoading=!1)},n.errorFunc=function(){n.isLoading&&($("#flyout_container .flyout__container").waitMe("hide"),$(".flyout__content").html(i["default"].get(5)),n.isLoading=!1)},n.checkDataLink=function(n){var t=new RegExp("^(?:[a-z]+:)?//","i");return t.test(n)},n.isLoading=!1,n.closeFlyoutCallbacks=null,n}();t["default"]=r});define("components/ebills",["require","exports","utils/alerts-helper","utils/error-messages","components/flyout"],function(n,t,i,r,u){function f(){$("#flyout_container").on("click keydown",".ebill-enrolling_submit",function(n){(n.keyCode===13||n.type==="click")&&(n.preventDefault(),$("#flyout_container .ebill-enrolling").waitMe({effect:"rotation"}),$.ajax({type:"PUT",url:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+"/api/accounts/active/ebill/enroll",dataType:"json",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(n){if($("#flyout_container .ebill-enrolling").waitMe("hide"),n.result)$(".ebill-enrolling").hide(),$(".ebill-enrolling_enrolled").show(),u["default"].attachListenerIfInFlyout(".ebill-enrolling",function(){$("body").waitMe({effect:"rotation"});window.location.reload()});else{var t=n.errorMessageId;t!=0&&i["default"].showAlert(r["default"].get(t),4)}},error:function(n){$("#flyout_container .ebill-enrolling").waitMe("hide");i["default"].showAlert(r["default"].getByStatusCode(n.status),4)}}))});$("#flyout_container").on("click keydown",".ebill-enrolling_unenroll",function(n){(n.keyCode===13||n.type==="click")&&(n.preventDefault(),$("#flyout_container .ebill-enrolling").waitMe({effect:"rotation"}),$.ajax({type:"PUT",url:window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+"/api/accounts/active/ebill/unenroll",dataType:"json",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(n){if($("#flyout_container .ebill-enrolling").waitMe("hide"),n.result)$(".ebill-enrolling").hide(),$(".ebill-enrolling_unenrolled").show(),u["default"].attachListenerIfInFlyout(".ebill-enrolling",function(){$("body").waitMe({effect:"rotation"});window.location.reload()});else{var t=n.errorMessageId;t!=0&&i["default"].showAlert(r["default"].get(t),4)}},error:function(n){$("#flyout_container .ebill-enrolling").waitMe("hide");i["default"].showAlert(r["default"].getByStatusCode(n.status),4)}}))})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=f});define("components/enablement-links",["require","exports"],function(n,t){function i(){$(".enablement-link-link_enabled").on("click keydown",function(n){(n.keyCode===13||n.type==="click")&&(n.preventDefault(),$($(n.target).parents(".enablement-link-link").find(".enablement-link-link_link")).find("button").click())})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=i});define("components/header-block",["require","exports"],function(n,t){function i(){function i(){var n=$(".quick-links--mobile").first().outerHeight()+10;$(".quick-links--mobile").css("display")==="none"?($(".footer").css("padding-bottom","10px"),t=10):t!==n&&($(".footer").css("padding-bottom",n+"px"),t=n)}function r(t,i,r){r===void 0&&(r=!1);r||i.hasClass(f)?(i.find(".sidebar__links__dropdown").slideUp(n),u.each(function(i,r){var u=$(r).find("a").first();u.attr("id")!==t&&$(r).slideDown(n)})):(u.each(function(i,r){var u=$(r).find("a").first();u.attr("id")!==t&&$(r).slideUp(n)}),i.find(".sidebar__links__dropdown").slideDown(n));i.toggleClass(f)}var t=0;$(window).on("resize",i);$(document).ready(i);$("#header-menu-btn").on("click keydown",function(n){(n.keyCode===13||n.type==="click")&&(n.preventDefault(),$("#header-menu-search").removeClass("visible"),$(".sidebar").addClass("active"),$(".overlay").addClass("active"),$("html, body").css("overflow","hidden"),$("body").addClass("lock-body"),n.which===13&&$("#navbarItem0").focus())});$("#sidebar-close").on("click keydown",function(n){if(n.keyCode===13||n.type==="click"){n.preventDefault();$(".overlay").removeClass("active");$(".sidebar").removeClass("active");$("html, body").css("overflow","auto");$("body").removeClass("lock-body");n.which===13&&$("#header-menu-btn").focus();var t=$(".sidebar__links--open > a").attr("id"),i=$(".sidebar__links--open > a").parent();r(t,i,!0)}});$(document).on("click",".overlay",function(){$(".sidebar.active")&&$("#sidebar-close").click()});var u=$(".sidebar__links__item"),n=225,f="sidebar__links--open";$(".sidebar__links__item.dropdown > a").on("click keydown",function(n){if(n.keyCode===13||n.type==="click"){n.preventDefault();var t=$(this).attr("id"),i=$(this).parent();r(t,i)}});$("#header-search-btn").on("click keydown",function(n){var t,i;(n.keyCode===13||n.type==="click")&&(n.preventDefault(),t=$("#header-menu-search"),t.toggleClass("visible"),t.hasClass("visible")&&(i=$("#header-menu-search").find(".header-search_input.tt-input"),i.focus()))});$(".header-search_input").on("keydown",function(n){n.keyCode===13&&(n.preventDefault(),$($(n.target).closest(".twitter-typeahead")).parent().find(".header-search-btn_submit").click())});$(".header-search-btn_submit").on("click keydown",function(n){if(n.keyCode===13||n.type==="click"){n.preventDefault();var t=$($(n.target).closest(".search-input_container")).find(".header-search_input.tt-input");window.location.href=t.data("typeahead-page")+"?q="+t.val()}});$(".header-search-btn_close").on("click keydown",function(n){(n.keyCode===13||n.type==="click")&&(n.preventDefault(),$("#header-menu-search").toggleClass("visible"))})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=i});define("components/password-validator",["require","exports"],function(n,t){function i(){function r(n,t){n?t.addClass("password-rules--valid"):t.removeClass("password-rules--valid")}var e=$("#password-validator"),o=$("#password-rules"),t,i,u,n,f;if(!(e.length<1)&&!(o.length<1)){t=$("#Password");i=$("#PasswordConfirm");$("#ShowPassword").on("click keydown",function(n){(n.keyCode===13||n.type==="click")&&(t.attr("type",t.attr("type")==="text"?"password":"text"),i.attr("type",i.attr("type")==="text"?"password":"text"))});u=null;n=!0;t.on("keyup",function(){u&&clearTimeout(u);u=setTimeout(function(){var u=t.val(),d=i.val(),f,p,e,o,w,s,h,b,c,l,k,a,v,y;n=!0;f=$("#lowercase-rule");f.length>0&&(p=/[a-z]/g,e=p.test(u),r(e,f),n=n&&e);o=$("#uppercase-rule");o.length>0&&(w=/[A-Z]/g,s=w.test(u),r(s,o),n=n&&s);h=$("#number-rule");h.length>0&&(b=/\d/g,c=b.test(u),r(c,h),n=n&&c);l=$("#symbol-rule");l.length>0&&(k=/[!@#$%^&*(),.?":{}|<>]/g,a=k.test(u),r(a,l),n=n&&a);v=$("#minchar-rule");v.length>0&&(y=u.length>=8,r(y,v),n=n&&y);$("input[type=submit]").prop("disabled",!(n&&u===d))},400)});f=null;i.on("keyup",function(){f&&clearTimeout(f);f=setTimeout(function(){var u=t.val(),f=i.val(),r=u===f;r?$("#confirm-password-error").hide():$("#confirm-password-error").show();$("input[type=submit]").prop("disabled",!(n&&r))},400)})}}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=i});define("components/page-adjustments",["require","exports"],function(n,t){function i(){function n(){var f=t.outerHeight(),n;i.css("margin-bottom","-"+f+"px");r.css("height",f+"px");n=0;$(".alert__popup").each(function(t,i){var r=$(i).outerHeight();r>n&&(n=r)});u.css("height",n+"px")}var t,i,r,u;t=$("footer.footer").first();i=$(".page-wrapper").first();r=$(".page-push").first();u=$(".alert-push").first();$(window).on("resize",function(){return n()});n();$(".alert").on("closed.bs.alert",function(){n()})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=i});define("components/meter-reading-form",["require","exports"],function(n,t){function i(){function n(){$("input[name=MeterTypeChoice]:checked").val()=="StandardMeter"?($(".tou-reading").addClass("d-none"),$(".standard-reading").removeClass("d-none")):($(".standard-reading").addClass("d-none"),$(".tou-reading").removeClass("d-none"))}$(".meter-reading").on("change","#MeterTypeStandardChoice",n);$(".meter-reading").on("change","#MeterTypeTOUChoice",n);n()}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=i});define("components/modal",["require","exports"],function(n,t){function i(){var n;$(".modal-auto").each(function(n,t){var i=$(t);window.setTimeout(function(){return i.modal()},i.data("delay")*1e3)});$("#globalModal").on("show.bs.modal",function(t){var i=$(t.target),r=$(t.relatedTarget).data();i.find(".modal-title").html(r.modalTitle||"");i.find(".modal-subtitle").html(r.modalSubtitle||"");r.modalCloseButtonVisible!==!0?i.find(".modal-header .close").hide():i.find(".modal-header .close").show();r.modalBody?(i.find(".modal-footer").show(),i.find(".modal-body p").html(r.modalBody),i.find("button.modal-ok").addClass(r.modalOkButtonClass||"button button--primary").html(r.modalOkButtonText||"OK"),r.modalOkButtonVisible!==!1?i.find("button.modal-ok").show():i.find("button.modal-ok").hide(),i.find("button.modal-cancel").addClass(r.modalOkButtonClass||"button button--default").html(r.modalCancelButtonText||"Cancel"),r.modalCancelButtonVisible!==!1?i.find("button.modal-cancel").show():i.find("button.modal-cancel").hide(),r.modalOkButtonClick&&(eval("handler="+r.modalOkButtonClick),i.find("button.modal-ok").click(function(){typeof n=="function"&&n();$("#globalModal").modal("hide")}))):r.modalUrl&&(i.find(".modal-footer").hide(),i.find(".modal-body p").waitMe({effect:"rotation"}).load(r.modalUrl))}).on("shown.bs.modal",function(){var n=$(event.target);n.find("form[data-ajax]").each(function(n,t){$.validator.unobtrusive.parse("#"+t.id)})}).on("hide.bs.modal",function(){var t=$(event.target);n=undefined;t.find(".modal-body p").html('<i class="fas fa-spinner fa-spin fa-4x"><\/i>')})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=i});define("utils/date-helper",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.formatTime=function(n,t){var i,r="am",u;return n===0?(i="12:",r="am"):n===12?(i="12:",r="pm"):n>12?(i=n-12+":",r="pm"):i=n+":",u=t.toString(),i+=u.length<2?"0"+t:t,i+r},n.formatTimeFromTimestamp=function(n){var t=new Date(n);return this.formatTime(t.getHours(),t.getMinutes())},n.formatDateFromUnixTimestamp=function(n){var t=new Date(n),i=this.formatTime(t.getHours(),t.getMinutes());return this.daysOfWeek[t.getDay()]+" "+this.months[t.getMonth()]+" "+t.getDate()+", "+t.getFullYear()+" at "+i},n.parseDateStringArray=function(n){return n.split(",").map(function(n){return new Date(n)})},n.isDateInArray=function(n,t){var r=n.getTime(),i;return t?(i=t.map(function(n){return n.getTime()}),$.inArray(r,i)==-1)?!1:!0:!1},n.daysOfWeek=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n.months=["January","February","March","April","May","June","July","August","September","October","November","December"],n}();t["default"]=i});define("utils/mask",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i="(000) 000-0000",r="0000-0000-00",u="000-00-0000",f="0000-0000-00-0",e=function(){function n(){}return n.getRawValue=function(n){return n.replace(/[\s+\(\)-]/g,"")},n.phoneNumber=function(n,t){n===void 0&&(n=".phone-number");t===void 0&&(t={});$(n).mask(i,__assign({selectOnFocus:!1},t))},n.accountNumber=function(n,t){n===void 0&&(n=".account-number");t===void 0&&(t={});$(n).mask(r,__assign({selectOnFocus:!1},t))},n.accountNumberChecksum=function(n,t){n===void 0&&(n=".account-number-checksum");t===void 0&&(t={});$(n).mask(f,__assign({selectOnFocus:!1},t))},n.ssNumber=function(n,t){n===void 0&&(n=".ss-number");t===void 0&&(t={});$(n).mask(u,__assign({selectOnFocus:!1},t))},n.custom=function(n,t,i){i===void 0&&(i={});$(n).mask(t,__assign({selectOnFocus:!1},i))},n}();t["default"]=e});define("components/discontinue-service",["require","exports","utils/date-helper","utils/mask"],function(n,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});var u=function(){function n(){}return n.init=function(){$("#PhoneNumber").length>0&&$("#Date").length>0&&(r["default"].phoneNumber("#PhoneNumber"),n.initDateLimitedDatePicker())},n.initDateLimitedDatePicker=function(){var n=i["default"].parseDateStringArray($("#Date").data("allowed-dates").toString());$(function(){$("#Date").datepicker({beforeShowDay:function(t){if(!i["default"].isDateInArray(t,n))return{enabled:!1}},format:"mm/dd/yyyy"})})},n}();t["default"]=u});define("components/payment-extension",["require","exports","utils/alerts-helper","utils/error-messages"],function(n,t,i,r){function u(){function u(){$(".optionSelection").show();$(".final-agreement-container").hide();$(".final-agreement-text.optionSelected-1").hide();$(".final-agreement-text.optionSelected-2").hide();$(".final-agreement-buttons").hide()}function f(n){$(".optionSelection").hide();$(".final-agreement-container").show();$(".final-agreement-text.optionSelected-"+n).show();$(".final-agreement-buttons").show()}function e(){$(".optionSelection").hide();$(".final-agreement-container").hide();$(".final-agreement-text.optionSelected-1").hide();$(".final-agreement-text.optionSelected-2").hide();$(".final-agreement-buttons").hide();$(".request-error").hide();$(".request-success").show()}function n(n){$(".optionSelection").hide();$(".final-agreement-container").hide();$(".final-agreement-text.optionSelected-1").hide();$(".final-agreement-text.optionSelected-2").hide();$(".final-agreement-buttons").hide();$(".request-success").hide();n!=0?i["default"].showAlert(r["default"].get(n),4):$(".request-error").show()}function o(t){t.result?e():n(t.errorMessageid)}function t(){return $("input[name=options]:checked").val()}function s(){var i=$("input[name=__RequestVerificationToken]").val(),r={chosenOption:t,__RequestVerificationToken:i};$.ajax({url:"/api/accounts/active/paymentextension",type:"PUT",data:r,success:o,error:n})}$(document).ready(function(){$("input[name=optionSelectButton]").click(function(){f(t())});$("input[name=cancelButton]").click(function(){u()});$("input[name=finalAcceptanceButton]").click(function(){s()})})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=u});define("components/typeahead",["require","exports"],function(n,t){function i(){function n(){var n=$(this),t=n.data("typeahead-page"),i=new Bloodhound({datumTokenizer:Bloodhound.tokenizers.obj.whitespace("value"),queryTokenizer:Bloodhound.tokenizers.whitespace,remote:{url:"/find_v2/_autocomplete?prefix=%QUERY&size=5",wildcard:"%QUERY",transform:function(n){return n.hits.map(function(n){return n.query})},prepare:function(n,t){return t.url=t.url.replace("%QUERY",n),t}}});n.typeahead({},{name:"search-results",source:i});n.bind("typeahead:select",function(n,i){console.log("Selection: "+i);window.location.href=t+"?q="+i+"&page=1"})}$("[data-typeahead]").each(n)}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=i});define("components/unobtrusive-forms",["require","exports"],function(n,t){function i(){$(document).on("submit","form[data-spin-onsubmit]",function(n){var i=$(n.target),t=i.data("spinOnsubmit")||{};t.effect=t.effect||"rotation";i.waitMe(t)});$(document).ajaxSuccess(function(){$.validator.unobtrusive.parse("form[data-ajax=true]")})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=i});define("utils/downloaders",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.DownloadCsv=function(n,t){var n=n+".csv",i=document.createElement("a");i.style.display="none";i.setAttribute("target","_blank");i.setAttribute("href","data:text/csv;charset=utf-8,"+encodeURIComponent(t));i.setAttribute("download",n);document.body.appendChild(i);i.click();document.body.removeChild(i)},n}();t["default"]=i});define("components/usage-history-chart",["require","exports","utils/downloaders"],function(n,t,i){function r(n){function e(t){function ft(){var t,n,u,f;if(e.length>0)for(t=Math.floor(e.length/i),n=0;n<=t;n++)u=n*i-1>=0?n*i-1:0,f=n===t?n*i+i:n*i+i-1,a.push(e.slice(u,f));else a.push([]);if(c.length>0)for(t=Math.floor(c.length/i),n=0;n<=t;n++)u=n*i-1>=0?n*i-1:0,f=n===t?n*i+i:n*i+i-1,p.push(c.slice(u,f));else p.push([]);if(h.length>0)for(t=Math.floor(h.length/i),n=0;n<=t;n++)u=n*i-1>=0?n*i-1:0,f=n===t?n*i+i:n*i+i-1,y.push(h.slice(u,f));else y.push([]);if(v.length>0)for(t=Math.floor(v.length/i),n=0;n<=t;n++)u=n*i-1>=0?n*i-1:0,f=n===t?n*i+i:n*i+i-1,b.push(v.slice(u,f));else b.push([]);w=Math.max(a.length,p.length,y.length);r=w-1}function g(){var n=f.data.datasets,u=r<a.length?a[r]:[],t=r<p.length?p[r]:[],i=r<y.length?y[r]:[];f.data.labels=r<b.length?b[r]:[];n.length>2?(n[0].data=u,n[1].data=t,n[2].data=i):(n[0].data=t,n[1].data=i);$("#chart-next").show();$("#chart-prev").show();r===w-1?$("#chart-next").hide():r===0&&$("#chart-prev").hide();r===0&&w===1&&($("#chart-next").hide(),$("#chart-prev").hide())}function tt(){var n=f.data.datasets;window.matchMedia("(min-width: 768px)").matches?(f.data.labels=v,n.length>2?(n[0].data=e,n[1].data=c,n[2].data=h):(n[0].data=c,n[1].data=h),k=!1):(k=!0,g());f.update()}function it(n,t){var i,r;if(n===0&&d.length>2){if(i=t.options.scales.yAxes.filter(function(n){return n.id==="costAxes"}),i.length===0)return;r=!i[0].gridLines.display;i[0].gridLines.display=r;i[0].scaleLabel.fontColor=r?"black":"transparent";i[0].ticks.minor&&(i[0].ticks.minor.fontColor=r?"black":"transparent");i[0].ticks.major&&(i[0].ticks.major.fontColor=r?"black":"transparent")}}var rt,f;if(!t.getAttribute("data-months")||t.getAttribute("data-months").split(",").length===0){rt=t.getAttribute("data-no-data-msg");$(t).hide();$(t).after("<strong>"+rt+"<\/strong>");$(t).parent().css("min-height","auto");return}var ut=t.getAttribute("data-chart-type"),nt=ut==="electric"?o:s,v=t.getAttribute("data-months").split(","),l=JSON.parse(t.getAttribute("data-chart-labels")),h=t.getAttribute("data-estimated-usage").split(",").map(function(n){return parseFloat(n)}),c=t.getAttribute("data-actual-usage").split(",").map(function(n){return parseFloat(n)}),et=t.getAttribute("data-cost").split(",").map(function(n){return parseFloat(n)}),ot=t.getAttribute("data-tooltip-dates").split(","),y=[],p=[],a=[],b=[],r=3,w=4,k=!1,i=6,d=[],e=et.filter(function(n){return!isNaN(n)});e.length>0&&d.push({label:l.costLabel,data:e,type:"line",borderColor:"#000",backgroundColor:"#000",fill:!1,yAxisID:"costAxes",hidden:!0});d.push({label:l.actualUsageLabel,fill:!1,spanGaps:!0,data:c,backgroundColor:nt.actualUsageColor,yAxisID:"usageKWhAxes"},{label:l.estimatedUsageLabel,fill:!1,spanGaps:!0,data:h,backgroundColor:nt.estimatedUsageColor,yAxisID:"usageKWhAxes"});f=new n(t,{type:"bar",data:{labels:v,datasets:d},options:{responsive:!0,maintainAspectRatio:!1,scales:{yAxes:[{id:"usageKWhAxes",scaleLabel:{display:!0,fontColor:"black",fontSize:14,labelString:l.usageYAxisLabel},display:"auto",position:"left",min:0,suggestedMax:Math.ceil(Math.max.apply(Math,c.concat(h))),maxTicksLimit:8,stacked:!0,ticks:{beginAtZero:!1}},{id:"costAxes",scaleLabel:{display:!0,fontColor:"transparent",fontSize:16,labelString:l.costLabel},position:"right",min:0,stacked:!0,ticks:{major:{fontColor:"transparent"},minor:{fontColor:"transparent"},beginAtZero:!1,min:0,suggestedMax:Math.ceil(Math.max.apply(Math,e)),maxTicksLimit:8,callback:function(n){return"$"+n}},gridLines:{display:!1,drawOnChartArea:!1},animation:!1}],xAxes:[{barPercentage:1,stacked:!0,categoryPercentage:.95,maxBarThickness:80,gridLines:{display:!1}}]},legend:{display:u,position:"bottom",reverse:!0,onClick:function(n,t){var r=t.datasetIndex,i=this.chart,u=i.getDatasetMeta(r);it(r,i);u.hidden=u.hidden===null?!i.data.datasets[r].hidden:null;i.update()}},tooltips:{position:"average",backgroundColor:"#ffffff",titleFontColor:"#010101",titleFontFamily:"'MyriadPro', Arial, Helvetica, sans-serif",titleFontSize:18,bodyFontColor:nt.actualUsageColor,bodyFontFamily:"'MyriadPro', Arial, Helvetica, sans-serif",bodyFontSize:18,bodyFontStyle:"bold",footerFontColor:"#010101",footerFontFamily:"'MyriadPro', Arial, Helvetica, sans-serif",footerFontSize:16,footerFontStyle:"normal",borderColor:"#cfcfcf",borderWidth:2,xPadding:12,yPadding:12,callbacks:{title:function(n,t){var i=n[0],r=t.datasets[i.datasetIndex].data[i.index];return t.datasets[i.datasetIndex].label!=l.costLabel?r.toLocaleString()+" "+(ut.toLocaleLowerCase()==="electric"?"kWh":"Ccf"):""},label:function(){return""},afterBody:function(n){var u=n[0],i=u.index,t="";return k?t=a[r][i].toFixed(2).toLocaleString("en-US","USD"):e.length>0&&(t=e[i].toLocaleString("en-US",{style:"currency",currency:"USD"})),t},footer:function(n){var t=n[0],u=t.index;return k&&r>0&&(u=i*r+t.index-1),ot[u]}}}}});ft();$("#chart-next").on("click keydown",function(n){(n.type==="click"||n.keyCode===13)&&(n.preventDefault(),r+1<w&&r++,g(),f.update())});$("#chart-prev").on("click keydown",function(n){(n.type==="click"||n.keyCode===13)&&(n.preventDefault(),r-1>=0&&r--,g(),f.update())});$(".custom-legend-checkbox").change(function(){var n=parseInt($(this).attr("data-dataset"));f.getDatasetMeta(n).hidden=$(this).is(":checked")?!1:!0;$(".custom-legend-checkbox[data-dataset*='"+n+"']").prop("checked",$(this).is(":checked"));n==0&&it(0,f);f.update()});t.getAttribute("data-paging")=="true"&&(tt(),window.addEventListener("resize",tt))}var r=".usage-history-chart",t=".usage-overview-chart",u=!1;if(!($(r).length<=0)||!($(t).length<=0)){$(t).length>0&&(u=!0);$(".usage-export").on("click keydown",function(n){var t,f,e,r,u,h;if(n.type==="click"||n.keyCode===13){n.preventDefault();var c=document.querySelectorAll(".active table.data-table tr"),o=[],s=[];for(s.push('"'+$(".data-table").data("csvtitle")+'"'),s.push('"'+$(".account-chooser_number")[0].innerText+'"'),o.push(s),t=0;t<c.length;t++){for(f=[],e=c[t].querySelectorAll("td, th"),r=0;r<e.length;r++)u=e[r].innerText.replace(/(\r\n|\n|\r)/gm,"").replace(/(\s\s)/gm," "),u=u.replace(/"/g,'""'),f.push('"'+u+'"');o.push(f.join(","))}h=o.join("\n");i["default"].DownloadCsv("usage_"+(new Date).toLocaleDateString(),h)}});var o={actualUsageColor:"#43763B",estimatedUsageColor:"#98A88B"},s={actualUsageColor:"#13206F",estimatedUsageColor:"#AAA6BF"},h=$(r+", "+t),f=$(".tab-pane:not('.active')");f.addClass("active");h.each(function(n,t){return e(t)});f.removeClass("active")}}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=r});define("components/natural-gas-availability",["require","exports","utils/mask"],function(n,t,i){function u(){r()}function r(){function n(){$("input[name=SearchType]:checked").val()=="Address"?($(".account-search").addClass("d-none"),$(".address-search").removeClass("d-none")):($(".address-search").addClass("d-none"),$(".account-search").removeClass("d-none"))}window.scrollTo(0,0);$.applyDataMask();i["default"].ssNumber();i["default"].phoneNumber();i["default"].accountNumber();$("#SearchTypeAccount").on("change",n);$("#SearchTypeAddress").on("change",n);n()}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=u;t.initForm=r});define("services/accounts-service",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){this.csrf="";this.baseUrl="";this.baseUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+"/api/accounts/";this.csrf=$('[name="__RequestVerificationToken"]').last().val().toString()}return n.prototype.getCurrentAccounts=function(n,t){t===void 0&&(t=null);$.ajax({url:this.baseUrl+"current",type:"GET",dataType:"json",data:{},success:function(t){t?n(t):n([])},error:function(n,i,r){console.error("Error retrieving accounts: ");console.error(r);t&&t()}})},n.prototype.getAccountByAccountNumber=function(n,t,i){i===void 0&&(i=null);var r={accountNumber:n.value,zipCode:n.zipcode.trim()};this.getAccounts(r,this.baseUrl+"search/number",t,i)},n.prototype.getAccountByPhoneNumber=function(n,t,i){i===void 0&&(i=null);var r={phoneNumber:n.value,zipCode:n.zipcode.trim()};this.getAccounts(r,this.baseUrl+"search/phone",t,i)},n.prototype.getAccountByEmail=function(n,t,i){i===void 0&&(i=null);var r={email:n.value,zipCode:n.zipcode.trim()};this.getAccounts(r,this.baseUrl+"search/email",t,i)},n.prototype.getAccountByMeter=function(n,t,i){i===void 0&&(i=null);var r={meterNumber:n};this.getAccounts(r,this.baseUrl+"search/meter",t,i)},n.prototype.getAccountByAddress=function(n,t,i,r,u){u===void 0&&(u=null);var f={prefix:n,street:t,zipCode:i};this.getAccounts(f,this.baseUrl+"search/address",r,u)},n.prototype.getAccounts=function(n,t,i,r){r===void 0&&(r=null);$.ajax({url:t,type:"POST",dataType:"json",data:__assign({__RequestVerificationToken:this.csrf},n),success:function(n){n.result?i(n.accounts):i([])},error:function(n,t,i){console.error("Error retrieving accounts: ");console.error(i);r&&r()}})},n.prototype.getActiveAccount=function(n){$.ajax({url:this.baseUrl+"active/accountchooser",type:"GET",dataType:"json",data:{},success:function(t){t&&n(t)},error:function(n,t,i){console.error("Error retrieving active accounts: ");console.error(i)}})},n.prototype.updateActiveAccount=function(n,t,i){i===void 0&&(i=null);$.ajax({url:this.baseUrl+"active/update",type:"PUT",dataType:"json",data:{__RequestVerificationToken:this.csrf,accountNumber:n.accountNumber},success:function(r){r.result?t(n):i(r)},error:function(n,t,r){console.error("Error retrieving accounts: ");console.error(r);i&&i({result:!1,errorMessageId:5})}})},n}();t["default"]=i});define("components/start-service",["require","exports","utils/mask","utils/date-helper"],function(n,t,i,r){function f(){u()}function u(){function o(){$("#ResidingAs").val()==="Rent"?$(".renting").removeClass("d-none"):$(".renting").addClass("d-none")}function n(){$("input[name=MailingAddressChoice]:checked").val()=="DifferentThanServiceAddress"?($("input.mailing-address-input").prop("readonly",!1),$("select.mailing-address-input").prop("disabled",!1),$(".mailing-address-container").removeClass("d-none")):($(".mailing-address-container").addClass("d-none"),$("input.mailing-address-input").prop("readonly",!0),$("select.mailing-address-input").prop("disabled",!0))}function s(){$("#EmploymentStatusChoice").val()==="Employed"?$(".employed").removeClass("d-none"):$(".employed").addClass("d-none")}function h(){$("#LiveAloneChoice").val()==="DoesNotLiveAlone"?$(".co-tenant").removeClass("d-none"):$(".co-tenant").addClass("d-none")}function c(){$("#AuthorizedPartyChoice").val()==="HasAuthorizedParty"?$(".authorized-party").removeClass("d-none"):$(".authorized-party").addClass("d-none")}function t(){$("input[name=SearchType]:checked").val()=="Address"?($(".meter-search").addClass("d-none"),$(".address-search").removeClass("d-none")):($(".address-search").addClass("d-none"),$(".meter-search").removeClass("d-none"))}function u(){$("input[name=StopServiceChoice]:checked").val()=="StoppingService"?($(".stop-service-container").removeClass("d-none"),$(".no-stop-service-container").addClass("d-none")):($(".stop-service-container").addClass("d-none"),$(".no-stop-service-container").removeClass("d-none"))}var l,f,a,e;window.scrollTo(0,0);f=$("#DateOfStart").data("allowed-dates");f&&(l=r["default"].parseDateStringArray(f.toString()));e=$("#DateOfStop").data("allowed-dates");e&&(a=r["default"].parseDateStringArray(e.toString()));$.applyDataMask();i["default"].ssNumber();i["default"].phoneNumber();$(".datepicker").datepicker({format:"mm/dd/yyyy"});$("#DateOfStart").datepicker({beforeShowDay:function(n){if(!r["default"].isDateInArray(n,l))return{enabled:!1}},format:"mm/dd/yyyy"});$("#DateOfStop").datepicker({beforeShowDay:function(n){if(!r["default"].isDateInArray(n,a))return{enabled:!1}},format:"mm/dd/yyyy"});$("#ResidingAs").on("change",o);$("#MailingAddressChoiceSame").on("change",n);$("#MailingAddressChoiceDifferent").on("change",n);$("#EmploymentStatusChoice").on("change",s);$("#LiveAloneChoice").on("change",h);$("#AuthorizedPartyChoice").on("change",c);$("#SearchTypeMeter").on("change",t);$("#SearchTypeAddress").on("change",t);$("#IsStoppingService").on("change",u);$("#IsNotStoppingService").on("change",u);o();n();s();h();c();t();u()}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=f;t.initForm=u});define("components/webchat",["require","exports"],function(n,t){function i(){$(function(){var n=!1;$.ajax({url:"/api/webchat/availability",dataType:"json",success:function(t){t&&(n=t.IsAvailable,n||($("#webchatbutton").toggleClass("webchat_button-offline webchat_button-online"),$("#webchatIcon").toggleClass("fa-comment-slash fa-comment")),$(".webchat_button-div").show())},error:function(){$("#webchatbutton").toggleClass("webchat_button-offline webchat_button-online");$("#webchatIcon").toggleClass("fa-comment-slash fa-comment");$(".webchat_button-div").show()}});$("#webchatbutton").click(function(){n==!0?window.open(this.getAttribute("data-chat")+"?varUserRequest=REQ_WEBCHAT_MAIN&varUserLanguage=english&varBusinessUnitName=DEFAULT","WebChat","width=830,height=565,toolbar=no,resizable=1,scrollbars=1"):window.location.href=this.getAttribute("data-nochat")})})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=i});define("components/add-first-account",["require","exports","utils/query-string"],function(n,t,i){function r(){if($(".add-first-account").length>0)$("button.associate-account").on("click keydown",function(n){var t,u,r;(n.keyCode===13||n.type==="click")&&(n.preventDefault(),t=!0,$(".add-first-account").waitMe({effect:"rotation"}),u=$('[name="__RequestVerificationToken"]').last().val().toString(),r=$(".add-first-account_option:checked"),$.each(r,function(n,f){var e=$(f).data("id");$.ajax({url:"/api/users/associate",type:"POST",dataType:"json",data:{__RequestVerificationToken:u,accountNumber:e},success:function(){},error:function(n,i,r){console.error("Error associating account: ");console.error(r);t=!1},complete:function(){if(n===r.length-1&&t){var u=i["default"].GetQueryString("target");u=u!=null?u:window.location.protocol+"//"+window.location.host;window.location.href=u}}})}))});$(".add-first-account_option").change(function(){var n=$(".add-first-account_option:checked").length;n==0?$("button.associate-account").prop("disabled",!0):$("button.associate-account").prop("disabled",!1)})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=r});define("components/tabs",["require","exports"],function(n,t){function i(){$(".nav-item.dropdown").on("click",".dropdown-item",function(n){var t=$(n.target).text();$($(n.target).parent(".dropdown-menu").prev(".dropdown-toggle")).text(t)})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=i});define("components/forgot-email",["require","exports","utils/mask"],function(n,t,i){function r(){$(".forgot-email").on("click","#RecoveryTypeAccountNum",function(){$(".forgot-email__user-id").addClass("d-none");$(".forgot-email__account-number").removeClass("d-none")});$(".forgot-email").on("click","#RecoveryTypeUserId",function(){$(".forgot-email__user-id").removeClass("d-none");$(".forgot-email__account-number").addClass("d-none")});$(function(){$(".forgot-email .forgot-email__radio-choices [checked]").click();i["default"].accountNumber()})}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=r});define("components/epi-forms",["require","exports","utils/mask"],function(n,t,i){function r(){function n(n){i["default"].phoneNumber();i["default"].accountNumber();i["default"].ssNumber();$(".datepicker").datepicker({format:"mm/dd/yyyy"});var t=$(".FormRecaptcha",n);$.each(t,function(n,t){var i=$(t).data("epiforms-recaptcha-widgetid");i!=undefined&&grecaptcha&&grecaptcha.reset(i)})}if(typeof epi!="undefined"&&typeof epi.EPiServer!="undefined"){typeof $$epiforms!="undefined"&&$$epiforms(document).ready(function(){$$epiforms(".EPiServerForms").on("formsStepValidating",function(n){if(n.isValid==!0){$(".signature input").length>0&&!$(".signature input").val().toString().startsWith("/s/")&&$(".signature input").val("/s/"+$(".signature input").val().toString());return}})});$(".EPiServerForms").on("formsReset formsNavigationPrevStep",function(t){n(t.target)});$(".EPiServerForms").on("formsStepValidating",function(t){t.isValid!=!0&&n(t.target)});$(".EPiServerForms").on("formsSubmitted",function(t){t.returnedResult&&t.returnedResult.IsSuccess||n(t.target)});$.extend(!0,epi.EPiServer.Forms,{Validators:{"CenHud.Web.Business.Validator.RecaptchaValidator":function(n,t,i){return t?{isValid:!0}:{isValid:!1,message:i.model.message}},"CenHud.Web.Business.Validator.AccountNumberValidator":function(n,t,i){return t.length!==0&&t.length!==12?{isValid:!1,message:i.model.message}:{isValid:!0}},"CenHud.Web.Business.Validator.PhoneNumberValidator":function(n,t,i){return t.length===0?{isValid:!0}:/^\(?(?!0{3})[0-9]{3}\)?[-. ]?[0-9]{3}[-. ]?[0-9]{4}$/.test(t)?{isValid:!0}:{isValid:!1,message:i.model.message}}},Extension:{getCustomElementValue:function(n){if(n.hasClass("FormRecaptcha")){var t=n.data("epiforms-recaptcha-widgetid");return t!=undefined&&grecaptcha?grecaptcha.getResponse(t):null}}}});window.initRecaptchaElements=function(){(function(n){function t(n){return function(){return function(t){t&&t.length!=0&&n.find(".Form__Element__ValidationError").hide()}}()}n(".Form__Element.FormRecaptcha").each(function(i,r){var u=n(r),f=n(".g-recaptcha",u),e=u.data("epiforms-sitekey"),o;f.length==1&&e&&(o=grecaptcha.render(f[0],{sitekey:e,callback:t(u)}),u.data("epiforms-recaptcha-widgetid",o))})})($$epiforms||$)}}}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=r});define("utils/responsive-table",["require","exports"],function(n,t){function i(){for(var r,t,i,n,f=$(".responsive-table"),u=0;u<f.length;u++){for(r=[],t=f[u],n=0;n<t.rows[0].cells.length;n++)r.push(t.rows[0].cells[n].innerHTML);for(i=1;i<t.rows.length;i++)for(n=0;n<t.rows[i].cells.length;n++)n<r.length&&(t.rows[i].cells[n].hasAttribute("data-label")||t.rows[i].cells[n].setAttribute("data-label",r[n]))}}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=i});define("cenhud",["require","exports","components/account-chooser","components/alerts","components/bill-breakdown-chart","components/bill-comparison-chart","components/budget-billing","components/budget-billing-details","components/ebills","components/enablement-links","components/flyout","components/header-block","components/password-validator","components/page-adjustments","components/meter-reading-form","components/modal","components/discontinue-service","components/payment-extension","components/typeahead","components/unobtrusive-forms","components/usage-history-chart","components/natural-gas-availability","components/start-service","components/webchat","utils/mask","components/add-first-account","components/tabs","components/forgot-email","components/epi-forms","utils/responsive-table"],function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y,p,w,b,k,d,g,nt,tt,it,rt,ut,ft,et,ot,st){function ht(){r["default"]();s["default"]();h["default"]();c["default"].init();l["default"]();e["default"]();i["default"]();a["default"]();y["default"]();p["default"]();o["default"]();v["default"]();d["default"]();k["default"]();w["default"].init();tt["default"]();nt["default"]();ut["default"]();ft["default"]();et["default"]();ot["default"]();it["default"]();st["default"]()}function ct(n){f["default"](n);u["default"](n);g["default"](n)}function lt(){b["default"]()}function at(){rt["default"].phoneNumber();rt["default"].accountNumber();rt["default"].ssNumber();$.applyDataMask()}function vt(){w["default"].initDateLimitedDatePicker()}Object.defineProperty(t,"__esModule",{value:!0});t.main=ht;t.initCharts=ct;t.initPaymentExtension=lt;t.initForms=at;t.initDateLimitedDatePicker=vt});define("apps/utils/event-bus",["require","exports","vue-property-decorator"],function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r=new i.Vue;t["default"]=r});define("utils/form-validator",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.validateEmail=function(n){return n.length===0?!1:/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(n)},n.validatePhoneNumber=function(n){return n.length===0?!1:(n=n.replace(/[-\s]/,""),/\d{10,11}/.test(n))},n.validateAccountNumber=function(n){return n.length!==10?!1:/\d{10}/.test(n)},n.validateAccountNumberWithChecksum=function(n){return n.length!==11?!1:/\d{11}/.test(n)},n.validateZipCode=function(n){return n.length<5?!1:/\d+/.test(n)},n}();t["default"]=i});define("apps/components/find-account-inputs/phone-number-form",["require","exports","vue-property-decorator","utils/form-validator","utils/mask","apps/utils/event-bus"],function(n,t,i,r,u,f){Object.defineProperty(t,"__esModule",{value:!0});var e=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t.currentValue="",t.zipCodeValue="",t.hasUserSubmitted=!1,t}return __extends(t,n),Object.defineProperty(t.prototype,"rawValue",{get:function(){return u["default"].getRawValue(this.currentValue)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isValid",{get:function(){return r["default"].validatePhoneNumber(this.rawValue)&&r["default"].validateZipCode(this.zipCodeValue)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showPhoneNumberError",{get:function(){return!r["default"].validatePhoneNumber(this.rawValue)&&this.hasUserSubmitted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showZipCodeError",{get:function(){return!r["default"].validateZipCode(this.zipCodeValue)&&this.hasUserSubmitted},enumerable:!0,configurable:!0}),t.prototype.mounted=function(){u["default"].phoneNumber("#phoneNumber")},t.prototype.maskPhoneNumber=function(){this.currentValue=$("#phoneNumber").masked(this.rawValue)},t.prototype.submitForm=function(){this.isValid?f["default"].$emit("submit-form",{value:this.rawValue,zipcode:this.zipCodeValue}):this.hasUserSubmitted=!0},__decorate([i.Prop(Object)],t.prototype,"inputLabels",void 0),__decorate([i.Prop(Object)],t.prototype,"zipcodeLabels",void 0),__decorate([i.Prop(String)],t.prototype,"buttonLabel",void 0),__decorate([i.Component({template:'\n        <form action="#" method="post" @submit.prevent="submitForm">\n            <label for="phoneNumber" class="required">{{ inputLabels.label }}<\/label>\n            <input type="tel"\n                id="phoneNumber"\n                :class="{\n                    \'mb-1\': inputLabels.helpText && inputLabels.helpText.length > 0,\n                    \'input--error\': showPhoneNumberError\n                }"\n                name="phoneNumber"\n                role="textbox"\n                @input="maskPhoneNumber"\n                :placeholder="inputLabels.placeholder"\n                :aria-label="inputLabels.label"\n                v-model="currentValue"\n                :aria-valuenow="currentValue"\n                :aria-valuetext="currentValue"\n                maxlength="11"\n                required />\n            <p v-if="inputLabels.helpText" class="form__help-text mb-0">{{ inputLabels.helpText }}<\/p>\n            <p v-if="inputLabels.requiredErrorLabel" v-show="showPhoneNumberError" class="form__error mt-0 mb-0">{{ inputLabels.requiredErrorLabel }}<\/p>\n            <label for="zipCode" class="mt-3 required">{{ zipcodeLabels.label  }}<\/label>\n            <input type="text"\n                id="zipCode"\n                :class="{\n                    \'mb-1\': zipcodeLabels.helpText && zipcodeLabels.helpText.length > 0,\n                    \'input--error\': showZipCodeError\n                }"\n                name="zipCode"\n                value=""\n                role="textbox"\n                :placeholder="zipcodeLabels.placeholder"\n                :aria-label="zipcodeLabels.label"\n                v-model="zipCodeValue"\n                @input="maskPhoneNumber"\n                :title="zipcodeLabels.helpText ? zipcodeLabels.helpText : \'Please enter a 5 digit zip code\'"\n                pattern="[0-9]{5}"\n                maxlength="5"\n                required />\n            <p v-if="zipcodeLabels.helpText" class="form__help-text mb-0">{{ zipcodeLabels.helpText }}<\/p>\n            <p v-if="zipcodeLabels.requiredErrorLabel" v-show="showZipCodeError" class="form__error mt-0">{{ zipcodeLabels.requiredErrorLabel }}<\/p>\n            <button type="submit" class="button button--default mt-4" :class="{ \'disabled\' : !isValid }">\n                {{ buttonLabel }}\n            <\/button>\n        <\/form>\n    '})],t)}(i.Vue);t["default"]=e});define("apps/components/find-account-inputs/email-form",["require","exports","vue-property-decorator","utils/form-validator","apps/utils/event-bus"],function(n,t,i,r,u){Object.defineProperty(t,"__esModule",{value:!0});var f=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t.currentValue="",t.zipCodeValue="",t.hasUserSubmitted=!1,t}return __extends(t,n),Object.defineProperty(t.prototype,"isValid",{get:function(){return r["default"].validateEmail(this.currentValue)&&r["default"].validateZipCode(this.zipCodeValue)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showEmailError",{get:function(){return!r["default"].validateEmail(this.currentValue)&&this.hasUserSubmitted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showZipCodeError",{get:function(){return!r["default"].validateZipCode(this.zipCodeValue)&&this.hasUserSubmitted},enumerable:!0,configurable:!0}),t.prototype.mounted=function(){$.applyDataMask()},t.prototype.submitForm=function(){this.isValid?u["default"].$emit("submit-form",{value:this.currentValue,zipcode:this.zipCodeValue}):this.hasUserSubmitted=!0},__decorate([i.Prop(Object)],t.prototype,"inputLabels",void 0),__decorate([i.Prop(Object)],t.prototype,"zipcodeLabels",void 0),__decorate([i.Prop(String)],t.prototype,"buttonLabel",void 0),__decorate([i.Component({template:'\n        <form action="#" method="post" @submit.prevent="submitForm">\n            <label for="email" class="required">{{ inputLabels.label }}<\/label>\n            <input type="email"\n                id="email"\n                :class="{\n                    \'mb-1\': inputLabels.helpText && inputLabels.helpText.length > 0,\n                    \'input-error\': showEmailError\n                }"\n                name="email"\n                value=""\n                :placeholder="inputLabels.placeholder"\n                :aria-label="inputLabels.label"\n                v-model="currentValue"\n                maxlength="320"\n                required />\n            <p v-if="inputLabels.helpText" class="form__help-text mb-0">{{ inputLabels.helpText }}<\/p>\n            <p v-if="inputLabels.requiredErrorLabel" v-show="showEmailError" class="form__error mt-0 mb-0">{{ inputLabels.requiredErrorLabel }}<\/p>\n            <label for="zipCode" class="required mt-3">{{ zipcodeLabels.label }}<\/label>\n            <input type="text"\n                :class="{\n                    \'mb-1\': zipcodeLabels.helpText && zipcodeLabels.helpText.length > 0,\n                    \'input--error\': showZipCodeError\n                }"\n                name="zipCode"\n                value=""\n                :placeholder="zipcodeLabels.placeholder"\n                :aria-label="zipcodeLabels.label"\n                v-model="zipCodeValue"\n                pattern="[0-9]{5}"\n                :title="zipcodeLabels.helpText ? zipcodeLabels.helpText : \'Please enter a 5 digit zip code\'"\n                maxlength="5"\n                data_mask = "00000" \n                required />\n            <p v-if="zipcodeLabels.helpText" class="form__help-text mb-0">{{ zipcodeLabels.helpText }}<\/p>\n            <p v-if="zipcodeLabels.requiredErrorLabel" v-show="showZipCodeError" class="form__error mt-0">{{ zipcodeLabels.requiredErrorLabel }}<\/p>\n            \n            <button type="submit" class="button button--default mt-4" :class="{ \'disabled\' : !isValid }">\n                {{ buttonLabel }}\n            <\/button>\n        <\/form>\n    '})],t)}(i.Vue);t["default"]=f});define("apps/components/find-account-inputs/account-number-form",["require","exports","vue-property-decorator","utils/form-validator","utils/mask","apps/utils/event-bus"],function(n,t,i,r,u,f){Object.defineProperty(t,"__esModule",{value:!0});var e=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t.currentValue="",t.zipCodeValue="",t.hasUserSubmitted=!1,t}return __extends(t,n),Object.defineProperty(t.prototype,"rawValue",{get:function(){return u["default"].getRawValue(this.currentValue)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isValid",{get:function(){return r["default"].validateAccountNumber(this.rawValue)&&r["default"].validateZipCode(this.zipCodeValue)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showAccountNumberError",{get:function(){return!r["default"].validateAccountNumber(this.rawValue)&&this.hasUserSubmitted},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"showZipCodeError",{get:function(){return!r["default"].validateZipCode(this.zipCodeValue)&&this.hasUserSubmitted},enumerable:!0,configurable:!0}),t.prototype.mounted=function(){u["default"].accountNumber("#accountNumber-find");$.applyDataMask()},t.prototype.maskAccountNumber=function(){this.currentValue=$("#accountNumber-find").masked(this.rawValue)},t.prototype.submitForm=function(){this.isValid?f["default"].$emit("submit-form",{value:this.rawValue,zipcode:this.zipCodeValue}):this.hasUserSubmitted=!0},__decorate([i.Prop(Object)],t.prototype,"inputLabels",void 0),__decorate([i.Prop(Object)],t.prototype,"zipcodeLabels",void 0),__decorate([i.Prop(String)],t.prototype,"buttonLabel",void 0),__decorate([i.Component({template:'\n        <form action="#" method="post" @submit.prevent="submitForm">\n            <label for="accountNumber-find" class="required">{{ inputLabels.label }}<\/label>\n            <input type="text"\n                id="accountNumber-find"\n                :class="{ \n                    \'mb-1\': inputLabels.helpText && inputLabels.helpText.length > 0,\n                    \'input--error\': showAccountNumberError\n                }"\n                name="accountNumber-find"\n                value=""\n                @input="maskAccountNumber"\n                :placeholder="inputLabels.placeholder"\n                :aria-label="inputLabels.label"\n                :aria-valuenow="currentValue"\n                :aria-valuetext="currentValue"\n                v-model="currentValue"\n                required />\n            <p v-if="inputLabels.helpText" class="form__help-text mb-0">{{ inputLabels.helpText }}<\/p>\n            <p v-if="inputLabels.requiredErrorLabel" v-show="showAccountNumberError" class="form__error mt-0 mb-0">{{ inputLabels.requiredErrorLabel }}<\/p>\n            <label for="zipCode" class="mt-3 required">{{ zipcodeLabels.label }}<\/label>\n            <input type="text" \n                id="zipCode"\n                :class="{ \n                    \'mb-1\': zipcodeLabels.helpText && zipcodeLabels.helpText.length > 0,\n                    \'input--error\': showZipCodeError\n                }"\n                name="zipCode" \n                value=""\n                :placeholder="zipcodeLabels.placeholder"\n                :aria-label="zipcodeLabels.label"\n                @input="maskAccountNumber"\n                v-model="zipCodeValue"\n                data_mask = "00000"\n                pattern="[0-9]{5}"\n                :title="zipcodeLabels.helpText ? zipcodeLabels.helpText : \'Please enter a 5 digit zip code\'"\n                maxlength="5"\n                required />\n            <p v-if="zipcodeLabels.helpText" class="form__help-text mb-0">{{ zipcodeLabels.helpText }}<\/p>\n            <p v-if="zipcodeLabels.requiredErrorLabel" v-show="showZipCodeError" class="form__error mt-0">{{ zipcodeLabels.requiredErrorLabel }}<\/p>\n            <button type="submit" class="button button--default mt-4" :class="{ \'disabled\' : !isValid }">\n                {{ buttonLabel }}\n            <\/button>\n        <\/form>\n    '})],t)}(i.Vue);t["default"]=e});define("components/login",["require","exports"],function(n,t){function i(n,t,i){var u={baseUrl:i.domain,clientId:i.clientId,redirectUri:i.clientRedirectLink,authParams:{issuer:i.authority,responseType:"code",responseMode:"form_post",display:"page",scopes:["openid","email","profile","phone","accounts","payments"],state:t},features:{registration:i.allowRegistration,showPasswordToggleOnSignInPage:!0},logo:i.logoLink,language:"en",helpLinks:{help:i.helpLink.link,custom:[{text:i.forgotEmailLink.title,href:i.forgotEmailLink.link}]},i18n:{en:{remember:i.rememberMeLabel,needhelp:i.needHelpHeader,goback:"Back to Sign In",help:i.helpLink.title,retry:"Retry",forgotpassword:i.forgotPasswordLinkText,"oform.errorbanner.title":"We found some errors. Please review the form and make corrections.","error.username.required":i.emailInput.requiredErrorLabel,"error.password.required":i.passwordInput.requiredErrorLabel,"error.auth.lockedOut":i.userLockedMsg,"errors.E0000004":i.invalidLoginMsg,"errors.E0000069":i.userLockedMsg,"errors.E0000119":i.userLockedMsg,"errors.E0000047":"You exceeded the maximum number of requests. Try again in a while.","errors.E0000017":"Password reset failed","primaryauth.title":i.signInTitle,"primaryauth.username.placeholder":i.emailInput.label,"primaryauth.username.tooltip":i.emailInput.placeholder,"primaryauth.password.placeholder":i.passwordInput.label,"primaryauth.password.tooltip":i.passwordInput.placeholder,"primaryauth.submit":i.loginButtonText,"password.forgot.email.or.username.placeholder":i.emailInput.label,"password.forgot.email.or.username.tooltip":i.emailInput.placeholder,"password.forgot.sendEmail":"Reset via Email","password.forgot.emailSent.title":"Email sent!","password.forgot.emailSent.desc":"Email has been sent to {0} with instructions on resetting your password.","password.forgot.question.title":"Answer Forgotten Password Challenge","password.forgot.question.submit":"Reset Password","registration.signup.label":i.newMemberLabel,"registration.signup.text":i.registerLinkText,"registration.complete.title":"Verification email sent","registration.complete.desc":"We just sent a verification email to {0}. Please check your email and verify your account to continue.","registration.form.title":"Create Account","registration.form.submit":"Register","registration.passwordComplexity.minLength":"At least {0} character(s)","registration.passwordComplexity.minLower":"At least {0} lowercase letter(s)","registration.passwordComplexity.minUpper":"At least {0} uppercase letter(s)","registration.passwordComplexity.minNumber":"At least {0} number(s)","registration.passwordComplexity.minSymbol":"At least {0} symbol(s)","registration.passwordComplexity.excludeUsername":"Does not contain part of username","registration.passwordComplexity.excludeAttribute":"Does not contain '{0}'","registration.required.fields.label":"* indicates required field","registration.default.callbackhook.error":"We could not process your registration at this time. Please try again later.","registration.error.userName.invalidEmail":i.emailInput.notValidErrorLabel,"registration.error.password.passwordRequirementsNotMet":i.passwordInput.notValidErrorLabel,"registration.error.userName.notUniqueWithinOrg":"An account with that email already exists"}}},r=new OktaSignIn(u);return r.authClient.session.exists().then(function(u){if(u){var f=new OktaAuth({url:i.domain,issuer:i.authority});f.token.getWithRedirect({display:"page",clientId:i.clientId,responseType:"code",responseMode:"form_post",scopes:["openid","email","profile","accounts","payments"],redirectUri:i.clientRedirectLink,state:t})}else r.renderEl({el:n},function(){})}),r}Object.defineProperty(t,"__esModule",{value:!0});t["default"]=i});define("apps/components/find-account-inputs/login-form",["require","exports","vue-property-decorator","components/login"],function(n,t,i,r){Object.defineProperty(t,"__esModule",{value:!0});var u=function(n){function t(){return n!==null&&n.apply(this,arguments)||this}return __extends(t,n),t.prototype.mounted=function(){this.widget=r["default"]("#find-account-widget-container",window.location.pathname+window.location.hash,this.loginOptions)},t.prototype.destroyed=function(){this.widget.remove()},__decorate([i.Prop(Object)],t.prototype,"loginOptions",void 0),__decorate([i.Prop(String)],t.prototype,"loginIntroText",void 0),__decorate([i.Component({template:'\n        <div class="find-account_login-container">\n            <p>{{ loginIntroText }}<\/p>\n            <div id="find-account-widget-container"><\/div>\n        <\/div>\n    '})],t)}(i.Vue);t["default"]=u});define("apps/components/account-listing",["require","exports","vue-property-decorator"],function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t.selectedIndex=0,t}return __extends(t,n),t.prototype.mounted=function(){this.selectedIndex=0;$("#account0").focus();$(".tabs__content").waitMe("hide")},t.prototype.submitForm=function(){return this.accounts[this.selectedIndex]},__decorate([i.Prop(String)],t.prototype,"chooseAccountPrompt",void 0),__decorate([i.Prop(Array)],t.prototype,"accounts",void 0),__decorate([i.Emit("account-selected")],t.prototype,"submitForm",null),__decorate([i.Component({template:'\n        <div>\n            <form action="#" method="post" @submit.prevent="submitForm">\n                <h3> {{ chooseAccountPrompt }} <\/h3>\n                <ul class="d-flex flex-column list-reset">\n                    <li v-for="(account, index) in accounts" :key="\'account\' + index" class="d-inline-block">\n                        <label class="d-flex flex-row align-items-center align-content-center radio-label" :for="\'account\' + index">\n                            <input name="account" type="radio" class="d-inline-block mb-0 flex-shrink-1" :id="\'account\' + index" :value="index" v-model="selectedIndex" />\n                            <span class="text-uppercase flex-grow-1 flex-shrink-1">{{ account.address }}<\/span>\n                        <\/label>\n                    <\/li>\n                <\/ul>\n                <button type="submit" class="button button--default">Submit<\/button>\n            <\/form>\n        <\/div>\n    '})],t)}(i.Vue);t["default"]=r});define("apps/components/find-account",["require","exports","vue-property-decorator","apps/utils/event-bus","apps/components/find-account-inputs/phone-number-form","apps/components/find-account-inputs/email-form","apps/components/find-account-inputs/account-number-form","apps/components/find-account-inputs/login-form","apps/components/account-listing","services/accounts-service"],function(n,t,i,r,u,f,e,o,s,h){Object.defineProperty(t,"__esModule",{value:!0});var c=function(n){function t(){var t=n.call(this)||this;return t.totalAccountsFound=-1,t.foundAccounts=null,t.selectedTab=t.options.displayLogin?"login":"phoneNumber",t.errorMessage="",t.accountsService=new h["default"],t}return __extends(t,n),t.prototype.created=function(){r["default"].$on("submit-form",this.retrieveAccounts)},t.prototype.destroyed=function(){r["default"].$off("submit-form",this.retrieveAccounts)},Object.defineProperty(t.prototype,"currentTab",{get:function(){switch(this.selectedTab){case"email":return"EmailForm";case"accountNumber":return"AccountNumberForm";case"login":return"LoginForm";case"phoneNumber":default:return"PhoneNumberForm"}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isComponentAFindAccountInput",{get:function(){return this.selectedTab==="email"||this.selectedTab==="accountNumber"||this.selectedTab==="phoneNumber"||this.selectedTab==="login"},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"inputLabels",{get:function(){switch(this.selectedTab){case"phoneNumber":return this.options.phoneNumberInputLabels;case"email":return this.options.emailInputLabels;case"login":return this.options.loginInputLabels;case"accountNumber":return this.options.accountNumberInputLabels}},enumerable:!0,configurable:!0}),t.prototype.switchTab=function(n){this.selectedTab=n;this.totalAccountsFound=-1;$(".tabs__content").waitMe("hide")},t.prototype.retrieveAccounts=function(n){var i=n.value,r=n.zipcode,t={value:i,zipcode:r};$(".tabs__content").waitMe({effect:"rotation"});switch(this.selectedTab){case"phoneNumber":this.accountsService.getAccountByPhoneNumber(t,this.onSearchCompleted,this.onSearchError);break;case"email":this.accountsService.getAccountByEmail(t,this.onSearchCompleted,this.onSearchError);break;case"accountNumber":this.accountsService.getAccountByAccountNumber(t,this.onSearchCompleted,this.onSearchError)}},t.prototype.handleAccountSelected=function(n){return n},t.prototype.onSearchCompleted=function(n){return this.foundAccounts=n,this.totalAccountsFound=this.foundAccounts.length,this.totalAccountsFound===1&&(this.handleAccountSelected(this.foundAccounts[0]),$(".tabs__content").waitMe("hide")),this.totalAccountsFound===0&&$(".tabs__content").waitMe("hide"),n},t.prototype.onLoginSuccess=function(){$(".tabs__content").waitMe("hide");location.reload()},t.prototype.onSearchError=function(){return $(".tabs__content").waitMe("hide"),this.foundAccounts=null,this.totalAccountsFound=-1,this.errorMessage="There was an error attempting to retrieve your account, please try again.",this.errorMessage},__decorate([i.Prop(Object)],t.prototype,"options",void 0),__decorate([i.Emit("account-found")],t.prototype,"handleAccountSelected",null),__decorate([i.Component({name:"FindAccount",components:{LoginForm:o["default"],PhoneNumberForm:u["default"],EmailForm:f["default"],AccountNumberForm:e["default"],AccountListing:s["default"]},template:'\n        <div class="tabs">\n            <div class="tabs__button-row d-flex align-items-center">\n                <slot name="extraTabs"><\/slot>\n                <button v-show="options.displayLogin" @click.prevent="switchTab(\'login\')"\n                        class="tab px-2 py-4 flex-1"\n                        :class="{\'tab--active\': selectedTab === \'login\'}"\n                        :disabled="selectedTab === \'login\'">\n                    <i class="fas fa-user"><\/i>\n                    {{ options.loginHeader }}\n                <\/button>\n                <button @click.prevent="switchTab(\'phoneNumber\')"\n                        class="tab px-2 py-4 flex-1"\n                        :class="{\'tab--active\': selectedTab === \'phoneNumber\'}"\n                        :disabled="selectedTab === \'phoneNumber\'">\n                    <i class="fas fa-phone"><\/i>\n                    {{ options.phoneHeader }}\n                <\/button>\n                <button @click.prevent="switchTab(\'accountNumber\')"\n                        class="tab px-2 py-4 flex-1"\n                        :class="{\'tab--active\': selectedTab === \'accountNumber\'}"\n                        :disabled="selectedTab === \'accountNumber\'">\n                    <i class="fas fa-hashtag"><\/i>\n                    {{ options.accountNumberHeader }}\n                <\/button>\n                <button @click.prevent="switchTab(\'email\')"\n                        class="tab px-2 py-4 flex-1"\n                        :class="{\'tab--active\': selectedTab === \'email\'}"\n                        :disabled="selectedTab === \'email\'">\n                    <i class="far fa-envelope"><\/i>\n                    {{ options.emailHeader }}\n                <\/button>\n            <\/div>\n            <div class="tabs__content px-2 px-md-4">\n                <div v-show="totalAccountsFound === 0" class="px-2 py-4">\n                    <h2>{{ options.noResultsFoundHeader}}<\/h2>\n                    <div v-html="options.noResultsFoundContent"><\/div>\n                    <button type="button" class="button button--default" @click="totalAccountsFound = -1">{{ options.pleaseTryAgainText }}<\/button>\n                <\/div>\n                <p v-show="errorMessage.length > 0">{{ errorMessage }}<\/p>\n                <div v-show="totalAccountsFound === -1">\n                    <keep-alive>\n                        <component\n                            v-if="isComponentAFindAccountInput"\n                            :is="currentTab"\n                            :inputLabels="inputLabels"\n                            :zipcodeLabels="options.zipCodeInputLabels"\n                            :loginOptions = "options.loginOptions"\n                            :loginIntroText ="options.loginIntroText"\n                            :buttonLabel="options.searchButton"\n                        >\n                        <\/component>\n                        <component v-else :is="currentTab"><\/component>\n                    <\/keep-alive>\n                <\/div>\n                <account-listing v-if="totalAccountsFound > 1" \n                    :accounts="foundAccounts" \n                    :chooseAccountPrompt="options.chooseAccountFromListPrompt"\n                    @account-selected="handleAccountSelected"><\/account-listing>\n            <\/div>\n        <\/div>\n    '})],t)}(i.Vue);t["default"]=c});define("apps/components/dynamic-label",["require","exports","vue-property-decorator"],function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r=function(n){function t(){var t=n!==null&&n.apply(this,arguments)||this;return t.templateRenderer=null,t}return __extends(t,n),t.prototype.onTemplateChange=function(){var n=i.Vue.compile("\n            <"+this.tagName+" "+(this.extraClasses.length>0?'class="'+this.extraClasses+'"':"")+" \n                "+(this.extraIds.length>0?'id="'+this.extraIds+'"':"")+"\n            >\n                "+this.templateContent+"\n            <\/"+this.tagName+">");this.templateRenderer=n.render;this.$options.staticRenderFns=n.staticRenderFns.map(function(n){return n})},t.prototype.render=function(n){return this.templateRenderer?this.templateRenderer():n("strong","Loading label...")},__decorate([i.Prop(String)],t.prototype,"templateContent",void 0),__decorate([i.Prop(String)],t.prototype,"tagName",void 0),__decorate([i.Prop({type:String,"default":""})],t.prototype,"extraClasses",void 0),__decorate([i.Prop({type:String,"default":""})],t.prototype,"extraIds",void 0),__decorate([i.Prop(String)],t.prototype,"address",void 0),__decorate([i.Prop(String)],t.prototype,"city",void 0),__decorate([i.Prop(String)],t.prototype,"phone",void 0),__decorate([i.Prop(String)],t.prototype,"email",void 0),__decorate([i.Watch("templateContent",{immediate:!0,deep:!0})],t.prototype,"onTemplateChange",null),__decorate([i.Component],t)}(i.Vue);t["default"]=r});define("utils/string-helper",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){}return n.formatAsPhoneNumber=function(n){return n.length==10?"("+n.substr(0,3)+") "+n.substr(3,3)+"-"+n.substr(6,4):n},n.formatAsAccountNumber=function(n){return n.length==10?n.substr(0,4)+"-"+n.substr(4,4)+"-"+n.substr(8,2):n},n}();t["default"]=i});define("services/users-service",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){this.csrf="";this.baseUrl="";this.baseUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+"/api/users/";this.csrf=$('[name="__RequestVerificationToken"]').last().val().toString()}return n.prototype.addAssociatedAccount=function(n,t,i,r,u){u===void 0&&(u=null);$.ajax({url:this.baseUrl+"associate",type:"POST",dataType:"json",data:{__RequestVerificationToken:this.csrf,accountNumber:n,otpToken:t,otpPasscode:i},success:function(n){r(n)},error:function(n,t,i){console.error("Error associating account: ");console.error(i);u&&u()}})},n}();t["default"]=i});define("services/otp-service",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){this.csrf="";this.baseUrl="";this.baseUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+"/api/otp/";this.csrf=$('[name="__RequestVerificationToken"]').last().val().toString()}return n.prototype.retrieveOtpAccountOptions=function(n,t,i){i===void 0&&(i=null);$.ajax({url:this.baseUrl+"account-options",type:"POST",dataType:"json",data:{__RequestVerificationToken:this.csrf,accountNumber:n},success:function(n){t(n)},error:function(n,t,r){console.error(r);i&&i()}})},n.prototype.sendOtpAccountCode=function(n,t,i,r){r===void 0&&(r=null);$.ajax({url:this.baseUrl+"account-code",type:"POST",dataType:"json",data:{__RequestVerificationToken:this.csrf,accountNumber:n,method:t},success:function(n){i(n)},error:function(n,t,i){console.error(i);r&&r()}})},n}();t["default"]=i});define("apps/account-associate-app",["require","exports","vue-property-decorator","apps/components/find-account","apps/components/dynamic-label","utils/string-helper","utils/mask","services/users-service","services/otp-service","components/flyout","utils/query-string"],function(n,t,i,r,u,f,e,o,s,h,c){function a(n,t){var r=new i.Vue({el:"#"+n,data:{accountAssociateAppOptions:t},components:{AccountAssociateApp:l}});h["default"].attachListenerIfInFlyout("#"+n,function(){r.$destroy()})}Object.defineProperty(t,"__esModule",{value:!0});t.init=a;var l=function(n){function t(){var t=n.call(this)||this;return t.state="find-account",t.passcodeSelection="Text",t.account=null,t.passcode="",t.token=null,t.otpMethods=null,t.hasEnoughTimePassed=!0,t.currentTimeoutInSeconds=20,t.hasSubmittedInvalidPasscode=!1,t.usersService=new o["default"],t.otpService=new s["default"],t}return __extends(t,n),Object.defineProperty(t.prototype,"isSendPasscodeFormValid",{get:function(){return this.hasEnoughTimePassed},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isConfirmPasscodeFormValid",{get:function(){return this.passcode&&this.passcode.length===6},enumerable:!0,configurable:!0}),t.prototype.onPreferredCallbackChange=function(n,t){t.length>0||e["default"].custom("#passcode","000000")},t.prototype.onAccountFound=function(n){this.account=n;$(".account-associate-app").waitMe({effect:"rotation"});this.state="load-passcode-options";this.otpService.retrieveOtpAccountOptions(this.account.accountNumber,this.onOtpOptionsComplete,this.onCallbackFail)},t.prototype.onOtpOptionsComplete=function(n){this.otpMethods=n;this.otpMethods.text==null&&this.otpMethods.email==null&&this.otpMethods.voice==null?this.usersService.addAssociatedAccount(this.account.accountNumber,this.token,"000000",this.onConfirmPasscodeComplete,this.onCallbackFail):(this.otpMethods.text==null&&(this.passcodeSelection="Email"),this.state="send-passcode",$(".account-associate-app").waitMe("hide"))},t.prototype.sendPasscode=function(){var n=this;this.isSendPasscodeFormValid&&(this.state==="send-passcode"||this.state==="confirm-passcode")&&(this.passcode="",this.hasSubmittedInvalidPasscode=!1,this.hasEnoughTimePassed=!1,$(".account-associate-app").waitMe({effect:"rotation"}),this.state="confirm-passcode",this.otpService.sendOtpAccountCode(this.account.accountNumber,this.passcodeSelection,this.onSendPasscodeComplete,this.onCallbackFail),window.setTimeout(function(){return n.hasEnoughTimePassed=!0},this.currentTimeoutInSeconds*1e3),this.currentTimeoutInSeconds+=10)},t.prototype.onSendPasscodeComplete=function(n){this.token=n;this.state=n!==null?"confirm-passcode":"fail";$(".account-associate-app").waitMe("hide")},t.prototype.confirmPasscode=function(){this.isConfirmPasscodeFormValid&&this.state==="confirm-passcode"&&($(".account-associate-app").waitMe({effect:"rotation"}),this.usersService.addAssociatedAccount(this.account.accountNumber,this.token,this.passcode,this.onConfirmPasscodeComplete,this.onCallbackFail))},t.prototype.onConfirmPasscodeComplete=function(n){n.status==0?this.state="success":n.status==1?this.state="already-associated":n.status==3?this.state="fail":this.hasSubmittedInvalidPasscode=!0;$(".account-associate-app").waitMe("hide")},t.prototype.onCallbackFail=function(){this.state="fail";$(".account-associate-app").waitMe("hide")},t.prototype.formatAccountNumber=function(n){return f["default"].formatAsAccountNumber(n)},t.prototype.destroyed=function(){if(this.state==="success"){var n=c["default"].GetQueryString("target");n&&n.length>0?window.location.href=n:window.location.reload()}},__decorate([i.Prop(Object)],t.prototype,"options",void 0),__decorate([i.Watch("passcode")],t.prototype,"onPreferredCallbackChange",null),__decorate([i.Component({name:"AccountAssociateApp",components:{FindAccount:r["default"],DynamicLabel:u["default"]},template:'\n        <div class="account-associate-app">\n            <div class="mb-2 mb-sm-4 account-associate__header">\n                <div class="d-flex flex-column flex-sm-row justify-content-between align-items-sm-end">\n                    <h1 class="mb-0 font-weight-bold text-uppercase">{{options.title}}<\/h1>\n                <\/div>\n                <h3 class="mt-2 mt-sm-4">{{options.subtitle}}<\/h3>\n            <\/div>\n            <find-account v-if="state===\'find-account\'" :options="options.findAccount" v-on:account-found="onAccountFound"><\/find-account>\n            <div v-else-if="state===\'send-passcode\' || state===\'confirm-passcode\'">\n                <div class="row">\n                    <div class="col-3"><span class="font-weight-bold">{{options.accountLabel}}<\/span><\/div>\n                    <div class="col-9"><span>{{ formatAccountNumber(account.accountNumber) }}<\/span><\/div>\n                <\/div>\n                <div class="row">\n                    <div class="col-3"><span class="font-weight-bold">{{options.addressLabel}}<\/span><\/div>\n                    <div class="col-9"><span>{{ account.address }}<\/span><\/div>\n                <\/div>\n                <div class="row mt-4">\n                    <div class="col" v-html="options.passcodeExplanationContent"><\/div>\n                <\/div>\n                <form action="#" method="post" @submit.prevent="sendPasscode" class="form-invisible">\n                    <p>{{options.selectPasscodeChoiceLabel}}<\/p>\n\n                    <ul class="d-flex flex-column list-reset mb-0">\n                        <li v-if="otpMethods.text !== null" class="d-inline-block">\n                            <label class="d-flex flex-row align-items-center align-content-center radio-label" for="passcodePreference_text">\n                                <input name="passcodePreference"\n                                    type="radio"\n                                    id="passcodePreference_text"\n                                    class="d-inline-block mb-0 flex-shrink-1"\n                                    value="Text"\n                                    v-model="passcodeSelection" />\n                                <dynamic-label :templateContent="options.smsOptionLabel"\n                                    :tagName="\'span\'"\n                                    :extraClasses="\'flex-grow-1 flex-shrink-1\'"\n                                    :phone="otpMethods.text">\n                                <\/dynamic-label>\n                            <\/label>\n                        <\/li>\n                        <li v-if="otpMethods.voice !== null" class="d-inline-block">\n                            <label class="d-flex flex-row align-items-center align-content-center radio-label" for="passcodePreference_voice">\n                                <input name="passcodePreference"\n                                    type="radio"\n                                    id="passcodePreference_voice"\n                                    class="d-inline-block mb-0 flex-shrink-1"\n                                    value="Voice"\n                                    v-model="passcodeSelection" />\n                                <dynamic-label :templateContent="options.voiceOptionLabel"\n                                    :tagName="\'span\'"\n                                    :extraClasses="\'flex-grow-1 flex-shrink-1\'"\n                                    :phone="otpMethods.voice">\n                                <\/dynamic-label>\n                            <\/label>\n                        <\/li>\n                        <li  v-if="otpMethods.email !== null"class="d-inline-block">\n                            <label class="d-flex flex-row align-items-center align-content-center radio-label" for="passcodePreference_email">\n                                <input name="passcodePreference"\n                                    type="radio"\n                                    id="passcodePreference_email"\n                                    class="d-inline-block mb-0 flex-shrink-1"\n                                    value="Email"\n                                    v-model="passcodeSelection" />\n                                <dynamic-label :templateContent="options.emailOptionLabel"\n                                    :tagName="\'span\'"\n                                    :extraClasses="\'flex-grow-1 flex-shrink-1\'"\n                                    :email="otpMethods.email">\n                                <\/dynamic-label>\n                            <\/label>\n                        <\/li>\n                    <\/ul>\n                    <button type="submit" class="button button--default mt-4" :class="{ disabled: !isSendPasscodeFormValid }">\n                        <span v-if="state===\'send-passcode\'">{{options.sendPasscodeButtonLabel}}<\/span>\n                        <span v-if="state===\'confirm-passcode\'">{{options.resendPasscodeButtonLabel}}<\/span>\n                    <\/button>\n                <\/form>\n                <form action="#" v-if="state===\'confirm-passcode\'" method="post" @submit.prevent="confirmPasscode" class="form-invisible pt-4">\n                    <div class="row">\n                        <div class="form-group col">\n                            <label for="passcodeVerify">{{options.passcodeInputLabel}}<\/label>\n                            <input type="text"\n                                    class="form-control passcode-input"\n                                    id="passcode"\n                                    name="passcode"\n                                    max-length="14"\n                                    :aria-label="options.passcodeInputLabel"\n                                    v-model="passcode"/>\n                            <p class="form__error" v-show="hasSubmittedInvalidPasscode">{{ options.invalidPasscodeMessage }}<\/p>\n                        <\/div>\n                    <\/div>\n                    <div class="row">\n                        <div class="form-group col">\n                            <button type="submit" class="button button--default" :class="{ disabled: !isConfirmPasscodeFormValid }">{{options.confirmPasscodeButtonLabel}}<\/button>\n                        <\/div>\n                    <\/div>\n                <\/form>\n            <\/div>\n            <div v-else-if="state===\'success\'">\n                <div class="alert alert-success my-4" v-html="options.successMessage"><\/div>\n                <a href="javascript:void(0)" class="button button--default flyout-close">Close<\/a>\n            <\/div>\n            <div v-else-if="state===\'already-associated\'">\n                <div class="alert alert-warning my-4" v-html="options.alreadyAssociatedMessage"><\/div>\n                <a href="javascript:void(0)" class="button button--default flyout-close">Close<\/a>\n            <\/div>\n            <div v-else-if="state===\'fail\'">\n                <div class="alert alert-danger my-4" v-html="options.failureMessage"><\/div>          \n                <a href="javascript:void(0)" class="button button--default flyout-close">Close<\/a>\n            <\/div>\n        <\/div>\n    '})],t)}(i.Vue);t["default"]=l});define("services/payments-service",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(){this.csrf="";this.baseUrl="";this.baseUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+"/api/payments/";this.csrf=$('[name="__RequestVerificationToken"]').last().val().toString()}return n.prototype.getPaymentInfo=function(n,t,i){i===void 0&&(i=null);$.ajax({url:this.baseUrl,type:"POST",dataType:"json",data:{accountNumber:n,__RequestVerificationToken:this.csrf},success:function(n){n.result?t(n):i(n)},error:function(n,t,r){console.error("Error retrieving accounts: ");console.error(r);i&&i({result:!1,errorMessageId:5})}})},n.prototype.getCCPaymentUrl=function(n,t,i){i===void 0&&(i=null);$.ajax({url:this.baseUrl+"cc/url",type:"POST",dataType:"json",data:{accountNumber:n,__RequestVerificationToken:this.csrf},success:function(n){n.result?t(n):i(n)},error:function(){i&&i({result:!1,errorMessageId:5})}})},n.prototype.checkPaymentValid=function(n,t,i){i===void 0&&(i=null);$.ajax({url:this.baseUrl+"verify",type:"POST",dataType:"json",data:{paymentPayload:n,__RequestVerificationToken:this.csrf},success:function(n){n.result?t(n):i(n)},error:function(n,t,r){console.error("Error retrieving accounts: ");console.error(r);i&&i({result:!1,errorMessageId:5})}})},n.prototype.submitPaymentValid=function(n,t,i,r){r===void 0&&(r=null);$.ajax({url:this.baseUrl+"post",type:"POST",dataType:"json",data:{paymentPayload:n,contentId:t,__RequestVerificationToken:this.csrf},success:function(n){n.result?i(n):r(n)},error:function(n,t,i){console.error("Error retrieving accounts: ");console.error(i);r&&r({result:!1,errorMessageId:5})}})},n}();t["default"]=i});define("apps/payments-app",["require","exports","vue-property-decorator","apps/components/find-account","services/payments-service","apps/components/payments-by-check","utils/error-messages","components/flyout"],function(n,t,i,r,u,f,e,o){function h(n,t){var r=new i.Vue({el:"#"+n,data:{paymentsAppOptions:t},components:{PaymentsApp:s}});o["default"].attachListenerIfInFlyout("#"+n,function(){r.$destroy()})}Object.defineProperty(t,"__esModule",{value:!0});t.init=h;var s=function(n){function t(){var t=n.call(this)||this;return t.isCheckPay=!1,t.account=null,t.currErrorMessage="",t.accountPayment=null,t.displayAccountInfo=!0,t.paymentsService=new u["default"],t}return __extends(t,n),t.prototype.onAccountFound=function(n){this.account=n;$(".payment-app").waitMe({effect:"rotation"});this.paymentsService.getPaymentInfo(n.accountNumber,this.onPaymentFetch,this.onFailure)},t.prototype.onPaymentFetch=function(n){this.accountPayment=n;$(".payment-app").waitMe("hide")},t.prototype.onFailure=function(n){switch(n.errorMessageId){case 1:this.currErrorMessage=n.customMessage;break;default:this.currErrorMessage=e["default"].get(n.errorMessageId)}$(".payment-app").waitMe("hide")},t.prototype.handleCheckClick=function(n){n.preventDefault();this.isCheckPay=!0},t.prototype.handleCCClick=function(n){n.preventDefault();$(".payment-app").waitMe({effect:"rotation"});this.paymentsService.getCCPaymentUrl(this.account.accountNumber,this.onCCPaymentUrlSuccess,this.onFailure)},t.prototype.onCCPaymentUrlSuccess=function(n){window.location.href=n.link},t.prototype.setDisplayAccountInfo=function(n){this.displayAccountInfo=n},__decorate([i.Prop(Object)],t.prototype,"options",void 0),__decorate([i.Component({name:"PaymentsApp",components:{FindAccount:r["default"],PaymentsByCheck:f["default"]},template:'\n        <div class="payment-app">\n            <div class="mb-2 mb-sm-4 payments__header">\n                <div class="d-flex flex-column flex-sm-row justify-content-between align-items-sm-end">\n                    <h1 class="mb-0 font-weight-bold text-uppercase">{{options.title}}<\/h1>\n                <\/div>\n            <\/div>\n            <find-account :options="options.findAccount" v-if="account === null" v-on:account-found="onAccountFound"><\/find-account>\n            <div v-if="currErrorMessage" class="alert alert-danger">\n                {{ currErrorMessage }}\n            <\/div>\n            <div v-if="account !== null && accountPayment !== null">\n                <div class="alert alert-warning" v-if="accountPayment.displayLateMessage">\n                    {{ options.latePaymentMessage }}\n                <\/div>\n                <div v-if="!accountPayment.displayLateMessage" class="payments-selector">\n                    <div v-if="displayAccountInfo">\n                        <div class="payments-selector_address"> {{ account.Address }} <\/div>\n                        <div class="payments-selector_amount-due">{{ options.amountDueLabel }}<\/div>\n                        <h2>$ {{ accountPayment.amountDue }}<\/h2>\n                        <span>{{ options.lateChargesAddedAfterLabel }}<\/span><span>{{ accountPayment.dueDate }}<\/span>\n                    <\/div>\n                    <div v-if="!isCheckPay">\n                        <a href="#" v-on:click="handleCheckClick" class="button button--default col-12 mt-4 mb-2">{{options.payByCheckLabel}} <\/a>\n                        <a href="#" v-on:click="handleCCClick" class="button button--default col-12 mt-2 mb-4">{{options.payByCardLabel}} <\/a>\n                    <\/div>\n                    \n                    <payments-by-check v-if="isCheckPay" :options="options" :accountNum="account.accountNumber" :accountPayment="accountPayment" @displayAccountInfo="setDisplayAccountInfo"><\/payments-by-check>\n                <\/div>\n            <\/div>\n            <a :href="options.paymentAssistanceProgramsLink.link" class="mt-4 payments__bottom-links">{{options.paymentAssistanceProgramsLink.title}}<\/a>\n            <a :href="options.morePaymentOptionsLink.link" class="mt-4 payments__bottom-links">{{options.morePaymentOptionsLink.title}}<\/a>\n        <\/div>\n    '})],t)}(i.Vue);t["default"]=s});define("apps/components/payments-by-check",["require","exports","vue-property-decorator","services/payments-service","utils/form-validator","utils/error-messages"],function(n,t,i,r,u,f){function o(n,t){var r=new i.Vue({el:"#"+n,data:{paymentsAppOptions:t},components:{PaymentsByCheck:e}})}Object.defineProperty(t,"__esModule",{value:!0});t.init=o;var e=function(n){function t(){var t=n.call(this)||this;return t.paymentOption="amount",t.bankRouting="",t.bankAccount="",t.other="",t.payDate=(new Date).toLocaleDateString("en-us",{year:"numeric",month:"2-digit",day:"2-digit"}),t.email="",t.hasUserSubmitted=!1,t.paymentIsValid=!1,t.paymentPosted=!1,t.gnfAmountDue="0",t.paymentModel={accountNumber:"",bankRouting:"",bankAccount:"",amount:0,postDate:"",email:"",timestamp:""},t.error="",t.paymentsService=new r["default"],t}return __extends(t,n),t.prototype.onConfirmValidationSuccess=function(n){this.hasUserSubmitted=!1;n.result?(this.paymentIsValid=!0,this.$emit("displayAccountInfo",!1)):this.handleError(n)},t.prototype.onConfirmValidationFailure=function(n){n.result||(this.handleError(n),this.hasUserSubmitted=!1)},t.prototype.onPaymentPosted=function(n){this.hasUserSubmitted=!1;$(".payment-app").waitMe("hide");n.result?(this.error="",this.confirmationNumber=n.confirmationNumber,this.paymentPosted=!0,this.paymentModel.email&&(this.options.emailReceiptLabel=this.options.emailReceiptLabel.replace("{{ email }}",this.paymentModel.email))):(this.paymentIsValid=!1,this.handleError(n))},t.prototype.onPaymentFailed=function(n){$(".payment-app").waitMe("hide");n.result||this.handleError(n)},t.prototype.handleError=function(n){this.error=n.customMessage==="InvalidRouting"?this.options.invalidRoutingError:n.customMessage==="BankAccountBlocked"?this.options.bankAccountBlockedError:n.customMessage==="InvalidInput"?this.options.invalidInputError:n.customMessage==="PaymentAlreadyPosted"?this.options.paymentAlreadyPosted:f["default"].get(n.errorMessageId)},Object.defineProperty(t.prototype,"isFormValid",{get:function(){return!this.bankRouting||!this.bankAccount||!this.payDate?!1:this.paymentOption==="other"&&!this.other?!1:this.email&&!u["default"].validateEmail(this.email)?!1:!0},enumerable:!0,configurable:!0}),t.prototype.confirmValidation=function(n){this.hasUserSubmitted=!0;n.preventDefault();var t=this.paymentOption==="amount"?Number(this.gnfAmountDue):0,i=this.paymentOption==="other"?Number(this.other):Number(this.accountPayment.amountDue)+Number(t);this.paymentModel.accountNumber=this.accountNum;this.paymentModel.bankRouting=this.bankRouting;this.paymentModel.bankAccount=this.bankAccount;this.paymentModel.amount=i;this.formattedAmount=this.paymentModel.amount.toFixed(2);this.paymentModel.email=this.email;this.paymentModel.postDate=this.payDate;this.paymentModel.timestamp=this.accountPayment.timestamp;this.paymentsService.checkPaymentValid(this.paymentModel,this.onConfirmValidationSuccess,this.onConfirmValidationFailure)},t.prototype.submitPayment=function(n){n.preventDefault();$(".payment-app").waitMe({effect:"rotation"});this.paymentsService.submitPaymentValid(this.paymentModel,this.options.contentId,this.onPaymentPosted,this.onPaymentFailed)},t.prototype.cancel=function(n){n.preventDefault();this.$emit("accountFound",!1);$("#flyout-close").click()},t.prototype.modify=function(n){n.preventDefault();this.error="";this.paymentIsValid=!1;this.$emit("displayAccountInfo",!0)},t.prototype.setupOtherField=function(n){this.paymentOption==="other"&&($("#other")[0].oninput=function(){var t=Number.parseFloat($("#other").val().toString());t<1?$("#other")[0].setCustomValidity(n.options.paymentLessThanOneErrorLabel):t>Number(n.accountPayment.amountDue)&&t<Number(n.accountPayment.amountDue)+1?$("#other")[0].setCustomValidity(n.options.overpaymentMustBeGreaterThanOne):$("#other")[0].setCustomValidity("")})},t.prototype.setupAmountDue=function(n){this.paymentOption==="amount"&&n.accountPayment.amountDue<1&&$("#paymentOptions")[0].setCustomValidity(n.options.paymentLessThanOneErrorLabel)},t.prototype.prepForm=function(n){var i=this,u={year:"numeric",month:"2-digit",day:"2-digit"},t=new Date,r;t.setDate(t.getDate()+30);r=t.getMonth()+1+"/"+t.getDate()+"/"+t.getFullYear();$(".datepicker-limited").datepicker({format:"mm/dd/yyyy",startDate:"0",endDate:r}).on("changeDate",function(t){n.payDate=t.date.toLocaleDateString("en-us",u)});$.applyDataMask();this.setupAmountDue(n);$("#bankRouting")[0].oninvalid=function(){$("#bankRouting")[0].setCustomValidity(n.options.routingNumberLengthErrorLabel)};$("#bankAccount")[0].oninput=function(){$("#bankAccount").val()===$("#bankRouting").val()?$("#bankAccount")[0].setCustomValidity(n.options.differentAccountNumAndRoutingNumErrorLabel):$("#bankAccount")[0].setCustomValidity("")};$("#payments-app").on("click",".payments-by-check_stepper .minus",function(n){n.preventDefault();var t=Number(i.gnfAmountDue);t>0&&(i.gnfAmountDue=(t-1).toString())});$("#payments-app").on("click",".payments-by-check_stepper .plus",function(n){n.preventDefault();var t=Number(i.gnfAmountDue);t<10&&(i.gnfAmountDue=(t+1).toString())});$("#other").length>0&&this.setupOtherField(n)},__decorate([i.Prop(Object)],t.prototype,"options",void 0),__decorate([i.Prop(String)],t.prototype,"accountNum",void 0),__decorate([i.Prop(Object)],t.prototype,"accountPayment",void 0),__decorate([i.Component({name:"PaymentsByCheck",template:'\n        <form class="payments-by-check" @submit="confirmValidation" v-if="!paymentIsValid">\n            <h4 class="payments-by-check_title">{{ options.payByCheckLabel }}<\/h4>\n            <div v-if="error" class="alert alert-danger">\n                {{ error }}\n            <\/div>\n            <div class="form-group">\n                <label for="bankRouting">{{ options.bankRoutingNumberLabel}}<\/label>\n                <input type="text" pattern="(?!0+$)[0-9]{9}" data-mask="000000000" name="bankRouting" id="bankRouting" v-model="bankRouting" required class="form-control" oninput="setCustomValidity(\'\')"/>\n            <\/div>\n            <div class="form-group">\n                <label for="bankAccount">{{ options.bankAccountNumberLabel}}<\/label>\n                <input type="text" pattern="(?!0+$)[0-9]{1,17}" data-mask="99999999999999999" name="bankAccount" id="bankAccount" v-model="bankAccount" required class="form-control"/>\n            <\/div>\n            <div class="form-group">\n                <label for="paymentAmount">{{ options.paymentAmountLabel }}<\/label>\n                <select id="paymentOptions" name="paymentOptions" v-model="paymentOption">\n                    <option value="amount">{{ options.amountDueLabel }} (${{ accountPayment.amountDue }})<\/option>\n                    <option value="other">{{ options.otherPaymentOptionLabel }}<\/option>\n                <\/select>\n                <div v-if="paymentOption === \'amount\'">\n                    <div class="pt-2" v-html="options.gnfRadioLabel"><\/div>\n                    <div class="payments-by-check_stepper">\n                        <button class="minus"><\/button>\n                        <input type="number" class="stepper" name="gnfAmountDue" min="0" max="10" v-model="gnfAmountDue" value="0"/>\n                        <button class="plus"><\/button>\n                    <\/div>\n                <\/div>\n                <strong class="col-1 d-inline" v-if="paymentOption === \'other\'">$<\/strong>\n                <input v-if="paymentOption === \'other\'" type="text" class="col-10 form-control d-inline mt-2" v-model="other" id="other" pattern="[0-9]*(?:.[0-9]{1,2})?" required/>\n                <span v-if="paymentOption === \'other\'" class="ml-5 clearfix" v-html="options.gnfLabel"><\/span>\n            <\/div>\n            <div class="form-group">\n                <label for="paymentDate">{{ options.paymentDateLabel }} <\/label>\n                <input name="date" id="date" class="datepicker-limited col-10 inline form-control" placeholder="mm/dd/yyyy" v-model="payDate" required/>\n            <\/div>\n            <div class="form-group">\n                <label for="email" class="mb-0">{{ options.emailAddressLabel }}<\/label>\n                <div class="payments-by-check_email-optional">{{ options.emailOptionalLabel }}<\/div>\n                <input type="email" :placeholder="options.emailAddressPlaceholder" v-model="email" class="form-control" />\n            <\/div>\n            <button class="button button--default mt-4 col-12" type="submit" :class="{ disabled: !isFormValid || hasUserSubmitted }">{{ options.submitPaymentButtonLabel }}<\/button>\n        <\/form>\n        <div class="payments-by-check" v-else-if="paymentIsValid && !paymentPosted">\n            <h5 class="payments-by-check_confirm-payment payments-by-check_title">{{ options.confirmToCompletePaymentLabel }}<\/h5>\n            <div class="payments-by-check_details">\n                <strong>{{ options.accountNumberConfirmationLabel }}<\/strong>\n                <p>{{ accountNum }}<\/p>\n                <strong>{{ options.bankRoutingNumberLabel }}<\/strong>\n                <p>{{ paymentModel.bankRouting }}<\/p>\n                <strong>{{ options.bankAccountNumberLabel }}<\/strong>\n                <p>{{ paymentModel.bankAccount }}<\/p>\n                <strong>{{ options.paymentAmountLabel }}<\/strong>\n                <p>${{ formattedAmount }} <\/p>\n                <strong>{{ options.paymentProcessedOnLabel }}<\/strong>\n                <div class="mb-3">{{ paymentModel.postDate }}<\/div>\n                <strong v-if="paymentModel.email" >{{ options.emailAddressLabel }}<\/strong>\n                <p v-if="paymentModel.email">{{ paymentModel.email }}<\/p>\n                <a href="#" class="button button--default col-12 mb-3" v-on:click="submitPayment" :class="{ disabled: hasUserSubmitted }">{{ options.confirmPaymentButtonLabel }}<\/a>\n                <a href="#" class="button button--outline--default button--outline payments-by-check_light-button" v-on:click="cancel">{{ options.cancelButtonLabel }}<\/a>\n                <a href="#" class="button button--outline--default button--outline payments-by-check_light-button" v-on:click="modify">{{ options.modifyButtonLabel }}<\/a>\n            <\/div>\n        <\/div>\n        <div v-else-if="paymentPosted" class="payments-posted">\n            <h4 class="payments-posted_thank payments-by-check_title">{{ options.thankYouLabel }}<\/h4>\n            <h6 class="payments-posted_auth-details">{{ options.paymentAuthorizationDetailsLabel }}<\/h6>\n            <div class="payments-by-check_details">\n                <strong>{{ options.confirmationNumberLabel }}<\/strong>\n                <div class="mb-3">{{ confirmationNumber }}<\/div>\n                <strong>{{ options.paymentAmountLabel }}<\/strong>\n                <div class="mb-3">${{ formattedAmount }}<\/div>\n                <strong>{{ options.paymentProcessedOnLabel }}<\/strong>\n                <div class="mb-3">{{ paymentModel.postDate }}<\/div>\n                <div v-if="paymentModel.email">\n                    {{ options.emailReceiptLabel}}\n                <\/div>\n                <div class="mt-3" v-html="options.promotionalContent"><\/div>\n            <\/div>\n        <\/div>\n        \n    ',mounted:function(){var n=this;n.prepForm(n)},watch:{paymentIsValid:function(){var n=this;n.paymentIsValid||i.Vue.nextTick(function(){n.prepForm(n)})},paymentOption:function(){var n=this;n.paymentOption==="other"?i.Vue.nextTick(function(){$("#paymentOptions")[0].setCustomValidity("");n.setupOtherField(n)}):n.setupAmountDue(n)}}})],t)}(i.Vue);t["default"]=e});define("apps/ioap-payments-app",["require","exports","vue-property-decorator","apps/components/payments-by-check","services/payments-service","utils/error-messages","utils/mask","utils/form-validator"],function(n,t,i,r,u,f,e,o){function h(n,t){var r=new i.Vue({el:"#"+n,data:{paymentsAppOptions:t},components:{IoapPaymentsApp:s}})}Object.defineProperty(t,"__esModule",{value:!0});t.init=h;var s=function(n){function t(){var t=n.call(this)||this;return t.accountFound=!1,t.currErrorMessage="",t.accountNum="",t.accountPayment=null,t.displayAccountInfo=!0,t.paymentsService=new u["default"],t}return __extends(t,n),t.prototype.mounted=function(){e["default"].accountNumberChecksum("#billingInvoice");$("#billingInvoice").val(this.options.billingOrderNumber);this.accountNum=this.options.billingOrderNumber;this.accountNum.length==11&&this.submitForm(null)},Object.defineProperty(t.prototype,"rawValue",{get:function(){return e["default"].getRawValue(this.accountNum)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isValid",{get:function(){return this.currErrorMessage="",this.validateForm()},enumerable:!0,configurable:!0}),t.prototype.maskAccountNumber=function(){this.accountNum=$("#billingInvoice").masked(this.rawValue)},t.prototype.validateForm=function(){return o["default"].validateAccountNumberWithChecksum(this.rawValue)},t.prototype.submitForm=function(n){n!=undefined&&n!=null&&n.preventDefault();this.validateForm()&&($(".payment-app").waitMe({effect:"rotation"}),this.paymentsService.getPaymentInfo(this.accountNum.substr(0,12),this.onPaymentFetch,this.onFailure))},t.prototype.onPaymentFetch=function(n){this.accountPayment=n;$(".payment-app").waitMe("hide");this.accountFound=!0},t.prototype.onFailure=function(n){$(".payment-app").waitMe("hide");switch(n.errorMessageId){case 1:this.currErrorMessage=n.customMessage;break;default:this.currErrorMessage=f["default"].get(n.errorMessageId)}},t.prototype.setAccountFound=function(n){this.accountFound=n},__decorate([i.Prop(Object)],t.prototype,"options",void 0),__decorate([i.Component({name:"IoapPaymentsApp",components:{PaymentsByCheck:r["default"]},template:'\n        <div class="payment-app">\n            <div class="mb-2 mb-sm-4 payments__header">\n                <div class="d-flex flex-column flex-sm-row justify-content-between align-items-sm-end">\n                    <h1 class="mb-0 font-weight-bold text-uppercase">{{options.ioapTitle}}<\/h1>\n                <\/div>\n            <\/div>\n            <form class="" v-if="!accountFound" @submit="submitForm">\n                <label for="billingInvoice">{{options.billingInvoiceNumberLabel}}<\/label>\n                <input type="text"\n                       id="billingInvoice"\n                       name="billingInvoice"\n                       @input="maskAccountNumber"\n                       :aria-valuenow="accountNum"\n                       :aria-valuetext="accountNum"\n                       v-model="accountNum"\n                       value=""\n                       required />\n                <div v-if="currErrorMessage" class="alert alert-danger">\n                    {{ currErrorMessage }}\n                <\/div>\n                <button type="submit" class="button button--default mt-4" :class="{ \'disabled\' : !isValid }">\n                    {{ options.submitButton }}\n                <\/button>\n            <\/form>\n            \n            <payments-by-check v-if="accountFound" :options="options.paymentsBlock" :accountNum="accountNum.substr(0, 12)" :accountPayment="accountPayment" @accountFound="setAccountFound"><\/payments-by-check>\n        <\/div>\n    '})],t)}(i.Vue);t["default"]=s});define("apps/components/account-chooser/account-chooser",["require","exports","vue-property-decorator","services/accounts-service","utils/error-messages"],function(n,t,i,r,u){Object.defineProperty(t,"__esModule",{value:!0});var f=function(n){function t(){var t=n.call(this)||this;return t.accountSearchQuery="",t.errorMessage="",t.isLoading=!1,t.redirectToFullpage=!1,t.accountsService=new r["default"],t.redirectLink=t.accountChooserOptions.fullPageUrl+"?target="+encodeURIComponent(t.accountChooserOptions.targetUrl),t.redirectToFullpage=t.accounts.length>t.accountChooserOptions.numberOfAccountsBeforeExternalPage,t}return __extends(t,n),Object.defineProperty(t.prototype,"displayableAccounts",{get:function(){var n=this;return this.accounts.filter(function(t){return t.accountNumber!==n.activeAccount.accountNumber&&(t.accountNumber.includes(n.accountSearchQuery)||t.accountDisplayNumber.includes(n.accountSearchQuery)||t.serviceAddress.toLowerCase().includes(n.accountSearchQuery.toLowerCase()))})},enumerable:!0,configurable:!0}),t.prototype.changeAccount=function(n){this.isLoading=!0;$(".account-chooser").waitMe({effect:"rotation"});this.redirectToFullpage=!1;this.accountSearchQuery="";this.accountsService.updateActiveAccount(n,this.onAccountUpdate,this.onAccountUpdateFailed)},t.prototype.onAccountUpdate=function(n){return this.isLoading=!1,$(".account-chooser").waitMe("hide"),n},t.prototype.onAccountUpdateFailed=function(n){this.isLoading=!1;$(".account-chooser").waitMe("hide");switch(n.errorMessageId){case 1:this.errorMessage=n.customMessage;break;default:this.errorMessage=u["default"].get(n.errorMessageId)}},__decorate([i.Prop(Object)],t.prototype,"accountChooserOptions",void 0),__decorate([i.Prop(Number)],t.prototype,"selectMode",void 0),__decorate([i.Prop(Object)],t.prototype,"activeAccount",void 0),__decorate([i.Prop(Array)],t.prototype,"accounts",void 0),__decorate([i.Emit("account-found")],t.prototype,"onAccountUpdate",null),__decorate([i.Component({template:'\n<div class="dropdown account-chooser mb-4">\n    <button type="button" \n        id="accountChooserDropdown" \n        class="d-flex justify-content-between w-100 active account-chooser_account"\n        data-toggle="dropdown" \n        aria-haspopup="true" \n        aria-expanded="false"\n        v-if="!redirectToFullpage"\n    >\n        <div>\n            <p class="font-weight-bold m-0 text-left">{{ activeAccount.serviceAddress }}<\/p>\n            <p class="m-0"><span class="font-weight-bold d-inline-block">{{ accountChooserOptions.accountNumberLabel }}:<\/span> {{ activeAccount.accountDisplayNumber }}<\/p>\n        <\/div>\n        <i class="fas fa-caret-down account-chooser_caret"><\/i>\n    <\/button>\n    <div class="dropdown-menu account-chooser_accounts-container px-0 py-3" aria-labelledby="accountChooserDropdown">\n        <div class="search-input_container mt-0 mx-4 mb-2">\n            <i class="fas fa-search"><\/i>\n            <input type="text" \n                class="d-block w-100 account-chooser_search mb-0 search-input" \n                aria-label="Search for an account..."\n                v-model="accountSearchQuery"\n            />\n        <\/div>\n        <!-- Loop over nothing. -->\n        <div class="account-chooser_accounts" v-if="!redirectToFullpage">\n            <a v-for="(account, index) in displayableAccounts" :key="account + index"\n                class="dropdown-item account-chooser_account px-4 py-2" href="#" \n                @click.prevent="changeAccount(account)"\n            >\n                <p class="font-weight-bold m-0 text-left">{{ account.serviceAddress }}<\/p>\n                <p class="m-0 text-align-left"><span class="font-weight-bold d-inline-block">{{ accountChooserOptions.accountNumberLabel }}:<\/span> {{ account.accountDisplayNumber }}<\/p>\n            <\/a>\n        <\/div>\n    <\/div>\n    <a v-bind:href="redirectLink" title="Click to Switch Accounts" class="account-chooser account-chooser--display-only account-chooser--display-only--with-icon" v-if="redirectToFullpage">\n        <span>{{ activeAccount.serviceAddress }}<\/span>\n        <span class="d-block account-chooser_number"><span class="font-weight-bold d-inline-block">{{ accountChooserOptions.accountNumberLabel }}:<\/span> {{ activeAccount.accountDisplayNumber }}<\/span>\n        <i class="fas fa-caret-right account-chooser_caret"><\/i>\n    <\/a>\n    <strong v-show="!isLoading && errorMessage.length > 0" class="form__error">{{ errorMessage }}<\/strong>\n<\/div>\n'})],t)}(i.Vue);t["default"]=f});define("services/outages-service",["require","exports","utils/error-messages"],function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});var r=function(){function n(){this.csrf="";this.baseUrl="";this.baseUrl=window.location.protocol+"//"+window.location.hostname+(window.location.port?":"+window.location.port:"")+"/api/outages/";this.csrf=$('[name="__RequestVerificationToken"]').last().val().toString()}return n.prototype.getOutageStatus=function(n,t,r){r===void 0&&(r=null);var u={accountNumber:n.accountNumber},f=this.baseUrl+"accounts";$.ajax({url:f,type:"POST",dataType:"json",data:__assign({__RequestVerificationToken:this.csrf},u),success:function(n){t(n)},error:function(n){var t=i["default"].getByStatusCode(n.status);console.error("Error retrieving outage status: ");console.error(t);r&&r(t)}})},n.prototype.reportOutage=function(n,t,r,u,f){f===void 0&&(f=null);var e={wantsCallback:t,alternativePhoneNumber:r},o=this.baseUrl+"accounts/"+n.accountNumber;$.ajax({url:o,type:"POST",dataType:"json",data:__assign({__RequestVerificationToken:this.csrf},e),success:function(n){u(n)},error:function(n){var t=i["default"].getByStatusCode(n.status);console.error("Error retrieving outage status: ");console.error(t);f&&f(t)}})},n}();t["default"]=r});define("apps/outages-app",["require","exports","vue-property-decorator","utils/string-helper","apps/components/find-account","apps/components/account-chooser/account-chooser","apps/components/dynamic-label","utils/mask","services/outages-service","services/accounts-service","utils/date-helper","utils/form-validator","utils/alerts-helper","utils/error-messages","components/flyout"],function(n,t,i,r,u,f,e,o,s,h,c,l,a,v,y){function w(n,t){var r=new i.Vue({el:"#"+n,data:{outageAppOptions:t},components:{OutagesApp:p}});y["default"].attachListenerIfInFlyout("#"+n,function(){r.$destroy()})}Object.defineProperty(t,"__esModule",{value:!0});t.init=w;var p=function(n){function t(){var t=n.call(this)||this;return t.account=null,t.allRelatedAccounts=[],t.outage=null,t.outageReported=!1,t.confirmOutage=!1,t.isLoading=!1,t.currErrorMessage="",t.isAuthenticated=!1,t.accountChooserMode=0,t.wantsCallback=!0,t.preferredCallback="",t.doNotCallToConfirm=!1,t.hasUserSubmitted=!1,t.outagesService=new s["default"],t.accountsService=new h["default"],t}return __extends(t,n),t.prototype.created=function(){this.isLoading=!0;$(".outage-app").waitMe({effect:"rotation"});this.accountsService.getActiveAccount(this.checkUserAuthenticatedStatus)},t.prototype.onPreferredCallbackChange=function(n,t){t.length>0||o["default"].phoneNumber("#preferredCallback")},t.prototype.checkUserAuthenticatedStatus=function(n){if(!n.result){this.isLoading=!1;$(".outage-app").waitMe("hide");return}this.isAuthenticated=!0;this.allRelatedAccounts=n.accounts;this.onAccountFound(__assign({},n.activeAccount,{accountNumber:n.activeAccount.accountNumber}));this.isLoading=!1;$(".outage-app").waitMe("hide")},Object.defineProperty(t.prototype,"isOutageKnown",{get:function(){return this.outage?this.outage.outageStatus!=="Unknown":!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"wasOutagePredicted",{get:function(){return this.outage?this.outage.reportingSource===0:!1},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isFormValid",{get:function(){return this.wantsCallback?!0:l["default"].validatePhoneNumber(o["default"].getRawValue(this.preferredCallback))||this.doNotCallToConfirm},enumerable:!0,configurable:!0}),t.prototype.getTextFromStatus=function(n){switch(n){case"Unassigned":return this.options.statusUnassigned;case"Assigned":return this.options.statusAssigned;case"EnRoute":return this.options.statusEnRoute;case"OnSite":return this.options.statusOnSite;case"Restored":return this.options.statusRestored;case"Unknown":return this.options.statusUnknown;default:return"An error has occurred"}},t.prototype.onAccountFound=function(n){this.account=n;this.isLoading=!0;$(".outage-app").waitMe({effect:"rotation"});this.outagesService.getOutageStatus(this.account,this.onGetOutageStatusComplete,this.onGetOutageStatusError)},t.prototype.onGetOutageStatusComplete=function(n){if(n.result||n.returnCode===1)this.outage=n.outage,o["default"].phoneNumber("#preferredCallback");else switch(n.returnCode){case 0:this.currErrorMessage=this.options.doesNotHaveElectricMeterMessage;break;case 2:this.currErrorMessage=n.errorMessageId===1?n.customMessage:v["default"].get(n.errorMessageId);break;case 3:this.currErrorMessage=this.options.invalidAccountError}this.isLoading=!1;$(".outage-app").waitMe("hide")},t.prototype.onGetOutageStatusError=function(n){this.isLoading=!1;$(".outage-app").waitMe("hide");a["default"].showAlert(n,4)},t.prototype.reportOutage=function(){if(this.isFormValid&&!this.hasUserSubmitted){var n=null;this.wantsCallback||this.doNotCallToConfirm||(n=o["default"].getRawValue(this.preferredCallback));this.isLoading=!0;$(".outage-app").waitMe({effect:"rotation"});this.currErrorMessage="";this.hasUserSubmitted=!0;n!=null?this.outagesService.reportOutage(this.account,!0,n,this.onReportOutageComplete,this.onReportOutageError):this.outagesService.reportOutage(this.account,this.wantsCallback,n,this.onReportOutageComplete,this.onReportOutageError)}},t.prototype.onReportOutageComplete=function(n){if(n.result)this.outageReported=!0;else switch(n.errorMessageId){case 1:this.currErrorMessage=n.customMessage;break;default:a["default"].showAlert(v["default"].get(n.errorMessageId),4)}this.isLoading=!1;$(".outage-app").waitMe("hide")},t.prototype.onReportOutageError=function(n){this.isLoading=!1;$(".outage-app").waitMe("hide");a["default"].showAlert(n,4)},t.prototype.formatOutageStatusLabel=function(n){return n.lastIndexOf(":")===n.length-1?n:n+":"},t.prototype.onConfirmOutage=function(n){n.event.preventDefault();this.confirmOutage=!0},t.prototype.formatOutageETR=function(){return this.outage.etr?c["default"].formatDateFromUnixTimestamp(this.outage.etr.toString()):this.outage.etr},t.prototype.formatPhoneNumber=function(n){return r["default"].formatAsPhoneNumber(n)},t.prototype.destroyed=function(){this.outageReported&&$(".account-outage-status").length>0&&window.location.reload()},__decorate([i.Prop(Object)],t.prototype,"options",void 0),__decorate([i.Watch("preferredCallback")],t.prototype,"onPreferredCallbackChange",null),__decorate([i.Component({name:"OutagesApp",components:{FindAccount:u["default"],AccountChooser:f["default"],DynamicLabel:e["default"]},template:'\n        <div class="outage-app">\n            <div class="mb-2 mb-sm-4 outages__header">\n                <div class="d-flex flex-column flex-sm-row justify-content-between align-items-sm-end">\n                    <h1 class="mb-0 font-weight-bold text-uppercase">{{options.title}}<\/h1><a :href="options.outageMapLink.link" class="font-weight-bold" :target="options.outageMapLink.target">{{options.outageMapLink.title}}<\/a>\n                <\/div>\n                <h3 class="mt-2 mt-sm-4">{{options.subtitle}}<\/h3>\n            <\/div>\n            <find-account v-if="account === null && !isAuthenticated && !isLoading" \n                :options="options.findAccount"\n                v-on:account-found="onAccountFound"\n            ><\/find-account>\n            <account-chooser v-else-if="isAuthenticated && allRelatedAccounts.length > 1"\n                :activeAccount="account"\n                :accounts="allRelatedAccounts"\n                :accountChooserOptions="options.accountChooser"\n                :selectMode="accountChooserMode"\n                v-on:account-found="onAccountFound"\n            ><\/account-chooser>\n            <div v-if="account !== null">\n                <template v-if="outage === null">\n                    <div v-if="!isLoading">\n                        <strong class="error-text">{{ currErrorMessage }}<\/strong>\n                        <br />\n                        <button type="button" class="button button--default mt-3" @click="account = null">{{ options.findAccount.pleaseTryAgainText }}<\/button>\n                    <\/div>\n                <\/template>\n                <template v-if="outage !== null && !outageReported">\n                    <!-- Report Outage Form -->\n                    <div v-if="!isOutageKnown || confirmOutage">\n                        <form action="#" method="post" @submit.prevent="reportOutage" v-show="!isLoading" class="p-0">\n                            <dynamic-label :templateContent="confirmOutage ? options.knownOutageText : options.noKnownOutagesText"\n                                :tagName="\'h3\'"\n                                :extraClasses="\'h4 outages__no-record-msg\'"\n                                :address="outage.streetAddress"\n                                :city="outage.city">\n                            <\/dynamic-label>\n                            <hr />\n                            <dynamic-label :templateContent="options.reportOutageHeader"\n                                :tagName="\'h3\'"\n                                :address="outage.streetAddress"\n                                :city="outage.city">\n                            <\/dynamic-label>\n                            <dynamic-label :templateContent="options.phoneVerificationPrompt"\n                                :tagName="\'p\'"\n                                :phone="formatPhoneNumber(outage.phoneNumber)">\n                            <\/dynamic-label>\n                            <ul class="d-flex flex-column list-reset mb-0">\n                                <li class="d-inline-block">\n                                    <label class="d-flex flex-row align-items-center align-content-center radio-label" for="callback_yes">\n                                        <input name="contactThisNumber"\n                                            type="radio"\n                                            id="callback_yes"\n                                            class="d-inline-block mb-0 flex-shrink-1"\n                                            :aria-label="options.callbackYesOption"\n                                            :value="true"\n                                            v-model="wantsCallback" />\n                                        <span class="flex-grow-1 flex-shrink-1">{{ options.callbackYesOption }}<\/span>\n                                    <\/label>\n                                <\/li>\n                                <li class="d-inline-block">\n                                    <label class="d-flex flex-row align-items-center align-content-center radio-label" for="callback_noalt">\n                                        <input name="contactThisNumber"\n                                            type="radio"\n                                            id="callback_noalt"\n                                            class="d-inline-block mb-0 flex-shrink-1"\n                                            :aria-label="options.callbackNoOrAlternate"\n                                            :value="false"\n                                            v-model="wantsCallback" />\n                                        <span class="flex-grow-1 flex-shrink-1">{{ options.callbackNoOrAlternate }}<\/span>\n                                    <\/label>\n                                <\/li>\n                            <\/ul>\n                            <div v-show="!wantsCallback" class="mt-1 outages__alt-form">\n                                <label for="preferredCallback" class="d-block">{{options.alternateCallbackInputLabel}}<\/label>\n                                <input type="tel"\n                                    class="d-inline-block"\n                                    id="preferredCallback"\n                                    name="preferredCallback"\n                                    max-length="14"\n                                    :aria-label="options.alternateCallbackInputLabel"\n                                    v-model="preferredCallback"/>\n                                <p class="form__error my-0 font-weight-bold" v-show="!isFormValid && hasUserSubmitted">{{ options.noCallbackErrorMessage }}<\/p>\n                                <strong class="d-block pb-2">{{options.noCallbackSwitchLabel}}<\/strong>\n                                <label for="doNotCallToConfirm" class="d-inline-block cursor-pointer">\n                                    <input type="checkbox" id="doNotCallToConfirm" name="doNotCallToConfirm" v-model="doNotCallToConfirm" />\n                                    <span class="ml-2">{{options.noCallbackOption}}<\/span>\n                                <\/label>\n                                <br />\n                                <a :href="options.whyNoCallbackBadLink.link" class="font-weight-bold outages__alt-form__no-callback-link">{{options.whyNoCallbackBadLink.title}}<\/a>\n                            <\/div>\n                            <p v-show="!isLoading && currErrorMessage.length > 0" class="form__error form__error--large font-weight-bold mt-3">{{ currErrorMessage }}<\/p>\n                            <button type="submit" class="button button--default mt-4" :class="{ disabled: !isFormValid || hasUserSubmitted }">{{options.reportOutageButton}}<\/button>\n                        <\/form>\n                    <\/div>\n\n                    <!-- Current Outage Status -->\n                    <div v-else class="outages__status-report" v-show="!isLoading">\n                        <h3>{{options.outageStatusHeader}}<\/h3>\n\n                        <span><b>{{ formatOutageStatusLabel(options.locationLabel) }}<\/b> {{outage.streetAddress}}, {{outage.city}}<\/span><br/>\n                        <span><b>{{ formatOutageStatusLabel(options.etrLabel) }}<\/b> {{ formatOutageETR(outage.etr) }}<\/span><br/>\n                        <span><b>{{ formatOutageStatusLabel(options.statusLabel) }}<\/b> {{getTextFromStatus(outage.outageStatus)}}<\/span><br/>\n                        <span><b>{{ formatOutageStatusLabel(options.notesLabel) }}<\/b> {{outage.comments || \'N/A\'}}<\/span><br/>\n\n                        <!-- If this Account has not reported an outage, yet... let them -->\n                        <template v-if="wasOutagePredicted">\n                            <p class="mt-4 font-weight-bold">{{options.confirmOutageText}}<\/p>\n                            <a href="#" @click="onConfirmOutage(this)" class="button button--default d-inline-block mb-2">{{options.confirmOutageButton}}<\/a>\n                        <\/template>\n\n                        <p class="mt-4 font-weight-bold">{{options.setupAlertsPrompt}}<\/p>\n                        <a :href="options.setupAlertsLink.link" class="button button--info d-inline-block mb-2">{{options.setupAlertsLink.title}}<\/a>\n                    <\/div>\n                <\/template>\n\n                <!-- After New Outage Has Been Reported -->\n                <div v-if="outageReported && outage" v-show="!isLoading">\n                    <h3>{{ options.outageReportedHeader }}<\/h3>\n                    <hr/>\n                    <dynamic-label :templateContent="options.outageReportedText"\n                        :tagName="\'h3\'"\n                        :extraClasses="\'h4\'"\n                        :address="outage.streetAddress"\n                        :city="outage.city">\n                    <\/dynamic-label>\n                    <div class="alert alert--danger my-4" v-html="options.outageWarningsContent"><\/div>\n                    <p class="font-weight-bold">{{options.setupAlertsPrompt}}<\/p>\n\n                    <a :href="options.setupAlertsLink.link" class="button button--default">{{options.setupAlertsLink.title}}<\/a>\n                <\/div>\n            <\/div>\n            <ul class="mt-4 list-reset">\n                <li>\n                    <a :href="options.stormsAndOutagesLink.link" class="outages__bottom-links">{{options.stormsAndOutagesLink.title}}<\/a>\n                <\/li>\n                <li class="mt-2">\n                    <a :href="options.outagePriorityLink.link" class="outages__bottom-links">{{options.outagePriorityLink.title}}<\/a>\n                <\/li>\n                <li class="mt-2">\n                    <a :href="options.contactUsLink.link" class="outages__bottom-links">{{options.contactUsLink.title}}<\/a>\n                <\/li>\n            <\/ul>\n        <\/div>\n    '})],t)}(i.Vue);t["default"]=p});define("apps/vue-init",["require","exports","vue-property-decorator"],function(n,t,i){Object.defineProperty(t,"__esModule",{value:!0});i.Vue.config.productionTip=!1});define("components/fuelswitching-calculator",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(n){var t=this;this.DataLoaded=!1;this.numbrOfGalPerYearOil="850";this.numbrOfGalPerYearPropane="950";this.fuelSwitchClicked=!1;this.boilerFurClicked=!1;this.primaryHeatingSource="";this.cleanHeatingSource="";this.boilerOrFurnaceOption="";this.utilityBillAmount=0;this.utilityBillDuration="";this.fuelGallonsAnnual=0;this.fuelPricePerGallonAnnual=0;this.fuelFreq="";this.fuelSwitch="";this.options=n;$(".fuelswitching-calculator #electric, .fuelswitching-calculator #natural-gas, .fuelswitching-calculator #propane, .fuelswitching-calculator #oil").click(function(n){t.Question3Enable(n.target)});$(".fuelswitching-calculator #heat-pump-btn, .fuelswitching-calculator #geo-btn, .fuelswitching-calculator #gas-btn").click(function(n){t.SetSwitch(n.target)});$(".fuelswitching-calculator #btnmonthly, .fuelswitching-calculator #btnyearly").click(function(n){t.setFuelFreq(n.target)});$(".fuelswitching-calculator #boiler-btn, .fuelswitching-calculator #furnace-btn").click(function(n){t.SetBoilerOrFurnace(n.target)});$(".fuelswitching-calculator #btnCalculate").click(function(){t.OnCalculateClick()});$(".fuelswitching-calculator #input-dollars, .fuelswitching-calculator #input-gal, .fuelswitching-calculator #UpCostDuctlessASHP, .fuelswitching-calculator #UpCostDuctASHP, .fuelswitching-calculator #UpCostGeothermal, .fuelswitching-calculator #UpCostNatGas").keypress(function(n){return t.IsNumberKey(n)});$(".fuelswitching-calculator #input-price").keypress(function(n){return t.IsDecimalKey(n)})}return n.prototype.InsertFuelSwitchPreferences=function(){var n={};n.primaryHeatingSource=this.primaryHeatingSource;n.cleanHeatingSource=this.cleanHeatingSource;this.fuelType=parseInt($(".fuelswitching-calculator input[name=fuel-method]:checked").val());this.fuelType==1||this.fuelType==2?(n.utilityBillAmount=Number($(".fuelswitching-calculator #input-dollars").val()),n.utilityBillDuration=this.fuelFreq,n.fuelPricePerGallonAnnual=0,n.fuelGallonsAnnual=0):(n.utilityBillAmount=0,n.fuelPricePerGallonAnnual=Number($(".fuelswitching-calculator #input-price").val()),n.fuelGallonsAnnual=Number($(".fuelswitching-calculator #input-gal").val()),n.utilityBillDuration="");n.boilerOrFurnaceOption=this.boilerOrFurnaceOption;$.ajax({type:"POST",url:"/api/calculators/fuel-switching",data:__assign({__RequestVerificationToken:$('[name="__RequestVerificationToken"]').last().val().toString()},n),dataType:"json",success:function(n){n.errorMsg!=null&&alert("These calculations are currently unavailable. Please try again later.")},error:function(){alert("These calculations are currently unavailable. Please try again later.")}})},n.prototype.OnCalculateClick=function(){this.DataLoaded||(this.setDefaultFuelSwitchData(),this.DataLoaded=!0);this.Recalculate();this.InsertFuelSwitchPreferences()},n.prototype.ValidateUpfrontCost=function(){return $(".fuelswitching-calculator #UpCostDuctlessASHP").val()<1||$(".fuelswitching-calculator #UpCostDuctlessASHP").val()>999999?(alert("Please enter Upfront cost ranging from 1 to 999999"),!1):$(".fuelswitching-calculator #UpCostDuctASHP").val()<1||$(".fuelswitching-calculator #UpCostDuctASHP").val()>999999?(alert("Please enter Upfront cost ranging from 1 to 999999"),!1):$(".fuelswitching-calculator #UpCostGeothermal").val()<1||$(".fuelswitching-calculator #UpCostGeothermal").val()>999999?(alert("Please enter Upfront cost ranging from 1 to 999999"),!1):($(".fuelswitching-calculator #UpCostNatGas").val()<1||$(".fuelswitching-calculator #UpCostNatGas").val()>999999)&&(this.fuelType=parseInt($(".fuelswitching-calculator input[name=fuel-method]:checked").val()),this.fuelType==1||this.fuelType==3||this.fuelType==4)?(alert("Please enter Upfront cost ranging from 1 to 999999"),!1):!0},n.prototype.SetUpFrontCosts=function(){this.fuelType=parseInt($(".fuelswitching-calculator input[name=fuel-method]:checked").val());this.fuelType==1&&(this.activeboiler?$(".fuelswitching-calculator #UpCostNatGas").val(this.options.electricToNatGasBoiler):$(".fuelswitching-calculator #UpCostNatGas").val(this.options.electricToNatGasFurnace));this.fuelType==3&&(this.activeboiler?$(".fuelswitching-calculator #UpCostNatGas").val(this.options.propaneToNatGasBoiler):$(".fuelswitching-calculator #UpCostNatGas").val(this.options.propaneToNatGasFurnace));this.fuelType==4&&(this.activeboiler?$(".fuelswitching-calculator #UpCostNatGas").val(this.options.fueloilToNatGasBoiler):$(".fuelswitching-calculator #UpCostNatGas").val(this.options.fueloilToNatGasFurnace))},n.prototype.Recalculate=function(){if(document.getElementById("table").style.visibility="visible",document.getElementById("divDisclaimer").style.visibility="visible",this.DataLoaded&&(this.activeboiler?(this.furBoilerFlag&&(this.SetUpFrontCosts(),$(".fuelswitching-calculator #UpCostDuctASHP").val(this.options.upfrontCostDuctedAshp),$(".fuelswitching-calculator #UpCostDuctlessASHP").val(this.options.upfrontCostDuctlessAshp),$(".fuelswitching-calculator #UpCostGeothermal").val(this.options.upfrontCostGshp),this.furBoilerFlag=!1),$(".fuelswitching-calculator #NysNatGas").val(this.options.nyserdaNatGasBoiler),$(".fuelswitching-calculator #ChIncNatGas").val(this.options.chIncentiveNatGasBoiler),$(".fuelswitching-calculator #FedTxNatGas").val(this.options.federalTaxNatGasBoiler),$(".fuelswitching-calculator #RateImpNatGas").val(this.options.rateImpactCreditNatGasBoiler)):(this.furBoilerFlag&&(this.SetUpFrontCosts(),$(".fuelswitching-calculator #UpCostDuctASHP").val(this.options.upfrontCostDuctedAshp),$(".fuelswitching-calculator #UpCostDuctlessASHP").val(this.options.upfrontCostDuctlessAshp),$(".fuelswitching-calculator #UpCostGeothermal").val(this.options.upfrontCostGshp),this.furBoilerFlag=!1),$(".fuelswitching-calculator #NysNatGas").val(this.options.nyserdaNatGasFurnace),$(".fuelswitching-calculator #ChIncNatGas").val(this.options.chIncentiveNatGasFurnace),$(".fuelswitching-calculator #FedTxNatGas").val(this.options.federalTaxNatGasFurnace),$(".fuelswitching-calculator #RateImpNatGas").val(this.options.rateImpactCreditNatGasFurnace)),this.ValidateUpfrontCost(),$(".fuelswitching-calculator #btnCalculate").html("<h3>RE-CALCULATE<\/h3>"),this.fuelType=parseInt($(".fuelswitching-calculator input[name=fuel-method]:checked").val()),this.fuelType==1&&(this.primaryHeatingSource="Electric"),this.fuelType==2&&(this.primaryHeatingSource="Natural Gas"),this.fuelType==3&&(this.primaryHeatingSource="Propane"),this.fuelType==4&&(this.primaryHeatingSource="Oil"),this.ApplyHighlighting(this.fuelSwitch),this.fuelType==2&&($(".fuelswitching-calculator #gas-btn").attr("style","background-color: #d2d2d2;border-color:#d2d2d2;margin-bottom: 10px;"),$(".fuelswitching-calculator table tr > td:nth-child(5), .fuelswitching-calculator table tr > th:nth-child(5)").attr("style","vertical-align:middle;")),(this.fuelType==3||this.fuelType==4)&&($(".fuelswitching-calculator #ChIncDuctASHP").val(this.options.chIncentiveDuctedAshpFuelOrPropane),$(".fuelswitching-calculator #ChIncDuctlessASHP").val(this.options.chIncentiveDuctlessAshpFuelOrPropane)),this.fuelType==2&&($(".fuelswitching-calculator #ChIncDuctASHP").val(this.options.chIncentiveDuctedAshpNatGas),$(".fuelswitching-calculator #ChIncDuctlessASHP").val(this.options.chIncentiveDuctlessAshpNatGas)),this.fuelType==1&&($(".fuelswitching-calculator #ChIncDuctASHP").val(this.options.chIncentiveDuctedAshpElectric),$(".fuelswitching-calculator #ChIncDuctlessASHP").val(this.options.chIncentiveDuctlessAshpElectric)),$(".fuelswitching-calculator #ChIncGeothermal").val(this.options.chIncentiveGshp),this.activeboiler?$(".fuelswitching-calculator #ChIncNatGas").val(this.options.chIncentiveNatGasBoiler):$(".fuelswitching-calculator #ChIncNatGas").val(this.options.chIncentiveNatGasFurnace)),$(".fuelswitching-calculator #FedTxGeothermal").val(parseFloat((Number($(".fuelswitching-calculator #UpCostGeothermal").val())*this.options.fedTaxCreditPercentGshp).toString()).toFixed(0)),$(".fuelswitching-calculator #IncTotalDuctlessASHP").val(Number($(".fuelswitching-calculator #RateImpDuctlessASHP").val())+Number($(".fuelswitching-calculator #FedTxDuctlessASHP").val())+Number($(".fuelswitching-calculator #ChIncDuctlessASHP").val())+Number($(".fuelswitching-calculator #NysDuctlessASHP").val())),$(".fuelswitching-calculator #IncTotalDuctASHP").val(Number($(".fuelswitching-calculator #RateImpDuctASHP").val())+Number($(".fuelswitching-calculator #FedTxDuctASHP").val())+Number($(".fuelswitching-calculator #ChIncDuctASHP").val())+Number($(".fuelswitching-calculator #NysDuctASHP").val())),$(".fuelswitching-calculator #IncTotalGeothermal").val(Number($(".fuelswitching-calculator #RateImpGeothermal").val())+Number($(".fuelswitching-calculator #FedTxGeothermal").val())+Number($(".fuelswitching-calculator #ChIncGeothermal").val())+Number($(".fuelswitching-calculator #NysGeothermal").val())),$(".fuelswitching-calculator #IncTotalNatGas").val(Number($(".fuelswitching-calculator #RateImpNatGas").val())+Number($(".fuelswitching-calculator #FedTxNatGas").val())+Number($(".fuelswitching-calculator #ChIncNatGas").val())+Number($(".fuelswitching-calculator #NysNatGas").val())),$(".fuelswitching-calculator #ConvCostDuctlessASHP").val(Number($(".fuelswitching-calculator #UpCostDuctlessASHP").val())-Number($(".fuelswitching-calculator #IncTotalDuctlessASHP").val())),$(".fuelswitching-calculator #ConvCostDuctASHP").val(Number($(".fuelswitching-calculator #UpCostDuctASHP").val())-Number($(".fuelswitching-calculator #IncTotalDuctASHP").val())),$(".fuelswitching-calculator #ConvCostGeothermal").val(Number($(".fuelswitching-calculator #UpCostGeothermal").val())-Number($(".fuelswitching-calculator #IncTotalGeothermal").val())),$(".fuelswitching-calculator #ConvCostNatGas").val(Number($(".fuelswitching-calculator #UpCostNatGas").val())-Number($(".fuelswitching-calculator #IncTotalNatGas").val())),this.fuelType=parseInt($(".fuelswitching-calculator input[name=fuel-method]:checked").val()),this.fuelType==3||this.fuelType==4?($(".fuelswitching-calculator #CurAnnCostDuctlessASHP").val((Number($(".fuelswitching-calculator #input-gal").val())*Number($(".fuelswitching-calculator #input-price").val())).toFixed(2)),$(".fuelswitching-calculator #CurAnnCostDuctASHP").val((Number($(".fuelswitching-calculator #input-gal").val())*Number($(".fuelswitching-calculator #input-price").val())).toFixed(2)),$(".fuelswitching-calculator #CurAnnCostGeoThermal").val((Number($(".fuelswitching-calculator #input-gal").val())*Number($(".fuelswitching-calculator #input-price").val())).toFixed(2)),$(".fuelswitching-calculator #CurAnnCostNatGas").val((Number($(".fuelswitching-calculator #input-gal").val())*Number($(".fuelswitching-calculator #input-price").val())).toFixed(2))):this.fuelFreq=="monthly"?($(".fuelswitching-calculator #CurAnnCostDuctlessASHP").val((Number($(".fuelswitching-calculator #input-dollars").val())*12).toFixed(2)),$(".fuelswitching-calculator #CurAnnCostDuctASHP").val((Number($(".fuelswitching-calculator #input-dollars").val())*12).toFixed(2)),$(".fuelswitching-calculator #CurAnnCostGeoThermal").val((Number($(".fuelswitching-calculator #input-dollars").val())*12).toFixed(2)),$(".fuelswitching-calculator #CurAnnCostNatGas").val((Number($(".fuelswitching-calculator #input-dollars").val())*12).toFixed(2))):($(".fuelswitching-calculator #CurAnnCostDuctlessASHP").val(Number($(".fuelswitching-calculator #input-dollars").val()).toFixed(2)),$(".fuelswitching-calculator #CurAnnCostDuctASHP").val(Number($(".fuelswitching-calculator #input-dollars").val()).toFixed(2)),$(".fuelswitching-calculator #CurAnnCostGeoThermal").val(Number($(".fuelswitching-calculator #input-dollars").val()).toFixed(2)),$(".fuelswitching-calculator #CurAnnCostNatGas").val(Number($(".fuelswitching-calculator #input-dollars").val()).toFixed(2))),this.fuelType==1){var n=0,a=0,t=0,v=0,u=0,f=0;n=Number($(".fuelswitching-calculator #CurAnnCostDuctlessASHP").val())/this.options.electricRatePerKwh;t=n*this.options.factorMilesPerlbCO2*this.options.factorLbCO2KWH;a=n*this.options.factorElectricToAshp;v=a*this.options.factorMilesPerlbCO2*this.options.factorLbCO2KWH;u=a*this.options.electricRatePerKwh;f=Number($(".fuelswitching-calculator #CurAnnCostDuctlessASHP").val())-Math.round(u);$(".fuelswitching-calculator #milesASHP").html(Math.round(t-v).toString());$(".fuelswitching-calculator #milesASHPDuct").html(Math.round(t-v).toString());var y=0,yt=0,p=0,e=0;y=n*this.options.factorElectricToGSHP;yt=y*this.options.factorMilesPerlbCO2*this.options.factorLbCO2KWH;p=y*this.options.electricRatePerKwh;e=Number($(".fuelswitching-calculator #CurAnnCostGeoThermal").val())-Math.round(p);$(".fuelswitching-calculator #milesGeothermal").html(Math.round(t-yt).toString());var pt=0,w=0,b=0,k=0;w=n*this.options.factorElectricToNatGas;pt=w*this.options.factorMilesPerlbCO2*this.options.factorLbCO2THERM;b=w*this.options.naturalGasRatePerTherm;k=Number($(".fuelswitching-calculator #CurAnnCostNatGas").val())-Math.round(b);$(".fuelswitching-calculator #milesNatGas").html(Math.round(t-pt).toString());$(".fuelswitching-calculator #FutAnnCostDuctlessASHP").val(Math.round(u));$(".fuelswitching-calculator #FutAnnCostDuctASHP").val(Math.round(u));$(".fuelswitching-calculator #FutAnnCostGeoThermal").val(Math.floor(p));$(".fuelswitching-calculator #FutAnnCostNatGas").val(Math.floor(b))}if(this.fuelType==3){var i=0,d=0,g=0,o=0,f=0;i=Number($(".fuelswitching-calculator #input-gal").val())*this.options.factorMilesPerlbCO2*this.options.factorLbCO2GalPropane;d=Number($(".fuelswitching-calculator #input-gal").val())*this.options.factorPropaneToAshp;g=d*this.options.factorMilesPerlbCO2*this.options.factorLbCO2KWH;o=d*this.options.electricRatePerKwh;f=Number($(".fuelswitching-calculator #CurAnnCostDuctlessASHP").val())-Math.round(o);$(".fuelswitching-calculator #milesASHP").html(Math.round(i-g).toString());$(".fuelswitching-calculator #milesASHPDuct").html(Math.round(i-g).toString());var nt=0,wt=0,tt=0,e=0;nt=Number($(".fuelswitching-calculator #input-gal").val())*this.options.factorPropaneToGshp;wt=nt*this.options.factorMilesPerlbCO2*this.options.factorLbCO2KWH;tt=nt*this.options.electricRatePerKwh;e=Number($(".fuelswitching-calculator #CurAnnCostGeoThermal").val())-Math.round(tt);$(".fuelswitching-calculator #milesGeothermal").html(Math.round(i-wt).toString());var it=0,bt=0,rt=0,k=0;it=Number($(".fuelswitching-calculator #input-gal").val())*this.options.factorPropaneToNatGas;bt=it*this.options.factorMilesPerlbCO2*this.options.factorLbCO2THERM;rt=it*this.options.naturalGasRatePerTherm;k=Number($(".fuelswitching-calculator #CurAnnCostNatGas").val())-Math.round(rt);$(".fuelswitching-calculator #milesNatGas").html(Math.round(i-bt).toString());$(".fuelswitching-calculator #FutAnnCostDuctlessASHP").val(Math.round(o));$(".fuelswitching-calculator #FutAnnCostDuctASHP").val(Math.round(o));$(".fuelswitching-calculator #FutAnnCostGeoThermal").val(Math.round(tt));$(".fuelswitching-calculator #FutAnnCostNatGas").val(Math.round(rt))}if(this.fuelType==4){var r=0,ut=0,ft=0,s=0,f=0;r=Number($(".fuelswitching-calculator #input-gal").val())*this.options.factorMilesPerlbCO2*this.options.factorLbCO2GalFuelOil;ut=Number($(".fuelswitching-calculator #input-gal").val())*this.options.factorFueloilToAshp;ft=ut*this.options.factorMilesPerlbCO2*this.options.factorLbCO2KWH;s=ut*this.options.electricRatePerKwh;f=Number($(".fuelswitching-calculator #CurAnnCostDuctlessASHP").val())-Math.round(s);$(".fuelswitching-calculator #milesASHP").html(Math.round(r-ft).toString());$(".fuelswitching-calculator #milesASHPDuct").html(Math.round(r-ft).toString());var et=0,kt=0,ot=0,e=0;et=Number($(".fuelswitching-calculator #input-gal").val())*this.options.factorFueloilToGshp;kt=et*this.options.factorMilesPerlbCO2*this.options.factorLbCO2KWH;ot=et*this.options.electricRatePerKwh;e=Number($(".fuelswitching-calculator #CurAnnCostGeoThermal").val())-Math.round(ot);$(".fuelswitching-calculator #milesGeothermal").html(Math.round(r-kt).toString());var st=0,dt=0,ht=0,k=0;st=Number($(".fuelswitching-calculator #input-gal").val())*this.options.factorFueloilToNatGas;dt=st*this.options.factorMilesPerlbCO2*this.options.factorLbCO2THERM;ht=st*this.options.naturalGasRatePerTherm;k=Number($(".fuelswitching-calculator #CurAnnCostNatGas").val())-Math.round(ht);$(".fuelswitching-calculator #milesNatGas").html(Math.round(r-dt).toString());$(".fuelswitching-calculator #FutAnnCostDuctlessASHP").val(Math.round(s));$(".fuelswitching-calculator #FutAnnCostDuctASHP").val(Math.round(s));$(".fuelswitching-calculator #FutAnnCostGeoThermal").val(Math.round(ot));$(".fuelswitching-calculator #FutAnnCostNatGas").val(Math.round(ht))}if(this.fuelType==2){$(".fuelswitching-calculator table tr > td:nth-child(5), .fuelswitching-calculator table tr > th:nth-child(5)").find(":input").val(0);var h=0,c=0,ct=0,lt=0,l=0,f=0;h=Number($(".fuelswitching-calculator #CurAnnCostDuctlessASHP").val())/this.options.naturalGasRatePerTherm;c=h*this.options.factorMilesPerlbCO2*this.options.factorLbCO2THERM;ct=h*this.options.factorNatGasToAshp;lt=ct*this.options.factorLbCO2KWH*this.options.factorMilesPerlbCO2;l=ct*this.options.electricRatePerKwh;f=Number($(".fuelswitching-calculator #CurAnnCostDuctlessASHP").val())-Math.round(l);$(".fuelswitching-calculator #milesASHP").html(Math.round(c-lt).toString());$(".fuelswitching-calculator #milesASHPDuct").html(Math.round(c-lt).toString());$(".fuelswitching-calculator #FutAnnCostDuctlessASHP").val(Math.round(l));$(".fuelswitching-calculator #FutAnnCostDuctASHP").val(Math.round(l));var at=0,gt=0,vt=0,e=0;at=h*this.options.factorNatGasToGshp;gt=at*this.options.factorLbCO2KWH*this.options.factorMilesPerlbCO2;vt=at*this.options.electricRatePerKwh;e=Number($(".fuelswitching-calculator #CurAnnCostGeoThermal").val())-Math.round(vt);$(".fuelswitching-calculator #milesGeothermal").html(Math.round(c-gt).toString());$(".fuelswitching-calculator #FutAnnCostGeoThermal").val(Math.round(vt));$(".fuelswitching-calculator #ROICostNatGas").val(0);$(".fuelswitching-calculator #milesNatGas").html("0")}$(".fuelswitching-calculator #AnnSavDuctlessASHP").val((Number($(".fuelswitching-calculator #CurAnnCostDuctlessASHP").val())-Number($(".fuelswitching-calculator #FutAnnCostDuctlessASHP").val())).toFixed(2));$(".fuelswitching-calculator #AnnSavCostDuctASHP").val((Number($(".fuelswitching-calculator #CurAnnCostDuctASHP").val())-Number($(".fuelswitching-calculator #FutAnnCostDuctASHP").val())).toFixed(2));$(".fuelswitching-calculator #AnnSavCostGeoThermal").val((Number($(".fuelswitching-calculator #CurAnnCostGeoThermal").val())-Number($(".fuelswitching-calculator #FutAnnCostGeoThermal").val())).toFixed(2));$(".fuelswitching-calculator #AnnSavCostNatGas").val((Number($(".fuelswitching-calculator #CurAnnCostNatGas").val())-Number($(".fuelswitching-calculator #FutAnnCostNatGas").val())).toFixed(2));$(".fuelswitching-calculator #ROIDuctlessASHP").val(Math.round(10*Number($(".fuelswitching-calculator #ConvCostDuctlessASHP").val())/Number($(".fuelswitching-calculator #AnnSavDuctlessASHP").val()))/10);$(".fuelswitching-calculator #ROICostDuctASHP").val(Math.round(10*Number($(".fuelswitching-calculator #ConvCostDuctASHP").val())/Number($(".fuelswitching-calculator #AnnSavCostDuctASHP").val()))/10);$(".fuelswitching-calculator #ROICostGeoThermal").val(Math.round(10*Number($(".fuelswitching-calculator #ConvCostGeothermal").val())/Number($(".fuelswitching-calculator #AnnSavCostGeoThermal").val()))/10);this.fuelType==2?$(".fuelswitching-calculator #ROICostNatGas").val(0):$(".fuelswitching-calculator #ROICostNatGas").val(Math.round(10*Number($(".fuelswitching-calculator #ConvCostNatGas").val())/Number($(".fuelswitching-calculator #AnnSavCostNatGas").val()))/10);$(".fuelswitching-calculator #milesASHP").attr("style","");$(".fuelswitching-calculator #Span1").attr("style","");$(".fuelswitching-calculator #milesASHPDuct").attr("style","");$(".fuelswitching-calculator #Span3").attr("style","");$(".fuelswitching-calculator #milesGeothermal").attr("style","");$(".fuelswitching-calculator #Span4").attr("style","");$(".fuelswitching-calculator #milesNatGas").attr("style","");$(".fuelswitching-calculator #Span5").attr("style","");$(".fuelswitching-calculator #tdmilesASHP").attr("style","");$(".fuelswitching-calculator #tdmilesASHPDuct").attr("style","");$(".fuelswitching-calculator #tdmilesGeothermal").attr("style","");$(".fuelswitching-calculator #tdmilesNatGas").attr("style","");$(".fuelswitching-calculator #ASHPCar").attr("src","/Static/images/fuelswitching-calculator/car_icon.png");$(".fuelswitching-calculator #ASHPDlessCar").attr("src","/Static/images/fuelswitching-calculator/car_icon.png");$(".fuelswitching-calculator #GeothCar").attr("src","/Static/images/fuelswitching-calculator/car_icon.png");$(".fuelswitching-calculator #NatCar").attr("src","/Static/images/fuelswitching-calculator/car_icon.png");this.fuelSwitch=="heat-pump-btn"&&($(".fuelswitching-calculator #tdmilesASHP").attr("style","background-color: #39c7cf;"),$(".fuelswitching-calculator #milesASHP").attr("style","color: white;"),$(".fuelswitching-calculator #Span1").attr("style","color: white;"),$(".fuelswitching-calculator #ASHPCar").attr("src","/Static/images/fuelswitching-calculator/car_icon_white.png"),$(".fuelswitching-calculator #tdmilesASHPDuct").attr("style","background-color: #39c7cf;"),$(".fuelswitching-calculator #milesASHPDuct").attr("style","color: white;"),$(".fuelswitching-calculator #Span3").attr("style","color: white;"),$(".fuelswitching-calculator #ASHPDlessCar").attr("src","/Static/images/fuelswitching-calculator/car_icon_white.png"));this.fuelSwitch=="geo-btn"&&($(".fuelswitching-calculator #tdmilesGeothermal").attr("style","background-color: #39c7cf;"),$(".fuelswitching-calculator #milesGeothermal").attr("style","color: white;"),$(".fuelswitching-calculator #Span4").attr("style","color: white;"),$(".fuelswitching-calculator #GeothCar").attr("src","/Static/images/fuelswitching-calculator/car_icon_white.png"));this.fuelSwitch=="gas-btn"&&($(".fuelswitching-calculator #tdmilesNatGas").attr("style","background-color: #39c7cf;"),$(".fuelswitching-calculator #milesNatGas").attr("style","color: white;"),$(".fuelswitching-calculator #Span5").attr("style","color: white;"),$(".fuelswitching-calculator #NatCar").attr("src","/Static/images/fuelswitching-calculator/car_icon_white.png"))},n.prototype.setDefaultFuelSwitchData=function(){$(".fuelswitching-calculator #UpCostDuctlessASHP").val(this.options.upfrontCostDuctlessAshp);$(".fuelswitching-calculator #UpCostDuctASHP").val(this.options.upfrontCostDuctedAshp);$(".fuelswitching-calculator #UpCostGeothermal").val(this.options.upfrontCostGshp);this.SetUpFrontCosts();$(".fuelswitching-calculator #NysDuctlessASHP").val(this.options.nyserdaDuctlessAshp);$(".fuelswitching-calculator #NysDuctASHP").val(this.options.nyserdaDuctedAshp);$(".fuelswitching-calculator #NysGeothermal").val(this.options.nyserdaGshp);this.activeboiler?$(".fuelswitching-calculator #NysNatGas").val(this.options.nyserdaNatGasBoiler):$(".fuelswitching-calculator #NysNatGas").val(this.options.nyserdaNatGasFurnace);this.fuelType=parseInt($(".fuelswitching-calculator input[name=fuel-method]:checked").val());(this.fuelType==3||this.fuelType==4)&&($(".fuelswitching-calculator #ChIncDuctASHP").val(this.options.chIncentiveDuctedAshpFuelOrPropane),$(".fuelswitching-calculator #ChIncDuctlessASHP").val(this.options.chIncentiveDuctlessAshpFuelOrPropane));this.fuelType==2&&($(".fuelswitching-calculator #ChIncDuctASHP").val(this.options.chIncentiveDuctedAshpNatGas),$(".fuelswitching-calculator #ChIncDuctlessASHP").val(this.options.chIncentiveDuctlessAshpNatGas));this.fuelType==1&&($(".fuelswitching-calculator #ChIncDuctASHP").val(this.options.chIncentiveDuctedAshpElectric),$(".fuelswitching-calculator #ChIncDuctlessASHP").val(this.options.chIncentiveDuctlessAshpElectric));$(".fuelswitching-calculator #ChIncGeothermal").val(this.options.chIncentiveGshp);this.activeboiler?$(".fuelswitching-calculator #ChIncNatGas").val(this.options.chIncentiveNatGasBoiler):$(".fuelswitching-calculator #ChIncNatGas").val(this.options.chIncentiveNatGasFurnace);$(".fuelswitching-calculator #FedTxDuctlessASHP").val(this.options.federalTaxDuctlessAshp);$(".fuelswitching-calculator #FedTxDuctASHP").val(this.options.federalTaxDuctedAshp);$(".fuelswitching-calculator #FedTxGeothermal").val(this.options.fedTaxCreditPercentGshp*this.options.upfrontCostGshp);this.activeboiler?$(".fuelswitching-calculator #FedTxNatGas").val(this.options.federalTaxNatGasBoiler):$(".fuelswitching-calculator #FedTxNatGas").val(this.options.federalTaxNatGasFurnace);$(".fuelswitching-calculator #RateImpDuctlessASHP").val(this.options.rateImpactCreditDuctlessAshp);$(".fuelswitching-calculator #RateImpDuctASHP").val(this.options.rateImpactCreditDuctedAshp);$(".fuelswitching-calculator #RateImpGeothermal").val(this.options.rateImpactCreditGshp*this.options.rateImpactCreditMultiplierGshp);this.activeboiler?$(".fuelswitching-calculator #RateImpNatGas").val(this.options.rateImpactCreditNatGasBoiler):$(".fuelswitching-calculator #RateImpNatGas").val(this.options.rateImpactCreditNatGasFurnace)},n.prototype.IsNumberKey=function(n){var t=n.which?n.which:event.keyCode;return t>31&&(t<48||t>57)?!1:!0},n.prototype.IsDecimalKey=function(n){var t=n.which?n.which:event.keyCode;return t>31&&t!=46&&(t<48||t>57)?!1:!0},n.prototype.Question3Enable=function(n){var t=parseInt(n.value);this.ClearHighlighting();$(".fuelswitching-calculator #boiler-btn").attr("style","background-color: #138496;margin-bottom: 10px;");$(".fuelswitching-calculator #furnace-btn").attr("style","background-color: #138496;margin-bottom: 10px;");this.SetColumnWidth();$(".fuelswitching-calculator #btnCalculate").prop("disabled",!0);t==1||t==2?(t==2?($(".fuelswitching-calculator #gas-btn").attr("style","background-color: #d2d2d2;border-color:#d2d2d2;margin-bottom: 10px;"),$(".fuelswitching-calculator #gas-btn").prop("disabled",!0),$(".fuelswitching-calculator table tr > td:nth-child(5), table tr > th:nth-child(5)").find(":input").prop("disabled",!0),$(".fuelswitching-calculator table tr > td:nth-child(5), table tr > th:nth-child(5)").find(":input").val(0),$(".fuelswitching-calculator #lblSpend").html("Spend on Natural Gas bill?"),$(".fuelswitching-calculator #lblbilerfurnace").html(" Do you have a boiler or a furnace?")):($(".fuelswitching-calculator #gas-btn").attr("style","background-color: #138496;border-color:#17a2b8;margin-bottom: 10px;"),$(".fuelswitching-calculator #gas-btn").prop("disabled",!1),$(".fuelswitching-calculator table tr > td:nth-child(5), .fuelswitching-calculator table tr > th:nth-child(5)").find(":input").prop("disabled",!0),$(".fuelswitching-calculator #UpCostNatGas").prop("disabled",!1),$(".fuelswitching-calculator #lblSpend").html("Spend on Electric bill?"),$(".fuelswitching-calculator #lblbilerfurnace").html(" Would you like a boiler or a furnace?"),this.furBoilerFlag&&this.SetUpFrontCosts()),this.setFuelRate(n),document.getElementById("input-gal").value="",$(".fuelswitching-calculator #option-1").removeClass("d-none"),$(".fuelswitching-calculator #option-2").addClass("d-none")):($(".fuelswitching-calculator #gas-btn").attr("style","background-color: #138496;border-color:#17a2b8;margin-bottom: 10px;"),$(".fuelswitching-calculator #option-2").removeClass("d-none"),$(".fuelswitching-calculator #option-1").addClass("d-none"),t==3?($(".fuelswitching-calculator #lblSpend").html("Spend on Propane bill?"),$(".fuelswitching-calculator #lblbilerfurnace").html(" Do you have a boiler or a furnace?")):($(".fuelswitching-calculator #lblSpend").html("Spend on Fuel Oil bill?"),$(".fuelswitching-calculator #lblbilerfurnace").html(" Do you have a boiler or a furnace?")),$(".fuelswitching-calculator #gas-btn").prop("disabled",!1),$(".fuelswitching-calculator #UpCostNatGas").prop("disabled",!1),this.furBoilerFlag&&this.SetUpFrontCosts(),this.setFuelRate(n),$(".fuelswitching-calculator #input-dollars").val(""))},n.prototype.SetColumnWidth=function(){$(".fuelswitching-calculator #ColASHP").attr("style","background-color: rgb(17, 122, 139);vertical-align:middle;width:18%;");$(".fuelswitching-calculator #ColGSHP").attr("style","background-color: rgb(17, 122, 139);vertical-align:middle;width:18%;");$(".fuelswitching-calculator #ColGeothermal").attr("style","background-color: rgb(17, 122, 139);vertical-align:middle;width:18%;");$(".fuelswitching-calculator #ColNatGas").attr("style","background-color: rgb(17, 122, 139);vertical-align:middle;width:18%;")},n.prototype.setFuelRate=function(n){n.id=="oil"?($(".fuelswitching-calculator #input-price").val(this.options.fuelOilRatePerGallon),$(".fuelswitching-calculator #input-gal").val(this.numbrOfGalPerYearOil)):n.id=="propane"?($(".fuelswitching-calculator #input-price").val(this.options.propaneRatePerGallon),$(".fuelswitching-calculator #input-gal").val(this.numbrOfGalPerYearPropane)):$(".fuelswitching-calculator #input-price").val("")},n.prototype.setFuelFreq=function(n){this.fuelFreq="";this.fuelFreqFlag=!0;n.id=="btnmonthly"?(this.fuelFreq="monthly",$(".fuelswitching-calculator #btnmonthly").attr("style","background-color: #39c7cf;margin-bottom: 10px;"),$(".fuelswitching-calculator #btnyearly").attr("style","background-color: #138496;margin-bottom: 10px;")):n.id=="btnyearly"?(this.fuelFreq="yearly",$(".fuelswitching-calculator #btnyearly").attr("style","background-color: #39c7cf;margin-bottom: 10px;"),$(".fuelswitching-calculator #btnmonthly").attr("style","background-color: #138496;margin-bottom: 10px;")):this.fuelFreq=""},n.prototype.EnableDisableCalculate=function(){this.fuelType=parseInt($(".fuelswitching-calculator input[name=fuel-method]:checked").val());this.fuelSwitchClicked==!1||Number($(".fuelswitching-calculator #input-dollars").val())==0||this.boilerFurClicked==!1||Number($(".fuelswitching-calculator #input-price").val())==0||$(".fuelswitching-calculator #input-price").val()==""||Number($(".fuelswitching-calculator #input-gal").val())==0||$(".fuelswitching-calculator #input-gal").val()==""?($(".fuelswitching-calculator #btnCalculate").prop("disabled",!0),(Number($(".fuelswitching-calculator #input-dollars").val())==0||$(".fuelswitching-calculator #input-dollars").val()=="")&&(this.fuelType==1||this.fuelType==2)&&this.fuelFreqFlag==!1?(alert("Please provide spend on heating"),$(".fuelswitching-calculator #furnace-btn").attr("style","background-color: #138496;margin-bottom: 10px;"),$(".fuelswitching-calculator #boiler-btn").attr("style","background-color: #138496;margin-bottom: 10px;"),$(".fuelswitching-calculator #btnCalculate").prop("disabled",!0)):$(".fuelswitching-calculator #btnCalculate").prop("disabled",!1),this.fuelSwitchClicked==!1&&(alert("Please select Switch to Fuel"),$(".fuelswitching-calculator #furnace-btn").attr("style","background-color: #138496;margin-bottom: 10px;"),$(".fuelswitching-calculator #boiler-btn").attr("style","background-color: #138496;margin-bottom: 10px;"),$(".fuelswitching-calculator #btnCalculate").prop("disabled",!0)),(this.fuelType==1||this.fuelType==2)&&(this.fuelFreqFlag==!1||this.fuelSwitchClicked==!1||Number($(".fuelswitching-calculator #input-dollars").val())==0)&&(alert("Please select Fuel Frequency and Price"),$(".fuelswitching-calculator #furnace-btn").attr("style","background-color: #138496;margin-bottom: 10px;"),$(".fuelswitching-calculator #boiler-btn").attr("style","background-color: #138496;margin-bottom: 10px;"),$(".fuelswitching-calculator #btnCalculate").prop("disabled",!0)),(Number($(".fuelswitching-calculator #input-price").val())==0||$(".fuelswitching-calculator #input-price").val()==""||Number($(".fuelswitching-calculator #input-gal").val())==0||$(".fuelswitching-calculator #input-gal").val()=="")&&(this.fuelType==3||this.fuelType==4)&&(alert("Please provide Gallons and Price values"),$(".fuelswitching-calculator #furnace-btn").attr("style","background-color: #138496;margin-bottom: 10px;"),$(".fuelswitching-calculator #boiler-btn").attr("style","background-color: #138496;margin-bottom: 10px;"),$(".fuelswitching-calculator #btnCalculate").prop("disabled",!0))):$(".fuelswitching-calculator #btnCalculate").prop("disabled",!1)},n.prototype.SetSwitch=function(n){var t=$(".fuelswitching-calculator input[name=fuel-method]:checked").val(),i;this.ClearHighlighting();this.SetColumnWidth();n.id=="heat-pump-btn"?(i=jQuery("table"),this.fuelSwitch="heat-pump-btn",this.cleanHeatingSource="Air Source Heat Pump",this.fuelSwitchClicked=!0,$(".fuelswitching-calculator #heat-pump-btn").attr("style","background-color: #39c7cf;margin-bottom: 10px;"),$(".fuelswitching-calculator #geo-btn").attr("style","background-color: #138496;margin-bottom: 10px;"),t==2?$(".fuelswitching-calculator #gas-btn").attr("style","background-color: #d2d2d2;border-color:#d2d2d2;margin-bottom: 10px;"):$(".fuelswitching-calculator #gas-btn").attr("style","background-color: #138496;margin-bottom: 10px;")):n.id=="geo-btn"?(i=jQuery("table"),this.fuelSwitch="geo-btn",this.cleanHeatingSource="Geothermal",this.fuelSwitchClicked=!0,$(".fuelswitching-calculator #geo-btn").attr("style","background-color: #39c7cf;margin-bottom: 10px;"),$(".fuelswitching-calculator #heat-pump-btn").attr("style","background-color: #138496;margin-bottom: 10px;"),t==2?$(".fuelswitching-calculator #gas-btn").attr("style","background-color: #d2d2d2;border-color:#d2d2d2;margin-bottom: 10px;"):$(".fuelswitching-calculator #gas-btn").attr("style","background-color: #138496;margin-bottom: 10px;")):n.id=="gas-btn"&&(this.fuelSwitch="gas-btn",this.cleanHeatingSource="Natural Gas",this.fuelSwitchClicked=!0,$(".fuelswitching-calculator #gas-btn").attr("style","background-color: #39c7cf;margin-bottom: 10px;"),$(".fuelswitching-calculator #heat-pump-btn").attr("style","background-color: #138496;margin-bottom: 10px;"),$(".fuelswitching-calculator #geo-btn").attr("style","background-color: #138496;margin-bottom: 10px;"))},n.prototype.ApplyHighlighting=function(n){var t=$(".fuelswitching-calculator input[name=fuel-method]:checked").val();this.ClearHighlighting();$(".fuelswitching-calculator #ASHPLearnMore").attr("style","background-color: rgb(17, 122, 139);");$(".fuelswitching-calculator #ASHPDuctedLearnMore").attr("style","background-color: rgb(17, 122, 139);");$(".fuelswitching-calculator #GSHPLearnMore").attr("style","background-color: rgb(17, 122, 139);");$(".fuelswitching-calculator #NatGasLearnMore").attr("style","background-color: rgb(17, 122, 139);");this.SetColumnWidth();n=="heat-pump-btn"&&($(".fuelswitching-calculator table tr > td:nth-child(2), .fuelswitching-calculator table tr > th:nth-child(2)").attr("style","background-color:#39c7cf;"),$(".fuelswitching-calculator table tr > td:nth-child(3), .fuelswitching-calculator table tr > th:nth-child(3)").attr("style","background-color:#39c7cf;"),$(".fuelswitching-calculator #heat-pump-btn").attr("style","background-color: #39c7cf;margin-bottom: 10px;"),$(".fuelswitching-calculator #ASHPLearnMore").attr("style","background-color: rgb(17, 122, 139);"),$(".fuelswitching-calculator #ASHPDuctedLearnMore").attr("style","background-color: rgb(17, 122, 139);"),$(".fuelswitching-calculator #ColASHP").attr("style","background-color: rgb(17, 122, 139);vertical-align:middle;width:18%;"),$(".fuelswitching-calculator #ColGSHP").attr("style","background-color: rgb(17, 122, 139);vertical-align:middle;width:18%;"));n=="geo-btn"&&($(".fuelswitching-calculator table tr > td:nth-child(4), .fuelswitching-calculator table tr > th:nth-child(4)").attr("style","background-color:#39c7cf;vertical-align:middle;"),$(".fuelswitching-calculator #geo-btn").attr("style","background-color: #39c7cf;margin-bottom: 10px;"),$(".fuelswitching-calculator #GSHPLearnMore").attr("style","background-color: rgb(17, 122, 139);"),$(".fuelswitching-calculator #ColGeothermal").attr("style","background-color: rgb(17, 122, 139);vertical-align:middle;width:18%;"));n=="gas-btn"&&($(".fuelswitching-calculator table tr > td:nth-child(5), .fuelswitching-calculator table tr > th:nth-child(5)").attr("style","background-color:#39c7cf;vertical-align:middle;"),$(".fuelswitching-calculator #gas-btn").attr("style","background-color: #39c7cf;margin-bottom: 10px;"),$(".fuelswitching-calculator #NatGasLearnMore").attr("style","background-color: rgb(17, 122, 139);"),$(".fuelswitching-calculator #ColNatGas").attr("style","background-color: rgb(17, 122, 139);vertical-align:middle;width:18%;"))},n.prototype.ClearHighlighting=function(){$(".fuelswitching-calculator #heat-pump-btn").attr("style","background-color: #138496;margin-bottom: 10px;");$(".fuelswitching-calculator #geo-btn").attr("style","background-color: #138496;margin-bottom: 10px;");$(".fuelswitching-calculator #gas-btn").attr("style","background-color: #138496;margin-bottom: 10px;");$(".fuelswitching-calculator table tr > td:nth-child(2), .fuelswitching-calculator table tr > th:nth-child(2)").attr("style","background-color:none;");$(".fuelswitching-calculator table tr > td:nth-child(3), .fuelswitching-calculator table tr > th:nth-child(3)").attr("style","background-color:none;");$(".fuelswitching-calculator table tr > td:nth-child(4), .fuelswitching-calculator table tr > th:nth-child(4)").attr("style","vertical-align:middle;");$(".fuelswitching-calculator table tr > td:nth-child(5), .fuelswitching-calculator table tr > th:nth-child(5)").attr("style","vertical-align:middle;");$(".fuelswitching-calculator #milesASHP").attr("style","");$(".fuelswitching-calculator #Span1").attr("style","");$(".fuelswitching-calculator #milesASHPDuct").attr("style","");$(".fuelswitching-calculator #Span3").attr("style","");$(".fuelswitching-calculator #milesGeothermal").attr("style","");$(".fuelswitching-calculator #Span4").attr("style","");$(".fuelswitching-calculator #milesNatGas").attr("style","");$(".fuelswitching-calculator #Span5").attr("style","");$(".fuelswitching-calculator #ASHPCar").attr("src","/Static/images/fuelswitching-calculator/car_icon.png");$(".fuelswitching-calculator #ASHPDlessCar").attr("src","/Static/images/fuelswitching-calculator/car_icon.png");$(".fuelswitching-calculator #GeothCar").attr("src","/Static/images/fuelswitching-calculator/car_icon.png");$(".fuelswitching-calculator #NatCar").attr("src","/Static/images/fuelswitching-calculator/car_icon.png")},n.prototype.SetBoilerOrFurnace=function(n){this.furBoilerFlag=!0;this.boilerFurClicked=!0;n.id=="boiler-btn"?($(".fuelswitching-calculator #heater-pic").attr("src","/Static/images/fuelswitching-calculator/boiler.png"),$(".fuelswitching-calculator #heater-pic").attr("alt","Boiler"),this.activeboiler=!0,this.boilerOrFurnaceOption="Boiler",$(".fuelswitching-calculator #boiler-btn").attr("style","background-color: #39c7cf;margin-bottom: 10px;"),$(".fuelswitching-calculator #furnace-btn").attr("style","background-color: #138496;margin-bottom: 10px;")):n.id=="furnace-btn"&&($(".fuelswitching-calculator #furnace-btn").attr("style","background-color: #39c7cf;margin-bottom: 10px;"),$(".fuelswitching-calculator #boiler-btn").attr("style","background-color: #138496;margin-bottom: 10px;"),$(".fuelswitching-calculator #heater-pic").attr("src","/Static/images/fuelswitching-calculator/furnace.png"),$(".fuelswitching-calculator #heater-pic").attr("alt","Furnace"),this.activeboiler=!1,this.boilerOrFurnaceOption="Furnace");this.EnableDisableCalculate()},n}();t["default"]=i});define("components/led-calculator",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=["LED bulbs are the most energy efficient and longest lasting bulb option available, surpassing incandescent, halogen and Compact Fluorescent Light (CFL) bulbs with energy savings, color options and a lifespan of up to 15 years. Unlike Compact Fluorescent Light (CFL) bulbs, they are also free of mercury.","LED bulbs use substantially less electricity than all variations, for example a 60W equivalent LED may only utilize 9W of electricity and a 100W equivalent only 16W. This enables more lighting options with LED bulbs since typical light fixture limits are almost always well beneath the standard LED bulb power consumption, regardless of brightness level. ","Brightness of LEDs is based in lumen (lm) with lower lumen being equivalent of lower wattage, for example 800lm is equivalent to 60W and 1600lm to 100W. LED bulbs also offer different color temperatures measured in Kelvin ranges of 2,000 to 6,500. The lower end of the range is yellow, the middle neutral and higher blue toned."],r=9,u=365,f=function(){function n(n,t,i,r){this.bulbType=n;this.wattage=t;this.numOfBulbs=i;this.hoursOfUse=r}return n}(),e=function(){function n(n){var t=this;this.list=[];this.idIncrement=0;this.options=n;$(".led-calculator #qtyNoOfBulbs").prop("disabled",!0);$(".led-calculator #qtyNoOfHours").prop("disabled",!0);$(".led-calculator #btnPlusNoOfBulbs").click(function(){$(".led-calculator #qtyNoOfBulbs").val(parseInt($(".led-calculator #qtyNoOfBulbs").val())+1);$(".led-calculator #qtyNoOfBulbs").val()==100&&$(".led-calculator #qtyNoOfBulbs").val(99)});$(".led-calculator #btnMinusNoOfBulbs").click(function(){$(".led-calculator #qtyNoOfBulbs").val(parseInt($(".led-calculator #qtyNoOfBulbs").val())-1);$(".led-calculator #qtyNoOfBulbs").val()==0&&$(".led-calculator #qtyNoOfBulbs").val(1)});$(".led-calculator #btnPlusNoOfHours").click(function(){$(".led-calculator #qtyNoOfHours").val(parseInt($(".led-calculator #qtyNoOfHours").val())+1);$(".led-calculator #qtyNoOfHours").val()==25&&$(".led-calculator #qtyNoOfHours").val(24)});$(".led-calculator #btnMinusNoOfHours").click(function(){$(".led-calculator #qtyNoOfHours").val(parseInt($(".led-calculator #qtyNoOfHours").val())-1);$(".led-calculator #qtyNoOfHours").val()==0&&$(".led-calculator #qtyNoOfHours").val(1)});$(".led-calculator #inc-btn").click(function(){var t=[40,60,75,100,150],n,i;for($(".led-calculator #wattage").find("option").remove(),n=0;n<t.length;n++)$(".led-calculator #wattage").append('<option id="'+t[n]+'">'+t[n]+"<\/option>");i=document.getElementById("wattage").children[1];i.setAttribute("selected","selected");$(".led-calculator #bulb-pic").attr("src","/Static/images/led-calculator/incandescent.png");$(".led-calculator #bulb-pic").data("bulb-type","Incandescent")});$(".led-calculator #cfl-btn").click(function(){var t=[15,18,19,20,23,26,40],n,i;for($(".led-calculator #wattage").find("option").remove(),n=0;n<t.length;n++)$(".led-calculator #wattage").append('<option id="'+t[n]+'">'+t[n]+"<\/option>");i=document.getElementById("wattage").children[5];i.setAttribute("selected","selected");$(".led-calculator #bulb-pic").attr("src","/Static/images/led-calculator/cfl.png");$(".led-calculator #bulb-pic").data("bulb-type","Compact Fluorescent Light (CFL)")});$(".led-calculator #hal-btn").click(function(){var t=[29,43,53,72],n,i;for($(".led-calculator #wattage").find("option").remove(),n=0;n<t.length;n++)$(".led-calculator #wattage").append('<option id="'+t[n]+'">'+t[n]+"<\/option>");i=document.getElementById("wattage").children[1];i.setAttribute("selected","selected");$(".led-calculator #bulb-pic").attr("src","/Static/images/led-calculator/halogen.png");$(".led-calculator #bulb-pic").data("bulb-type","Halogen")});$(".led-calculator #add-to-calc").click(function(){if(t.list.length>r-1)alert("You have added the maximum amount of bulbs allowed.");else{var n=$(".led-calculator #bulb-pic").data("bulb-type"),i=$(".led-calculator #wattage").val(),u=$(".led-calculator #qtyNoOfBulbs").val(),e=$(".led-calculator #qtyNoOfHours").val(),o=new f(n,i,u,e);t.displayElement(o)}});$(".led-calculator #btnCalculate").click(function(){var n,r,i,u;if(t.list.length==0)alert("Please add at least 1 combination of bulbs and clicking Add to Calculation above.");else{for(n=0,r=0,i=0;i<t.list.length;i++)r=t.kwhCalculation(t.list[i]),n=n+r;u=Math.round(n);$(".led-calculator #kwh").html(u.toString());$(".led-calculator #kwh").attr("style","font-size:24px;font-weight: bold;");t.YearlyCalculation(n);t.MilesCalculation(n);$(".led-calculator #btnCalculate").html("<h3>RE-CALCULATE<\/h3>");$(".led-calculator #advisement-inner").html("<b><i>Did you know…<\/i><\/b><br>"+t.getTip())}})}return n.prototype.getTip=function(){var n=Math.floor(Math.random()*i.length);return i[n]},n.prototype.displayElement=function(n){var u=this,s,t,f,e,h,i,o;this.list.length>=0&&$(".led-calculator #btnCalculate").prop("disabled",!1);s=n.bulbType;this.list.push(n);t=document.createElement("li");f=n.bulbType+this.idIncrement;this.idIncrement++;t.setAttribute("id",f);e=n.numOfBulbs+" "+n.wattage+"Watt "+n.bulbType;t.innerHTML=e;h=document.createTextNode(t.innerHTML);n.bulbType==="bulb"?(this.list.pop(),alert("Please select a bulb to begin a calculation.")):document.getElementById("myUL").appendChild(t);i=document.createElement("SPAN");o=document.createTextNode("×");i.className="close";i.appendChild(o);t.appendChild(i);i.onclick=function(){t.style.display="none";var n=u.list.filter(function(){return f===t.id}),i=u.list.indexOf(n[0]);u.list.splice(i,1);u.list.length==0&&($(".led-calculator #btnCalculate").prop("disabled",!0),$(".led-calculator #yearly-dollars").html("-"),$(".led-calculator #miles").html("-"),$(".led-calculator #kwh").html("-"))};this.list.length>r-1&&alert("You have added the maximum amount of bulbs allowed.")},n.prototype.kwhCalculation=function(n){var t=n.numOfBulbs,i=n.wattage,r=n.hoursOfUse;return t*((i-this.options.wattsElecEquivalent)/1e3)*r*u},n.prototype.YearlyCalculation=function(n){var t=n*this.options.dollarConversionFactor,i=Math.round(t);$(".led-calculator #yearly-dollars").html(i.toString());$(".led-calculator #yearly-dollars").attr("style","font-size:24px;font-weight: bold;")},n.prototype.MilesCalculation=function(n){var t=Math.round(n*(this.options.emissionsFactor/this.options.milesDrivenAvgCar));$(".led-calculator #miles").html(t.toString());$(".led-calculator #miles").attr("style","font-size:24px;font-weight: bold;")},n}();t["default"]=e});define("components/thermostat-calculator",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=.33,r=function(){function n(n){var t=this;this.options=n;$(".thermostat-calculator #qtyNoOfBulbs").prop("disabled",!0);$(".thermostat-calculator #qtyNoOfHours").prop("disabled",!0);$(".thermostat-calculator #btnYes").click(function(){$(".thermostat-calculator #btnYes").attr("style","background-color: #138496;");$(".thermostat-calculator #btnNo").attr("style","background-color: #17a2b8;");t.isCentralAirActive=!0;t.EnableDisableCalculate();$(".thermostat-calculator #inputWinterHome").prop("disabled",!1);$(".thermostat-calculator #inputWinterAway").prop("disabled",!1);$(".thermostat-calculator #inputWinterSleep").prop("disabled",!1);$(".thermostat-calculator #inputSummerHome").prop("disabled",!1);$(".thermostat-calculator #inputSummerAway").prop("disabled",!1);$(".thermostat-calculator #inputSummerSleep").prop("disabled",!1);$(".thermostat-calculator #inputSummerHome").val(70);$(".thermostat-calculator #inputSummerAway").val(70);$(".thermostat-calculator #inputSummerSleep").val(70)});$(".thermostat-calculator #btnNo").click(function(){$(".thermostat-calculator #btnNo").attr("style","background-color: #138496;");$(".thermostat-calculator #btnYes").attr("style","background-color: #17a2b8;");t.isCentralAirActive=!1;t.EnableDisableCalculate();$(".thermostat-calculator #inputWinterHome").prop("disabled",!1);$(".thermostat-calculator #inputWinterAway").prop("disabled",!1);$(".thermostat-calculator #inputWinterSleep").prop("disabled",!1);$(".thermostat-calculator #inputSummerHome").prop("disabled",!0);$(".thermostat-calculator #inputSummerAway").prop("disabled",!0);$(".thermostat-calculator #inputSummerSleep").prop("disabled",!0);$(".thermostat-calculator #inputSummerHome").prop("required",!1);$(".thermostat-calculator #inputSummerAway").prop("required",!1);$(".thermostat-calculator #inputSummerSleep").prop("required",!1);$(".thermostat-calculator #inputSummerHome").val("-");$(".thermostat-calculator #inputSummerAway").val("-");$(".thermostat-calculator #inputSummerSleep").val("-")});$(".thermostat-calculator #btnCalculate").click(function(){document.getElementById("cool-text").innerHTML="-";document.getElementById("yearly-dollars").innerHTML="-";Number($(".thermostat-calculator #inputWinterHome").val())>100||Number($(".thermostat-calculator #inputWinterHome").val())<0||$(".thermostat-calculator #inputWinterHome").val()==""||Number($(".thermostat-calculator #inputWinterAway").val())>100||Number($(".thermostat-calculator #inputWinterAway").val())<0||$(".thermostat-calculator #inputWinterAway").val()==""||Number($(".thermostat-calculator #inputWinterSleep").val()>100)||Number($(".thermostat-calculator #inputWinterSleep").val()<0)||$(".thermostat-calculator #inputWinterSleep").val()==""||Number($(".thermostat-calculator #inputSummerHome").val())>100&&$(".thermostat-calculator #inputSummerHome").val()!=""||Number($(".thermostat-calculator #inputSummerHome").val())<0||t.isCentralAirActive&&$(".thermostat-calculator #inputSummerHome").val()==""||Number($(".thermostat-calculator #inputSummerAway").val())>100&&$(".thermostat-calculator #inputSummerAway").val()!=""||Number($(".thermostat-calculator #inputSummerAway").val())<0||t.isCentralAirActive&&$(".thermostat-calculator #inputSummerAway").val()==""||Number($(".thermostat-calculator #inputSummerSleep").val()>100&&$(".thermostat-calculator #inputSummerSleep").val()!="")||Number($(".thermostat-calculator #inputSummerSleep").val())<0||t.isCentralAirActive&&$(".thermostat-calculator #inputSummerSleep").val()==""?($(".thermostat-calculator #winterHomeRecom").html("-"),$(".thermostat-calculator #winterAwayRecom").html("-"),$(".thermostat-calculator #winterSleepRecom").html("-"),$(".thermostat-calculator #summerHomeRecom").html("-"),$(".thermostat-calculator #summerAwayRecom").html("-"),$(".thermostat-calculator #summerSleepRecom").html("-"),$(".thermostat-calculator #heat-text").html("-"),$(".thermostat-calculator #cool-text").html("-"),$(".thermostat-calculator #yearly-dollars").html("-"),$(".thermostat-calculator #miles").html("-"),alert("You must enter a temperature between 0 and 100")):($(".thermostat-calculator #btnCalculate").html("<h3>RE-CALCULATE<\/h3>"),$(".thermostat-calculator #winterHomeRecom").html(t.options.homeHeat.toString()),$(".thermostat-calculator #winterAwayRecom").html(t.options.leaveHeat.toString()),$(".thermostat-calculator #winterSleepRecom").html(t.options.sleepHeat.toString()),t.isCentralAirActive?($(".thermostat-calculator #summerHomeRecom").html(t.options.homeCool.toString()),$(".thermostat-calculator #summerAwayRecom").html(t.options.leaveCool.toString()),$(".thermostat-calculator #summerSleepRecom").html(t.options.sleepCool.toString()),t.HeatingAndCoolingCalc()):($(".thermostat-calculator #summerHomeRecom").html("-"),$(".thermostat-calculator #summerAwayRecom").html("-"),$(".thermostat-calculator #summerSleepRecom").html("-"),t.HeatingCalc(),$(".thermostat-calculator #cool-text").html("")))})}return n.prototype.EnableDisableCalculate=function(){var n=document.getElementById("dropdownFuel").value;n==""?$(".thermostat-calculator #btnCalculate").prop("disabled",!0):($(".thermostat-calculator #btnCalculate").prop("disabled",!1),$(".thermostat-calculator #btnCalculate").attr("style","background-color: #17A2BE;"))},n.prototype.HeatingAndCoolingCalc=function(){var n=this.GetPriceSetpoint(),u=this.HeatingDegreesToDollars(n),f=this.CoolingDegreesToDollars(),r=u+f,e=document.getElementById("dropdownFuel"),t=e.options[e.selectedIndex].text;t=="Electric"&&(t="Electricity");document.getElementById("heat-text").innerHTML=u<=0?"Well done! Your thermostat is programmed to help you save money and energy.        For every 1 degree change per hour you can save "+n.toFixed(2)+" cents and reduce the amount of "+t+" you use.":"If the recommended winter heating settings are not right for you, you can still save: A 1 degree change         in either Home, Away or Sleep could save you $"+Math.round(i*n*this.options.heatingHours)+" annually. If you change by 1 degree for all 3         time periods you could save $"+Math.round(n*this.options.heatingHours)+" annually.";document.getElementById("cool-text").innerHTML=f<=0?"Well done! Your thermostat is programmed to help you save money and energy.        For every 1 degree change per hour you can save "+this.options.centralAirSetPointChange.toFixed(2)+" cents and reduce the amount of "+t+" you use.":"If the recommended summer cooling settings are not right for you, you can still save: A 1 degree change         in either Home, Away or Sleep could save you $"+Math.round(i*this.options.centralAirSetPointChange*this.options.coolingHours)+" annually. If you change by 1 degree for all 3         time periods you could save $"+Math.round(this.options.centralAirSetPointChange*this.options.coolingHours)+" annually.";r>0&&($(".thermostat-calculator #yearly-dollars").html(Math.round(r).toString()),$(".thermostat-calculator #yearly-dollars").attr("style","font-size:40px;font-weight: bold;"));this.MilesCalculation(r/this.options.electricKwhCost)},n.prototype.HeatingCalc=function(){var n=this.GetPriceSetpoint(),t=this.HeatingDegreesToDollars(n),u=document.getElementById("dropdownFuel"),r=u.options[u.selectedIndex].text;r=="Electric"&&(r="Electricity");$(".thermostat-calculator #yearly-dollars").html("-");t<=0?document.getElementById("heat-text").innerHTML="Well done! Your thermostat is programmed to help you save money and energy.        For every 1 degree change per hour you can save "+n.toFixed(2)+" cents and reduce the amount of "+r+" you use.":(document.getElementById("heat-text").innerHTML="If the recommended winter heating settings are not right for you, you can still save: A 1 degree change         in either Home, Away or Sleep could save you $"+Math.round(i*n*this.options.heatingHours)+" annually. If you change by 1 degree for all 3         time periods you could save $"+Math.round(n*this.options.heatingHours)+" annually.",$(".thermostat-calculator #yearly-dollars").html(Math.round(t).toString()),$(".thermostat-calculator #yearly-dollars").attr("style","font-size:40px;font-weight: bold;"));this.MilesCalculation(t/this.options.electricKwhCost)},n.prototype.HeatingDegreesToDollars=function(n){var t=parseInt($(".thermostat-calculator #inputWinterHome").val()),i=parseInt($(".thermostat-calculator #inputWinterAway").val()),r=parseInt($(".thermostat-calculator #inputWinterSleep").val()),u=8*(t-this.options.homeHeat)+8*(i-this.options.leaveHeat)+8*(r-this.options.sleepHeat),f=u*n,e=f/24;return Math.max(0,e*this.options.heatingHours)},n.prototype.CoolingDegreesToDollars=function(){var n=parseInt($(".thermostat-calculator #inputSummerHome").val()),t=parseInt($(".thermostat-calculator #inputSummerAway").val()),i=parseInt($(".thermostat-calculator #inputSummerSleep").val()),r=8*(this.options.homeCool-n)+8*(this.options.leaveCool-t)+8*(this.options.sleepCool-i),u=r*this.options.centralAirSetPointChange,f=u/24;return Math.max(0,f*this.options.coolingHours)},n.prototype.GetPriceSetpoint=function(){var n=document.getElementById("dropdownFuel").value;return n=="propane"?this.options.propaneSetPointChange:n=="fuel"?this.options.fuelOilSetPointChange:n=="electric"?this.options.electricSetPointChange:this.options.naturalGasSetPointChange},n.prototype.MilesCalculation=function(n){var t=Math.round(n*(this.options.emissionsFactor/this.options.milesDrivenAvgCar));$(".thermostat-calculator #miles").html(t.toString());$(".thermostat-calculator #miles").attr("style","font-size:40px;font-weight: bold;")},n}();t["default"]=r});define("components/timeofuserate-calculator",["require","exports"],function(n,t){Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function n(n){var t=this;this.options=n;$(".timeofuserate-calculator #electric-tou, .timeofuserate-calculator #fuel-oil-tou, .timeofuserate-calculator #natural-gas-tou, .timeofuserate-calculator #propane-tou").click(function(n){t.HouseText(n.target)});$(".timeofuserate-calculator #electricRange").change(function(){t.ElectricSlide()});$(".timeofuserate-calculator #central-air, .timeofuserate-calculator #EV-Charger, .timeofuserate-calculator #Hot-tub, .timeofuserate-calculator #dehum").click(function(){t.UncheckNoneOption()});$(".timeofuserate-calculator #None").click(function(){t.UncheckOtherProgOptions()});$(".timeofuserate-calculator #btnCalculate").click(function(){t.CalculateTouDetails()})}return n.prototype.CalculateTouDetails=function(){var n={},t,i,r;n.monthlyKwhUsage=Number($(".timeofuserate-calculator #electricRange").val());n.primaryHeatingFuel=$("input[name=fuel-method]:checked").val().toString();n.hasEsco=$("input[name=alternate-supplier]:checked").val().toString()=="yes";t=this.GetCheckedBoxes("controllable-app");i=this.GetCheckedBoxes("programmable-app");t==null||i==null?alert("Please select at least one appliance each from controllable and programmable appliances List"):(n.controllableApp=this.GetArrayListApps(t),n.programmableApp=this.GetArrayListApps(i),r=this,$.ajax({type:"POST",url:"/api/calculators/time-of-use-rate",data:__assign({__RequestVerificationToken:$('[name="__RequestVerificationToken"]').last().val().toString()},n),dataType:"json",success:function(t){t.errorMsg==null?r.DisplayTouResults(t.potentialSavings,t.isGoodFit,n):alert("These calculations are currently unavailable. Please try again later.")},error:function(){alert("These calculations are currently unavailable. Please try again later.")}}))},n.prototype.DisplayTouResults=function(n,t,i){$(".timeofuserate-calculator #btnCalculate").val("Re-Calculate");t==!0?($(".timeofuserate-calculator #tououtputboxGoodFit").attr("style","visibility:visible;"),$(".timeofuserate-calculator #divDisclaimer").attr("style","visibility:visible;"),$(".timeofuserate-calculator #tououtputboxBadFit").attr("style","display: none;"),i.controllableApp!==null?$(".timeofuserate-calculator #controllable-text").html("Shift your usage of <b>"+i.controllableApp+"<\/b> to <a href=https://www.cenhud.com/timeofusebilling/toupeakandoffpeak target=_blank>outside of peak hours of 2-7 pm.<\/a>"):$(".timeofuserate-calculator #controllable-text").html("Shift use of your controllable appliances."),i.programmableApp!==null&&($(".timeofuserate-calculator #None").is(":checked")?$(".timeofuserate-calculator #programmable-text").attr("style","display:none;"):($(".timeofuserate-calculator #programmable-text").html("Program your <b>"+i.programmableApp+"<\/b> to reduce usage during peak hours."),$(".timeofuserate-calculator #programmable-text").attr("style","visibility:visible;"))),$(".timeofuserate-calculator #estimates").html(" <b> $ "+Math.round(n)+" per year <\/b>")):($(".timeofuserate-calculator #tououtputboxGoodFit").attr("style","display:none;"),$(".timeofuserate-calculator #tououtputboxBadFit").attr("style","visibility:visible;"),$(".timeofuserate-calculator #divDisclaimer").attr("style","visibility:visible;"))},n.prototype.HouseText=function(n){n.id=="electric-tou"?($(".timeofuserate-calculator #electricRangeOutput").html("1300"),document.getElementById("electricRange").value="1300",$(".timeofuserate-calculator #house-text").html("The average residential electric heat customer uses 1,300kWh per month, 15% of which is used during the peak hours of 2pm-7pm.")):($(".timeofuserate-calculator #electricRangeOutput").html("650"),$(".timeofuserate-calculator #house-text").html("The average residential electric customer uses 650kWh per month, 15% of which is used during the peak hours of 2pm-7pm."),document.getElementById("electricRange").value="650")},n.prototype.ElectricSlide=function(){var n=$(".timeofuserate-calculator #electricRange"),t=$(".timeofuserate-calculator #electricRangeOutput");t.html(n.val().toString());$(".timeofuserate-calculator #house").attr("src","/Static/images/timeofuserate-calculator/medium.png")},n.prototype.UncheckNoneOption=function(){($(".timeofuserate-calculator #Hot-tub").is(":checked")||$(".timeofuserate-calculator #EV-Charger").is(":checked")||$(".timeofuserate-calculator #dehum").is(":checked")||$(".timeofuserate-calculator #central-air").is(":checked"))&&$(".timeofuserate-calculator #None").prop("checked",!1)},n.prototype.UncheckOtherProgOptions=function(){$(".timeofuserate-calculator #None").is(":checked")&&($(".timeofuserate-calculator #Hot-tub").prop("checked",!1),$(".timeofuserate-calculator #EV-Charger").prop("checked",!1),$(".timeofuserate-calculator #dehum").prop("checked",!1),$(".timeofuserate-calculator #central-air").prop("checked",!1))},n.prototype.GetCheckedBoxes=function(n){for(var i=document.getElementsByName(n),r=[],t=0;t<i.length;t++)i[t].checked&&r.push(i[t]);return r.length>0?r:null},n.prototype.GetArrayListApps=function(n){var i="",t;if(i+=n[0].value,n.length-1>0)for(t=1;t<n.length;t++)i+="; "+n[t].value;return i},n}();t["default"]=i})