/*! jQuery UI Virtual Keyboard Navigation v1.6.2 */ !function(e){"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof module&&"object"==typeof module.exports?module.exports=e(require("jquery")):e(jQuery)}(function(u){"use strict";u.keyboard=u.keyboard||{},u.keyboard.navigationKeys={toggle:112,enter:13,pageup:33,pagedown:34,end:35,home:36,left:37,up:38,right:39,down:40,caretrt:45,caretlt:46,caretright:function(e){u.keyboard.keyaction.right(e)},caretleft:function(e){u.keyboard.keyaction.left(e)}},u.fn.addNavigation=function(t){return this.each(function(){var c,e,v=u(this).data("keyboard"),y=v.options,n=u.keyboard.events,l=u.keyboard.css;v&&(v.navigation_options=c=u.extend({},{position:[0,0],toggleMode:!1,focusClass:"hasFocus",toggleKey:null,rowLooping:!1},t),v.navigation_keys=e=u.extend({},u.keyboard.navigationKeys),v.navigation_namespace=v.namespace+"Nav",v.extensionNamespace.push(v.navigation_namespace),v.saveNav=[v.options.tabNavigation,v.options.enterNavigation],v.allNavKeys=u.map(e,function(e){return e}),v.navigation_init=function(){v.$keyboard.toggleClass(c.focusClass,c.toggleMode).find("."+l.keySet+":visible").find("."+l.keyButton+'[data-pos="'+c.position[0]+","+c.position[1]+'"]').addClass(y.css.buttonHover),v.$preview.unbind(v.navigation_namespace).bind("keydown"+v.navigation_namespace,function(e){return v.checkKeys(e.which)})},v.checkKeys=function(e,t){if(void 0!==e){var a=v.navigation_keys;return(e===(c.toggleKey||a.toggle)||t)&&(c.toggleMode=!t&&!c.toggleMode,v.options.tabNavigation=!c.toggleMode&&v.saveNav[0],v.options.enterNavigation=!c.toggleMode&&v.saveNav[1]),v.$keyboard.toggleClass(c.focusClass,c.toggleMode),c.toggleMode&&e===a.enter?(v.$keyboard.find("."+l.keySet+":visible").find("."+l.keyButton+'[data-pos="'+c.position[0]+","+c.position[1]+'"]').trigger(n.kbRepeater),!1):c.toggleMode&&0<=u.inArray(e,v.allNavKeys)?(v.navigateKeys(e),!1):void 0}},v.getMaxIndex=function(e,t){return e.find("."+l.keyButton+'[data-pos^="'+t+',"]').length-1},v.leftNavigateKey=function(e,t){var a=v.navigation_options.rowLooping,n=e-1;return 0<=n?n:a?t:0},v.rightNavigateKey=function(e,t){var a=v.navigation_options.rowLooping,n=e+1;return n<=t?n:a?0:t},v.navigateKeys=function(e,t,a){if(v.isVisible()){a="number"==typeof a?a:c.position[1],t="number"==typeof t?t:c.position[0];var n,o=v.$keyboard.find("."+l.keySet+":visible"),i=o.find("."+l.endRow).length-1,s=v.getMaxIndex(o,t),r=v.last,g=v.$preview.val().length,d=v.navigation_keys;switch(e){case d.pageup:t=0;break;case d.pagedown:t=i;break;case d.end:a=s;break;case d.home:a=0;break;case d.left:a=v.leftNavigateKey(a,s);break;case d.up:t+=0g?g:r.start,v.last.start=v.last.end=r.end=r.start,u.keyboard.caret(v.$preview,v.last)),(s=v.getMaxIndex(o,t))