text: function TimerUtilities(){}function handleAppleExpiration(){new Date-startTime>=appleIdle&&0!=appleIdle&&(window.location.href=appleUrl)}$(document).ready(function(){$("#EntitlementsWell").click(function(){$("#entitlementsTab").tab("show")}),$("#EndorsementsWell").click(function(){$("#endorsementsTab").tab("show")}),$(".tab-pane h2.h2.no-js-header").remove(),$("div.show-more.hidden").removeClass("hidden")}),define("driver_details",function(){});var handleAppleExpirationLoop,appleIdle,appleUrl,startTime=new Date;TimerUtilities.prototype.setPageExpiration=function(e,t,n){var i=navigator.userAgent;/(iPad|iPhone)/i.test(i)&&(handleAppleExpirationLoop&&clearInterval(handleAppleExpirationLoop),handleAppleExpirationLoop=setInterval("handleAppleExpiration()",500),appleIdle=t,appleUrl=n),e.idleTimer(t),e.on("idle.idleTimer",function(){window.location.href=n})},TimerUtilities.prototype.checkForExpiration=function(e,t){var n=new Date;n=n.getTime(),0==t.val().length?(t.val(n),e.show()):(t.val(""),location.reload())},define("timerUtilities",function(){}),define("miscellaneous",[],function(){$("#Entitlements, #Endorsements").removeClass("active"),$("a#EntitlementsWell").on("click",function(e){return e.preventDefault(),$("#Entitlements").tab("show"),!1}),$("a#EndorsementsWell").on("click",function(e){return e.preventDefault(),$("#Endorsements").tab("show"),!1})}),define("view-dl",[],function(){var e=$("div.tabbed-view > div"),t=function(t){e.hide(),e.filter(t).show(),$("div.tabbed-view ul.tabs a").removeClass("current"),$("div.tabbed-view ul.tabs a[href="+t+"]").addClass("current")},n=function(e){history.pushState?history.pushState(null,null,e):location.hash=e};$("div.tabbed-view ul.tabs a[href*=#]").click(function(){return n(this.hash),$(window).scrollTop(0),t(this.hash),!1});var i=$("div.tabbed-view ul.tabs a[href="+location.hash+"]");0==i.length&&(i=$("div.tabbed-view ul.tabs a[href*=#]:first")),i.click(),$(".accordion-content").hide(),$("a.toggle").on("click",function(e){return e.detail&&1!=e.detail?!1:($(this).parent().parent().find("div.accordion-content:first").slideToggle("fast"),$(this).find("span.more > span").toggleClass("up").toggleClass("down"),$(this).find("em").html($(this).find("span").is(".up")?$("#driverDetails").attr("data-accordian-show-text")+' <img alt="" src="'+$("#driverDetails").attr("data-assets-img-root")+'/circle-plus@2x.png" width="16px">':$("#driverDetails").attr("data-accordian-hide-text")+' <img alt="" src="'+$("#driverDetails").attr("data-assets-img-root")+'/circle-minus@2x.png" width="16px">'),!1)})}),function(e){var t=function(e,n,i){return 1===arguments.length?t.get(e):t.set(e,n,i)};t._document=document,t._navigator=navigator,t.defaults={path:"/"},t.get=function(e){return t._cachedDocumentCookie!==t._document.cookie&&t._renewCache(),t._cache[e]},t.set=function(n,i,o){return o=t._getExtendedOptions(o),o.expires=t._getExpiresDate(i===e?-1:o.expires),t._document.cookie=t._generateCookieString(n,i,o),t},t.expire=function(n,i){return t.set(n,e,i)},t._getExtendedOptions=function(n){return{path:n&&n.path||t.defaults.path,domain:n&&n.domain||t.defaults.domain,expires:n&&n.expires||t.defaults.expires,secure:n&&n.secure!==e?n.secure:t.defaults.secure}},t._isValidDate=function(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.getTime())},t._getExpiresDate=function(e,n){switch(n=n||new Date,typeof e){case"number":e=new Date(n.getTime()+1e3*e);break;case"string":e=new Date(e)}if(e&&!t._isValidDate(e))throw new Error("`expires` parameter cannot be converted to a valid Date instance");return e},t._generateCookieString=function(e,t,n){e=encodeURIComponent(e),t=(t+"").replace(/[^!#$&-+\--:<-\[\]-~]/g,encodeURIComponent),n=n||{};var i=e+"="+t;return i+=n.path?";path="+n.path:"",i+=n.domain?";domain="+n.domain:"",i+=n.expires?";expires="+n.expires.toUTCString():"",i+=n.secure?";secure":""},t._getCookieObjectFromString=function(n){for(var i={},o=n?n.split("; "):[],a=0;a<o.length;a++){var r=t._getKeyValuePairFromCookieString(o[a]);i[r.key]===e&&(i[r.key]=r.value)}return i},t._getKeyValuePairFromCookieString=function(e){var t=e.indexOf("=");return t=0>t?e.length:t,{key:decodeURIComponent(e.substr(0,t)),value:decodeURIComponent(e.substr(t+1))}},t._renewCache=function(){t._cache=t._getCookieObjectFromString(t._document.cookie),t._cachedDocumentCookie=t._document.cookie},t._areEnabled=function(){return t._navigator.cookieEnabled||"1"===t.set("cookies.js",1).get("cookies.js")},t.enabled=t._areEnabled(),"function"==typeof define&&define.amd?define("cookies",[],function(){return t}):"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=t),exports.Cookies=t):window.Cookies=t}(),define("formFiller",["cookies"],function(e){function t(){$("form").find("input").each(function(e,t){var n=$(t);i[n.attr("name")]&&"gender"!==n.attr("name")&&!n.attr("disabled")&&n.val(i[n.attr("name")])});for(var e=document.getElementsByTagName("form")[0].getElementsByTagName("select"),t=0;t<e.length;t++)document.forms[0][e[t].name]&&!element.attr("disabled")&&(e[t].value=i[e[t].name]);i.gender&&"1"==i.gender&&!element.attr("disabled")?$("#male").attr("checked","checked"):$("#male").removeAttr("checked"),i.gender&&"2"==i.gender&&!element.attr("disabled")?$("#female").attr("checked","checked"):$("#female").removeAttr("checked")}$("form").on("submit",function(){e.set("naturalSubmit",!0)});var n=e.get("naturalSubmit"),i=$("#formData").attr("data-form");if("undefined"!=typeof i){var o=JSON.parse(i);"undefined"!=typeof o&&(n||"dontFill"!==e.get("formAction")?(n&&e.set("naturalSubmit",void 0),t(),e.set("formAction","dontFill"),$("#formData").remove()):(e.set("formAction",void 0),document.location.href=document.location.href.replace("/error","")))}}),define("FieldValidator",[],function(){var e=function(){var e,t,n,i,o,a,r,l,s="",d=function(s,d,f,m,p,v){e=f,t=d,n=m,r=p,l=null==v?!0:v,i=$("#"+s),o=$("#"+s+"-control-group"),a=$("#"+s+"-help"),i.on("focusout",function(){window.setTimeout(c,100)}).on("focus",u)},c=function(){s="";var n=i.val();return $.isFunction(r)&&(n=r(n),i.val(n)),s=n,1==l&&""==n?(o.addClass("validation error"),a.text(e),!1):f(n)?(o.removeClass("validation error"),a.text(""),!0):(o.addClass("validation error"),a.text(t),!1)},u=function(){o.removeClass("validation error"),a.text(""),$.isFunction(r)&&i.val(s)},f=function(e){if(0==n.length)return!0;if(""==e&&!l)return!0;for(var t=0;t<n.length;t++)if(null!=e.match(n[t]))return!0;return!1};return{init:d,validate:c,removeValidationError:u}};return e}),define("dobValidator",[],function(){var e=window.dvla=window.dvla||{};e.dobValidator=function(){var e,t,n,i,o,a,r=function(){o.removeClass("validation"),o.removeClass("group"),o.removeClass("error"),a.text("")},l=function(l,d,c,u){emptyMessage=d,e=c,underAgeMessage=u,o=$("#"+l+"-control-group"),t=o.find("input#dob_year"),n=o.find("input#dob_month"),i=o.find("input#dob_day"),a=$("#"+l+"-help"),t.on("focusout",s).on("focus",r),n.on("focusout",s).on("focus",r),i.on("focusout",s).on("focus",r)},s=function(){function r(){return o.addClass("group validation error"),a.text(emptyMessage),!1}function l(){return o.addClass("group validation error"),a.text(e),!1}function s(){return o.addClass("group validation error"),a.text(underAgeMessage),!1}if(""==t.val()&&n.val()<=0&&i.val()<=0)return r();if(t.val()<1900||n.val()<=0||i.val()<=0)return l();var d=new Date(t.val(),n.val()-1,i.val());if(d.getMonth()+1!=n.val()||d.getDate()!=i.val()||d.getFullYear()!=t.val())return l();var c=new Date;if(c.setHours(0),c.setMinutes(0),c.setSeconds(0),c.setMilliseconds(0),d>c)return l();var u=new Date;return u.setFullYear(u.getFullYear()-15),u.setMonth(u.getMonth()-9),u.setHours(0),u.setMinutes(0),u.setSeconds(0),u.setMilliseconds(0),d>u?s():!0};return{init:l,validate:s,removeValidationError:r}}}),require(["driver_details","timerUtilities","miscellaneous","view-dl","formFiller","FieldValidator","dobValidator","cookies"]),define("main",function(){});
  //# sourceMappingURL=main.js.map