Socket
Socket
Sign inDemoInstall

virtual-keyboard

Package Overview
Dependencies
2
Maintainers
1
Versions
90
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.28.9 to 1.29.0

2

dist/js/jquery.keyboard.extension-all.min.js

@@ -1,2 +0,2 @@

/*! jQuery UI Virtual Keyboard (1.28.9) - ALL Extensions + Mousewheel */
/*! jQuery UI Virtual Keyboard (1.29.0) - ALL Extensions + Mousewheel */
/*! jQuery UI Virtual Keyboard Alt Key Popup v2.0.0 */

@@ -3,0 +3,0 @@ !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(b){"use strict";var f=b.keyboard;b.extend(f.css,{altKeyPopup:"ui-keyboard-popup",altKeyOverlay:"ui-keyboard-overlay",altKeyPopupOpen:"ui-keyboard-popup-open"}),f.altKeys=b.extend({a:"å æ ā ă ą à á â ã ä",A:"Å Æ Ā Ă Ą À Á  à Ä",c:"ç ć ĉ ċ č",C:"Ç Ć Ĉ Ċ Č",d:"ď ð ď",D:"Ď Ð Ď",e:"ė ę ĕ ě ə è é ê ë ē",E:"Ė Ę Ĕ Ě Ǝ È É Ê Ë Ē",g:"ģ ğ ĝ ġ",G:"Ģ Ğ Ĝ Ġ",h:"ĥ ħ",H:"Ĥ Ħ",i:"ı į ī ï î í ì ĩ ĭ",I:"İ Į Ī Ï Î Í Ì Ĩ Ĭ",j:"ĵ",J:"Ĵ",k:"ķ",K:"Ķ",l:"Ł Ľ Ļ Ĺ Ŀ",L:"ł ľ ļ ĺ ŀ",n:"ʼn ň ņ ń ñ",N:"ʼn Ň Ņ Ń Ñ",o:"œ ő ø ö õ ô ó ò ō ŏ",O:"Œ Ő Ø Ö Õ Ô Ó Ò Ō Ŏ",r:"ŕ ř ŗ",R:"Ŕ Ř Ŗ",s:"ś š ş ß § ŝ",S:"Ś Š Ş ẞ § Ŝ",t:"þ ť ț ţ ŧ",T:"Þ Ť Ț Ţ Ŧ",u:"ų ű ů ū ü û ú ù ũ ŭ",U:"Ų Ű Ů Ū Ü Û Ú Ù Ũ Ŭ",w:"ŵ",W:"Ŵ",y:"ý",Y:"Ý",z:"ź ż ž",Z:"Ź Ż Ž","!":"¡",$:"€ £ ¤ ¥ ¢ ₡ ₱ ₩ ₹ ₪ ₭ ₮ ₦ ₤","?":"¿","'":"〈 「 『 “",'"':"〉 」 』 ”","(":"《 【 〔",")":"》 】 〕"},f.altKeys),b.fn.addAltKeyPopup=function(e){var t={holdTime:500,popupVisible:"popup-visible",popupHidden:"popup-hidden",popupPosition:null};return this.each(function(){var y=b(this).data("keyboard");if(y){if(y.altkeypopup_options=b.extend({},t,y.altkeypopup_options,e),y.altkeypopup_namespace)return y.altkeypopup_setup();y.altkeypopup_namespace=y.namespace+"AltKeyPopup",y.extensionNamespace.push(y.altkeypopup_namespace),y.altkeypopup_setup=function(){var a,e="mousedown touchstart ".split(" ").join(y.altkeypopup_namespace+" "),t="mouseup touchend touchcancel ".split(" ").join(y.altkeypopup_namespace+" ");y.options.repeatRate=0,y.unbindButton(y.altkeypopup_namespace).bindButton(e,function(){clearTimeout(a);var e=b(this),t=e.attr("data-value")||"",n=y.altkeypopup_options.holdTime;t in f.altKeys&&(n?a=setTimeout(function(){y.altKeyPopup_popup(t,e)},n):y.altKeyPopup_popup(t,e))}).bindButton(t,function(){clearTimeout(a)}),y.altkeypopup_blockingFlag=!1,y.$preview.unbind("keypress keydown keyup ".split(" ").join(y.altkeypopup_namespace+" ").trim()).bind("keypress keydown keyup ".split(" ").join(y.altkeypopup_namespace+" "),function(e){if("keyup"===e.type)return clearTimeout(a),y.altkeypopup_blockingFlag=!1,"Escape"!==e.key;var t=f.builtLayouts[y.layout],n=b(e.target),o=e.key,i=e.key;return"keydown"===e.type&&i in f.altKeys?y.altkeypopup_blockingFlag!==o&&(y.altkeypopup_blockingFlag=o,!0):y.altkeypopup_blockingFlag?(t.hasMappedKeys&&t.mappedKeys.hasOwnProperty(i)&&(i=t.mappedKeys[i]),i in f.altKeys&&(clearTimeout(a),a=setTimeout(function(){y.altkeypopup_blockingFlag===o&&y.altKeyPopup_popup(i,n)},y.altkeypopup_options.holdTime)),!0):void 0})},y.altKeyPopup_close=function(){y.altkeypopup_blockingFlag=!1,y.altKeyPopup_$overlay=null,setTimeout(function(){if(y.$keyboard.length){y.$keyboard.removeClass(f.css.altKeyPopupOpen);var e=y.$keyboard.find("."+f.css.altKeyOverlay);e&&e.remove()}},1),b(document).unbind(y.altkeypopup_namespace),y.$preview.focus(),y.options.ignoreEsc=y.altKeyPopup_savedIgnoreEsc,y.$el.trigger(y.altkeypopup_options.popupHidden,[y])},y.altKeyPopup_popup=function(e,t){if(!y.$keyboard.find("."+f.css.altKeyOverlay).length){var n,o,i,a,s,r,p,u,l,d=f.css,c={$kb:y.$keyboard,kbWidth:y.$keyboard.outerWidth(),kbHeight:y.$keyboard.outerHeight(),$key:t};y.altKeyPopup_$overlay=b('<div class="'+d.altKeyOverlay+'" />').css({width:c.kbWidth,height:c.kbHeight}).appendTo(y.$keyboard).bind("click touchstart",function(){y.altKeyPopup_close()}),l="inactive hidden ".split(" ").join(y.altkeypopup_namespace+" "),y.$keyboard.addClass(f.css.altKeyPopupOpen),y.$el.unbind(l).bind(l,function(){y.altKeyPopup_close()}),"bksp"!==e&&f.keyaction.bksp(y),o=b('<div class="'+d.altKeyPopup+" "+y.options.css.container+'" />'),n=f.altKeys[e].split(/\s+/),y.buildRow(o,0,n,[]),i=o.appendTo(y.altKeyPopup_$overlay).children().bind("mousedown touchstart",function(){y.altKeyPopup_close()}).bind("mouseover mouseleave",function(e){i.removeClass(y.options.css.buttonHover),"mouseleave"!==e.type&&b(this).addClass(y.options.css.buttonHover)}),y.altKeyPopup_navigate(!0),y.altKeyPopup_savedIgnoreEsc=y.options.ignoreEsc,y.options.ignoreEsc=!0,b(document).unbind(y.altkeypopup_namespace).bind("keydown"+y.altkeypopup_namespace,function(){return!1}).bind("keyup"+y.altkeypopup_namespace,function(e){return"Escape"===e.key?(e.which=0,y.altKeyPopup_close()):y.altKeyPopup_navigate(e),!1}),p=(c.$popup=o).outerWidth(),(a=t.position().left-p/2)+p>c.kbWidth&&(a=c.kbWidth-p)<0&&o.css({width:c.kbWidth,height:"auto"}),s=t.position().top-t.outerHeight()-5,u=o.outerHeight(),r=y.$keyboard.find("."+d.keySet).position().top,s+u>c.kbHeight&&(s=c.kbHeight-u)<r&&o.css({height:c.popupHeight,width:"auto"}),c.popupWidth=o.outerWidth(),c.popupHeight=o.outerHeight(),c.popupLeft=a<0?0:a,c.popupTop=s<r?r:s,o.css({position:"absolute",left:c.popupLeft,top:c.popupTop}),"function"==typeof y.altkeypopup_options.popupPosition&&y.altkeypopup_options.popupPosition(y,c),y.$preview.blur(),y.$el.trigger(y.altkeypopup_options.popupVisible,[y])}},y.altKeyPopup_navigate=function(e){var t,n=f.css,o=(f.navigationKeys,y.options.css.buttonHover),i=y.$keyboard.find("."+n.altKeyPopup).find("."+n.keyButton),a=i.length-1;if(!0===e)return i.eq(0).addClass(o),void(y.altKeyPopup_currentIndex=0);if(t=y.altKeyPopup_currentIndex,"Enter"===e.key)return y.insertText(i.eq(t).attr("data-value")),y.altKeyPopup_close(),!0;switch(e.key){case"End":t=a;break;case"Home":t=0;break;case"ArrowLeft":t-=1;break;case"ArrowRight":t+=1}t<0&&(t=0),a<t&&(t=a),y.altKeyPopup_currentIndex=t,i.removeClass(o).eq(t).addClass(o)},y.options.alwaysOpen&&y.isVisible()&&y.altkeypopup_setup(),y.$el.unbind(f.events.kbBeforeVisible+y.altkeypopup_namespace).bind(f.events.kbBeforeVisible+y.altkeypopup_namespace,function(){y.altkeypopup_setup()})}})}}),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(s){"use strict";s.fn.addAutocomplete=function(i){var a={position:{of:null,my:"right top",at:"left top",collision:"flip"},events:"autocomplete",data:""};return this.each(function(){var t,n,o=s(this).data("keyboard");o&&(n=o.namespace+"Autocomplete",o.autocomplete_namespace=n,o.extensionNamespace.push(n),o.autocomplete_init=function(){var e=(t=o.autocomplete_options=s.extend(!0,{},a,i)).events||t.data||"autocomplete";o.options.alwaysOpen&&o.isVisible()&&o.autocomplete_setup(),o.$el.unbind(n).bind(s.keyboard.events.kbVisible+n,function(){o.autocomplete_setup()}).bind(s.keyboard.events.kbHidden+n,function(){o.$el[t.data||"autocomplete"]("close")}).bind(s.keyboard.events.kbChange+n,function(){o.hasAutocomplete&&o.isVisible()&&o.$el.val(o.$preview.val())}).bind(e+"open"+n,function(){if(o.hasAutocomplete){var e=s.extend({},t.position);e.of=e.of||o.$keyboard,o.$autocomplete.menu.element.position(e)}}).bind(e+"select"+n,function(e,t){o.autocomplete_getVal(t.item)})},o.autocomplete_getVal=function(e){var t;switch(typeof e){case"string":t=e||"";break;case"object":t=e.label||e.value||"";break;default:t=o.preview&&o.preview.value||o.el.value}t=t.toString(),o.hasAutocomplete&&""!==t&&((o.$preview||o.$el).val(t).focus(),o.last.start=t.length,o.last.end=t.length,o.last.val=t)},o.autocomplete_update=function(e){clearTimeout(o.$autocomplete.searching),o.$autocomplete.searching=setTimeout(function(){o.$autocomplete.term!==o.$autocomplete.element.val()&&(o.$autocomplete.selectedItem=null,o.$autocomplete.search(null,e))},o.$autocomplete.options.delay)},o.autocomplete_navKeys={8:"backSpace",9:"tab",13:"enter",20:"capsLock",27:"escape",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"delete"},o.autocomplete_setup=function(){var t;if(o.$autocomplete=o.$el.data(o.autocomplete_options.data)||o.$el.data("uiAutocomplete")||o.$el.data("ui-autocomplete")||o.$el.data("autocomplete"),o.hasAutocomplete=void 0!==o.$autocomplete&&!o.$autocomplete.options.disabled,o.hasAutocomplete){o.$preview.bind("keydown"+n+" keypress"+n,function(e){o.$preview&&e.namespace!==o.$autocomplete.eventNamespace&&(e.namespace=o.$autocomplete.eventNamespace.slice(1),(t=o.autocomplete_navKeys[e.which])?o.el!==o.preview&&(o.$el.triggerHandler(e),"enter"===t&&setTimeout(function(){o.$autocomplete&&(o.$preview.val(o.$autocomplete.selectedItem.value),o.$preview.focus())},100)):o.autocomplete_update(e))});var e="mouseup mousedown mouseleave touchstart touchend touchcancel ".split(" ").join(n+" ");o.bindButton(e,function(e){o.autocomplete_update(e)})}o.escCloseCallback.autocomplete||(o.escCloseCallback.autocomplete=o.checkAutocompleteMenu)},o.checkAutocompleteMenu=function(e){return o.hasAutocomplete&&e.closest("ul").hasClass("ui-autocomplete")},o.autocomplete_destroy=function(){clearTimeout(o.$autocomplete.searching),o.hasAutocomplete=!1,o.$el.unbind(n),o.$preview&&(o.$preview.unbind(n),o.unbindButton(n)),delete o.$autocomplete},o.autocomplete_init())})}}),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(b){"use strict";var f=b.keyboard;f.firefox=void 0!==window.mozInnerScreenX,b.extend(f.css,{caret:"ui-keyboard-caret",caretMirror:"ui-keyboard-mirror-div"}),b.fn.addCaret=function(e){var t={caretClass:"",charAttr:"data-character",charIndex:1,offsetX:0,offsetY:0,adjustHt:0};return this.each(function(){var c,o,i=f.events,y=b(this).data("keyboard");y&&(c=y.caret_options=b.extend({},t,e),o=y.caret_namespace=y.namespace+"caret",y.extensionNamespace.push(o),y.textareaCaretProperties=["direction","boxSizing","width","height","overflowX","overflowY","borderTopWidth","borderRightWidth","borderBottomWidth","borderLeftWidth","borderStyle","paddingTop","paddingRight","paddingBottom","paddingLeft","fontStyle","fontVariant","fontWeight","fontStretch","fontSize","fontSizeAdjust","lineHeight","fontFamily","textAlign","textTransform","textIndent","textDecoration","letterSpacing","wordSpacing","tabSize","MozTabSize"],y.caret_setup=function(){var e=f.css,t="keyup keypress mouseup mouseleave ".split(" ").join(o+" "),n="position:absolute;visibility:hidden;top:-9999em;left:-9999em;white-space:pre-wrap;z-index:-10;"+("INPUT"===y.preview.nodeName?"":"word-wrap:break-word;");y.$keyboard.find("."+e.caretMirror).remove(),y.caret_$div=b('<div class="'+e.caretMirror+'" style="'+n+'">').appendTo(y.$keyboard),y.$caret&&y.$caret.remove(),y.$caret=b('<div class="'+e.caret+" "+c.caretClass+'" style="position:absolute;">').insertAfter(y.$preview),y.$el.unbind(i.kbChange+o).bind(i.kbChange+o,function(){y.findCaretPos()}),y.$preview.unbind(t).bind(t,function(){y.findCaretPos()})},y.findCaretPos=function(){if(y.caret_$div){var t,n,e,o,i,a,s,r,p=y.preview,u=parseFloat(y.$preview.css("fontSize")),l="INPUT"===p.nodeName,d=y.caret_$div[0];t=d.style,n=window.getComputedStyle?getComputedStyle(p,null):p.currentStyle,o=f.caret(y.$preview),i=Math["ltr"===n.direction?"max":"min"](o.start,o.end),y.textareaCaretProperties.forEach(function(e){t[e]=n[e]}),f.firefox&&(t.width=parseInt(n.width,10)-2+"px",p.scrollHeight>parseInt(n.height,10)&&(t.overflowY="scroll")),t.width=parseInt(l?p.scrollWidth:n.width,10)+(l?2*u:0)+"px",d.textContent=p.value.substring(0,i),"INPUT"===p.nodeName&&(d.textContent=d.textContent.replace(/\x20/g," ")),(s=document.createElement("span")).textContent=p.value.substring(i)||"​",d.appendChild(s),r=b(s).position(),o="center"===t.textAlign?u:0,y.caretPos={top:r.top+parseInt(n.borderTopWidth,10)+c.offsetY,left:r.left+parseInt(n.borderLeftWidth,10)+c.offsetX-o},e=parseInt(y.$caret.css("margin-top"),10),t=Math.round(u+2*e)+c.adjustHt,r=y.$preview.position(),y.$caret.css({top:r.top-p.scrollTop+y.caretPos.top-e,left:r.left-p.scrollLeft+y.caretPos.left,height:t}),a=p.value.substring(i,i+c.charIndex).replace(/\s/," ")||" ",y.$caret.attr(c.charAttr,a)}},y.$el.unbind(o).bind(i.kbBeforeVisible+o,function(){y.caret_setup()}).bind(i.kbVisible+o,function(){y.findCaretPos()}).bind(i.kbHidden+o,function(){var e="keyup keypress mouseup mouseleave ".split(" ").join(o+" ");y.$preview.unbind(e),y.$caret.remove(),y.$caret=null,y.caret_$div=null}),y.options.alwaysOpen&&y.isVisible()&&(y.caret_setup(),y.findCaretPos()))})}}),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(o){"use strict";var i=o.keyboard;i.css.extender="ui-keyboard-extender",i.language.en.display.extender=" :toggle_numpad",i.layouts.numpad={normal:["{clear} / * -","7 8 9 +","4 5 6 %","1 2 3 =","0 {dec} {left} {right}"]},i.keyaction.extender=function(e){return e.extender_toggle(),!1},o.fn.addExtender=function(e){var t={layout:"numpad",showing:!1,reposition:!0};return this.each(function(){var n=o(this).data("keyboard");if(n){if(n.extender_options=o.extend({},t,n.extender_options,e),n.extender_namespace)return n.extender_layoutSwitcher();n.extender_namespace=n.namespace+"extender",n.extensionNamespace.push(n.extender_namespace),n.extender_layoutSwitcher=function(){n.extender_lastKeyset=n.last.keyset,n.extender_bindEvents(!1),n.$el.one(i.events.kbBeforeVisible,function(){n.shiftActive=n.extender_lastKeyset[0],n.altActive=n.extender_lastKeyset[1],n.metaActive=n.extender_lastKeyset[2],n.showKeySet(),n.extender_setup(),n.extender_bindEvents()}),n.redraw()},n.extender_bindEvents=function(e){var t=i.events.kbBeforeVisible+n.extender_namespace;n.$el.unbind(t),!1!==e&&n.$el.bind(t,function(){n.extender_setup()})},n.extender_setup=function(){var e,t=n.extender_options.layout;void 0===i.builtLayouts[t]&&n.buildKeyboard(t),(e=i.builtLayouts[t].$keyboard.find("."+i.css.keySet+"-normal").clone()).removeClass().removeAttr("name").addClass(i.css.extender).children("button").removeAttr("data-pos"),e[0].style.display=n.extender_options.showing?"inline-block":"none",n.$keyboard.find("div."+i.css.extender).remove(),n.$keyboard.append(e),n.extender_toggle(n.extender_options.showing),n.bindKeys()},n.extender_toggle=function(e){n.extender_options.showing=void 0===e?!n.extender_options.showing:e,n.$keyboard.find("button."+i.css.extender).toggleClass(n.options.css.buttonActive,n.extender_options.showing).end().find("div."+i.css.extender)[0].style.display=n.extender_options.showing?"inline-block":"none",n.extender_options.reposition&&o(window).trigger("resize")},n.options.alwaysOpen&&n.isVisible()&&n.extender_setup(),n.extender_bindEvents()}})}}),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(s){s.fn.addMobile=function(e){var a,t={container:{theme:"b",cssClass:"ui-body"},input:{theme:"b",cssClass:""},buttonMarkup:{theme:"b",cssClass:"ui-btn",shadow:"true",corners:"true"},buttonHover:{theme:"b",cssClass:"ui-btn-hover"},buttonAction:{theme:"b",cssClass:"ui-btn-active"},buttonActive:{theme:"b",cssClass:"ui-btn-active"},allThemes:"a b c"};return this.each(function(){var i=s(this).data("keyboard");i&&void 0!==s.fn.textinput&&(i.mobile_options=a=s.extend(!0,{},t,e),i.mobile_themes=s.trim((" "+a.allThemes).split(" ").join(" "+a.buttonMarkup.cssClass+"-")+(" "+a.allThemes).split(" ").join(" "+a.buttonAction.cssClass+"-")+(" "+a.allThemes).split(" ").join(" "+a.buttonActive.cssClass+"-")),void 0===i.options.mobile_savedActiveClass&&(i.options.mobile_savedActiveClass=""+i.options.css.buttonActive),i.mobile_init=function(){var e=i.namespace+"Mobile";s("."+s.keyboard.css.input).textinput(),i.options.alwaysOpen&&i.isVisible&&i.mobile_setup(),i.extensionNamespace.push(e),i.$el.unbind(e).bind(s.keyboard.events.kbBeforeVisible+e,function(){i&&i.el.active&&i.$keyboard.length&&i.$keyboard.css("visibility","hidden")}).bind(s.keyboard.events.kbVisible+e,function(){i&&i.el.active&&i.$keyboard.length&&(i.mobile_setup(),i.$keyboard.css("visibility","visible"),i.$preview.focus())})},i.mobile_setup=function(){var e,t=s.keyboard.css,n=i.options,o=i.mobile_themes;i.mobile_$actionKeys=i.$keyboard.find("."+i.options.css.buttonAction),n.css.buttonActive=n.mobile_savedActiveClass+" "+i.modOptions(a.buttonActive,a.buttonMarkup),i.$keyboard.addClass(i.modOptions(a.container,a.container)).find("."+t.preview).removeClass("ui-widget ui-widget-content").addClass(i.modOptions(a.input,a.input)).end().find("button").removeClass(s.trim("ui-corner-all ui-state-default "+o)).addClass(i.modOptions(a.buttonMarkup,a.buttonMarkup)).not(i.mobile_$actionKeys).hover(function(){s(this).removeClass(o).addClass(i.modOptions(a.buttonHover,a.buttonMarkup))},function(){s(this).removeClass(o+" "+a.buttonHover.cssClass).addClass(i.modOptions(a.buttonMarkup,a.buttonMarkup))}),i.mobile_$actionKeys.removeClass(o).addClass(i.modOptions(a.buttonAction,a.buttonMarkup)),i.msie&&i.$preview[0]!==i.el&&(i.$preview.hide(),i.$keyboard.css("width",""),i.width=i.$keyboard.outerWidth(),i.$keyboard.width(i.width+parseInt(i.$preview.css("fontSize"),10)),i.$preview.width(i.width),i.$preview.show()),s.ui&&s.ui.position&&((e=n.position).of=e.of||i.$el.data("keyboardPosition")||i.$el,e.collision=e.collision||"flipfit flipfit",i.$keyboard.position(e))},i.modOptions=function(e,t){return" "+(e.cssClass||"")+" "+(t&&t.cssClass?t.cssClass+"-"+(e.theme||""):"")+("true"==e.shadow?" ui-shadow":"")+("true"==e.corners?" ui-corner-all":"")},i.mobile_init())})}}),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(b){"use strict";b.keyboard=b.keyboard||{},b.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){b.keyboard.keyaction.right(e)},caretleft:function(e){b.keyboard.keyaction.left(e)}},b.fn.addNavigation=function(t){return this.each(function(){var l,e,d=b(this).data("keyboard"),c=d.options,o=b.keyboard.events,y=b.keyboard.css;d&&(d.navigation_options=l=b.extend({},{position:[0,0],toggleMode:!1,focusClass:"hasFocus",toggleKey:null,rowLooping:!1},t),d.navigation_keys=e=b.extend({},b.keyboard.navigationKeys),d.navigation_namespace=d.namespace+"Nav",d.extensionNamespace.push(d.navigation_namespace),d.saveNav=[d.options.tabNavigation,d.options.enterNavigation],d.allNavKeys=b.map(e,function(e){return e}),d.navigation_init=function(){d.$keyboard.toggleClass(l.focusClass,l.toggleMode).find("."+y.keySet+":visible").find("."+y.keyButton+'[data-pos="'+l.position[0]+","+l.position[1]+'"]').addClass(c.css.buttonHover),d.$preview.unbind(d.navigation_namespace).bind("keydown"+d.navigation_namespace,function(e){return d.checkKeys(e.which)})},d.checkKeys=function(e,t){if(void 0!==e&&d.isVisible()){var n=d.navigation_keys;return(e===(l.toggleKey||n.toggle)||t)&&(l.toggleMode=!t&&!l.toggleMode,d.options.tabNavigation=!l.toggleMode&&d.saveNav[0],d.options.enterNavigation=!l.toggleMode&&d.saveNav[1]),d.$keyboard.toggleClass(l.focusClass,l.toggleMode),l.toggleMode&&e===n.enter?(d.$keyboard.find("."+y.keySet+":visible").find("."+y.keyButton+'[data-pos="'+l.position[0]+","+l.position[1]+'"]').trigger(o.kbRepeater),!1):l.toggleMode&&0<=b.inArray(e,d.allNavKeys)?(d.navigateKeys(e),!1):void 0}},d.getMaxIndex=function(e,t){return e.find("."+y.keyButton+'[data-pos^="'+t+',"]').length-1},d.leftNavigateKey=function(e,t){var n=d.navigation_options.rowLooping,o=e-1;return 0<=o?o:n?t:0},d.rightNavigateKey=function(e,t){var n=d.navigation_options.rowLooping,o=e+1;return o<=t?o:n?0:t},d.navigateKeys=function(e,t,n){if(d.isVisible()){n="number"==typeof n?n:l.position[1],t="number"==typeof t?t:l.position[0];var o,i=d.$keyboard.find("."+y.keySet+":visible"),a=i.find("."+y.endRow).length-1,s=d.getMaxIndex(i,t),r=d.last,p=d.$preview.val().length,u=d.navigation_keys;switch(e){case u.pageup:t=0;break;case u.pagedown:t=a;break;case u.end:n=s;break;case u.home:n=0;break;case u.left:n=d.leftNavigateKey(n,s);break;case u.up:t+=0<t?-1:0,o=d.getMaxIndex(i,t),n=n===s?o:n;break;case u.right:n=d.rightNavigateKey(n,s);break;case u.down:t+=a<t+1?0:1,o=d.getMaxIndex(i,t),n=n===s?o:n;break;case u.caretrt:r.start++;break;case u.caretlt:r.start--}e!==u.caretrt&&e!==u.caretlt||(r.start=r.start<0?0:r.start>p?p:r.start,d.last.start=d.last.end=r.end=r.start,b.keyboard.caret(d.$preview,d.last)),(s=d.getMaxIndex(i,t))<n&&(n=s),i.find("."+c.css.buttonHover).removeClass(c.css.buttonHover),i.find("."+y.keyButton+'[data-pos="'+t+","+n+'"]').addClass(c.css.buttonHover),l.position=[t,n]}},d.options.alwaysOpen&&d.isVisible()&&(d.$keyboard.find("."+c.css.buttonHover).removeClass(c.css.buttonHover),d.navigation_init()),d.$el.unbind(d.navigation_namespace).bind(o.kbVisible,function(){d.$keyboard.find("."+c.css.buttonHover).removeClass(c.css.buttonHover),d.navigation_init()}).bind(o.kbInactive+" "+o.kbHidden,function(e){d.checkKeys(e.which,!0)}).bind(o.kbKeysetChange,function(){d.navigateKeys(null)}).bind("navigate navigateTo",function(e,t,n){var o;(t=isNaN(t)?t.toLowerCase():t)in d.navigation_keys?(o=d.navigation_keys[t],isNaN(o)&&o in b.keyboard.keyaction?b.keyboard.keyaction[o](d,this,e):b.isFunction(o)?o(d):d.checkKeys(o)):"string"==typeof t&&t in b.keyboard.keyaction?b.keyboard.keyaction[t](d,this,e):d.navigateKeys(null,t,n)}))})}}),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(p){"use strict";p.keyboard=p.keyboard||{},p.fn.previewKeyset=function(n){return this.each(function(){var e=p(this).data("keyboard"),t=e.namespace+"Preview";e&&(e.previewKeyset_options=p.extend({},{sets:["normal","shift","alt","alt-shift"]},n),e.extensionNamespace.push(t),e.previewKeyset=function(){var a=p.keyboard.css,s=e.previewKeyset_options.sets,r=e.$keyboard.find("."+a.keySet).filter('[name="'+s.join('"],[name="')+'"]');1<r.length&&r.eq(0).find("."+a.keyButton).not("."+a.keyAction).each(function(){var e,t,n={},o=s.length,i=r.find('button[data-pos="'+p(this).attr("data-pos")+'"]');for(e=0;e<o;e++)t=i.eq(e).parent().attr("name"),0<=p.inArray(t,s)&&(n["data-"+t]=i.eq(e).find("."+a.keyText).text());i.attr(n)})},e.options.alwaysOpen&&e.isVisible()?e.previewKeyset():e.$el.unbind(p.keyboard.events.kbBeforeVisible+t).bind(p.keyboard.events.kbBeforeVisible+t,function(){e.previewKeyset()}))})}}),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(b){"use strict";b.keyboard=b.keyboard||{},b.fn.addScramble=function(e){var o={targetKeys:/[a-z\d]/i,byRow:!0,byKeySet:!1,randomizeOnce:!0,randomizeInput:!1,init:null,sameForAll:!1};return this.each(function(){var c,y=b(this).data("keyboard"),t=y.namespace+"Scramble",n=y.options;y&&!y.scramble_options&&(c=y.scramble_options=b.extend({},o,e),y.extensionNamespace.push(t),c.orig_create=n.create,y.scramble_setup=function(e){var t,n,o,i,a,s,r,p,u,l,d;if(t=e.find("."+b.keyboard.css.keySet),e.length){for(c.byKeySet&&(t=t.eq(0)),n=0;n<t.length;n++)if(o=t.eq(n),r=0,d=[],u=[],p=[],l=[],o.children("button, span, br").each(function(){"BR"===this.tagName?(c.byRow?(d.push(this),u.push(!1),l[r]=d,p[r]=u,d=[],u=[]):(l[r]=this,p[r]=!1),r++):(s=!(1!==(s=b(this).attr("data-value")||"").length||!c.targetKeys.test(s))&&s,c.byRow?(d.push(this),u.push(s)):(l[r]=this,p[r]=s,r++))}),o.find("."+b.keyboard.css.endRow).remove(),c.byRow)for(a=0;a<l.length;a++)for(d=y.shuffle(l[a],p[a]),i=0;i<d.length;i++)o.append(d[i]);else for(d=y.shuffle(l,p),i=0;i<d.length;i++)o.append(d[i]);return c.byKeySet&&(e=y.realign(e)),e}},y.getRandomUInt=function(e){var t=window.crypto||window.msCrypto;if(void 0===t)return Math.floor(Math.random()*e);var n=new Uint32Array(1);return t.getRandomValues(n),n[0]%e},y.shuffle=function(e,t){for(var n,o,i=e.length;0<i;)o=y.getRandomUInt(i),!1===t[i-1]&&i--,!1!==t[i-1]&&!1!==t[o]&&(n=e[--i],e[i]=e[o],e[o]=n);return e},y.realign=function(e){var n,o,i,a=e.find("."+b.keyboard.css.keySet),t=a.eq(0);return a=a.filter(":gt(0)"),t.children().each(function(e,t){o="BR"===t.tagName,i=b(t).attr("data-pos"),a.each(function(e,t){n=o?"br:first":'button[data-pos="'+i+'"]',b(t).find(n).appendTo(t)})}),e},y.setScrambleLayout=function(){if(!/^scrambled/.test(n.layout)){y.orig_layout=n.layout;var e=e||"scrambled"+Math.round(1e4*Math.random());n.layout=c.sameForAll?e:"scrambled"+Math.round(1e4*Math.random())}},n.create=function(){var e=n.layout;b.keyboard.builtLayouts[e]={mappedKeys:{},acceptedKeys:[],$keyboard:null},y.layout=n.layout=y.orig_layout,y.buildKeyboard(y.layout,!0),y.layout=n.layout=e,b.keyboard.builtLayouts[e]=b.extend(!0,{},b.keyboard.builtLayouts[y.orig_layout]),c.randomizeOnce&&(b.keyboard.builtLayouts[e].$keyboard=y.scramble_setup(b.keyboard.builtLayouts[y.orig_layout].$keyboard.clone())),y.$keyboard=b.keyboard.builtLayouts[e].$keyboard,c.randomizeInput?y.$el.unbind(b.keyboard.events.kbChange+t).bind(b.keyboard.events.kbChange+t,function(e,t){c.targetKeys.test(t.last.key)&&(t.$keyboard.find("."+n.css.buttonHover).removeClass(n.css.buttonHover),t.$keyboard=t.scramble_setup(t.$keyboard),b(document.elementFromPoint(e.clientX,e.clientY)).trigger("mouseenter"))}):c.randomizeOnce||y.$el.unbind(b.keyboard.events.kbBeforeVisible+t).bind(b.keyboard.events.kbBeforeVisible+t,function(e,t){t.$keyboard=t.scramble_setup(t.$keyboard)}),b.isFunction(c.orig_create)&&c.orig_create(y)},y.setScrambleLayout(),n.alwaysOpen&&y.$keyboard.length?setTimeout(function(){var e=b.keyboard.builtLayouts;y.$keyboard=y.scramble_setup(y.$keyboard),y.setScrambleLayout(),void 0===e[n.layout]&&(e[n.layout]={mappedKeys:b.extend({},e[y.layout].mappedKeys),acceptedKeys:b.extend([],e[y.layout].acceptedKeys),$keyboard:y.$keyboard.clone()}),b.isFunction(c.init)&&c.init(y)},0):b.isFunction(c.init)&&c.init(y))})}}),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(f){f.fn.addTyping=function(e){var t={showTyping:!0,lockTypeIn:!1,delay:250,hoverDelay:250},b=f.keyboard;return this.each(function(){var c,y=f(this).data("keyboard");y&&(c=y.typing_options=f.extend({},t,e),y.typing_keymap={" ":"space",'"':"34","'":"39","&nbsp;":"space","\b":"bksp","{b}":"bksp","{d}":"del","{l}":"left","{r}":"right","\n":"enter","\r":"enter","{e}":"enter","\t":"tab","{t}":"tab"},y.typing_xref={8:"bksp",9:"tab",13:"enter",32:"space",37:"left",39:"right",46:"del"},y.typing_event=!1,y.typing_namespace=y.namespace+"typing",y.extensionNamespace.push(y.typing_namespace),c.savedLockInput=y.options.lockInput,y.typing_setup_reset=function(){var e=b.events,t=y.typing_namespace,n=[e.kbHidden,e.kbInactive,""].join(t+" ");y.$el.unbind(t).bind(n,function(){y.typing_reset()}),y.unbindButton(t).bindButton("mousedown"+t,function(){y.typing_reset()})},y.typing_setup=function(){var e=y.typing_namespace;y.typing_setup_reset(),y.$el.bind(b.events.kbBeforeVisible+e,function(){y.typing_setup()}),y.$preview.unbind(e).bind("keyup"+e,function(e){return!(c.init&&c.lockTypeIn||!c.showTyping)&&(37<=e.which&&e.which<=40?void 0:(16===e.which&&(y.shiftActive=!1),18===e.which&&(y.altActive=!1),16===e.which||18===e.which?(y.showSet(),void setTimeout(function(){y.$preview&&y.$preview.focus()},200)):void 0))}).bind("keydown"+e,function(e){if(c.init&&c.lockTypeIn||!c.showTyping)return!1;e.temp=!1,16===e.which&&(e.temp=!y.shiftActive,y.shiftActive=!0),18===e.which&&(e.temp=!y.altActive,y.altActive=!0),e.temp&&(y.showSet(),y.$preview.focus()),y.typing_event=!0,y.typing_xref[e.which]&&y.typing_findKey("",e)}).bind("keypress"+e,function(e){if(c.init&&c.lockTypeIn)return!1;y.typing_event&&!y.options.lockInput&&(y.typing_reset(),y.typing_event=!0,y.typing_findKey("",e))})},y.typing_reset=function(){y.typing_event=c.init=!1,c.text="",c.len=c.current=0,y.options.lockInput=c.savedLockInput},y.typeIn=function(e,t,n,o){if(!y.isVisible())return clearTimeout(y.typing_timer),void y.typing_reset();if(y.typing_event){if(void 0===e)return y.typing_event=!1,void(y.options.lockInput=c.savedLockInput)}else!0!==c.init&&(c.init=!0,y.options.lockInput=c.lockTypeIn,c.text=e||c.text||"",c.len=c.text.length,c.delay=t||c.delay,c.current=0,n&&(c.callback=n)),"{"===(e=c.text.substring(c.current,++c.current))&&"}"===c.text.substring(c.current+1,c.current+2)&&(e+=c.text.substring(c.current,c.current+=2)),y.typing_findKey(e,o)},y.typing_findKey=function(e,t){var n,o,i,a,s,r,p,u,l=b.css,d=b.builtLayouts[y.layout].mappedKeys;if(y.isOpen&&y.$keyboard.length)if(r=y.$keyboard.find("."+l.keySet),a=e in y.typing_keymap?y.typing_keymap[e]:e,n="."+l.keyButton+'[data-action="'+a+'"]',y.typing_event&&t&&(n="keypress"!==t.type&&y.typing_xref.hasOwnProperty(t.keyCode||t.which)?"."+l.keyPrefix+y.processName(y.typing_xref[t.keyCode||t.which]):(o=String.fromCharCode(t.charCode||t.which),d.hasOwnProperty(o)?"."+l.keyButton+'[data-value="'+d[o].replace(/"/g,'\\"')+'"]':"."+l.keyPrefix+y.processName(o))),(s=r.filter(":visible").find(n)).length?y.typing_simulateKey(s,e,t):(u=(s=y.typing_event?r.find(n):(i=e in y.typing_keymap?y.typing_keymap[e]:y.processName(e),r.find("."+l.keyPrefix+i))).closest("."+l.keySet)).attr("name")?(c.showTyping&&(p=u.attr("name"),y.shiftActive=/shift/.test(p),y.altActive=/alt/.test(p),y.metaActive=y.last.keyset[2]=!!/\bmeta/.test(p)&&p.match(/meta[\w-]+/)[0],y.showSet(y.metaActive)),y.typing_simulateKey(s,e,t)):y.typing_event||(e in y.typing_keymap&&y.typing_keymap[e]in b.keyaction?b.keyaction[y.typing_keymap[e]](y,s,t):y.insertText(e),y.checkCombos(),y.$el.trigger(b.events.kbChange,[y,y.el])),c.current<=c.len&&0!==c.len){if(!y.isVisible())return;y.typing_timer=setTimeout(function(){y.typeIn()},c.delay)}else{if(0!==c.len)return y.typing_reset(),void(f.isFunction(c.callback)&&(y.typing_timer=setTimeout(function(){f.isFunction(c.callback)&&c.callback(y)},c.delay)));y.typing_reset()}},y.typing_simulateKey=function(e,t,n){var o=e.length;y.isVisible()&&(c.showTyping&&o&&(e.filter(":visible").trigger("mouseenter"+y.namespace),c.showTyping&&o&&setTimeout(function(){e.trigger("mouseleave"+y.namespace)},Math.min(c.hoverDelay,c.delay))),y.typing_event||setTimeout(function(){t in y.typing_keymap&&y.typing_keymap[t]in b.keyaction?((n=n||f.Event("keypress")).target=e,b.keyaction[y.typing_keymap[t]](y,e,n)):y.insertText(t),y.checkCombos(),y.$el.trigger(b.events.kbChange,[y,y.el])},c.delay/3))},c.showTyping&&y.options.alwaysOpen&&y.isVisible()?y.typing_setup():y.$el.unbind(b.events.kbBeforeVisible+y.typing_namespace).bind(b.events.kbBeforeVisible+y.typing_namespace,function(){c.showTyping?y.typing_setup():y.typing_setup_reset()}))})}}),

@@ -1,2 +0,2 @@

/*! jQuery UI Virtual Keyboard v1.28.9 */
!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(y){"use strict";var b=y.keyboard=function(c,o){var p,h=this;h.version="1.28.9",h.$el=y(c),h.el=c,h.$el.data("keyboard",h),h.init=function(){h.initialized=!1;var e,t,a,i=b.css,n=b.events;h.settings=o||{},o&&o.position&&(t=y.extend({},o.position),o.position=null),h.options=p=y.extend(!0,{},b.defaultOptions,o),t&&(p.position=t,o.position=t),h.el.active=!0,h.namespace=".keyboard"+Math.random().toString(16).slice(2),h.extensionNamespace=[],h.shiftActive=h.altActive=h.metaActive=h.sets=h.capsLock=!1,h.rows=["","-shift","-alt","-alt-shift"],h.inPlaceholder=h.$el.attr("placeholder")||"",h.watermark=b.watermark&&""!==h.inPlaceholder,h.repeatTime=1e3/(p.repeatRate||20),p.preventDoubleEventTime=p.preventDoubleEventTime||100,h.isOpen=!1,h.wheel=y.isFunction(y.fn.mousewheel),h.escapeRegex=/[-\/\\^$*+?.()|[\]{}]/g,h.isTextArea="textarea"===h.el.nodeName.toLowerCase(),h.isInput="input"===h.el.nodeName.toLowerCase(),h.isContentEditable=!h.isTextArea&&!h.isInput&&h.el.isContentEditable,e=b.keyCodes,h.alwaysAllowed=[e.capsLock,e.pageUp,e.pageDown,e.end,e.home,e.left,e.up,e.right,e.down,e.insert,e.delete],h.$keyboard=[],h.enabled=!0,h.checkCaret=p.lockInput||b.checkCaretSupport(),h.isContentEditable&&(p.usePreview=!1),h.last={start:0,end:0,key:"",val:"",preVal:"",layout:"",virtual:!0,keyset:[!1,!1,!1],wheel_$Keys:[],wheelIndex:0,wheelLayers:[]},h.temp=["",0,0],y.each([n.kbInit,n.kbBeforeVisible,n.kbVisible,n.kbHidden,n.inputCanceled,n.inputAccepted,n.kbBeforeClose,n.inputRestricted],function(e,t){y.isFunction(p[t])&&h.$el.bind(t+h.namespace+"callbacks",p[t])}),p.alwaysOpen&&(p.stayOpen=!0),a=y(document),h.el.ownerDocument!==document&&(a=a.add(h.el.ownerDocument));var s="keyup checkkeyboard mousedown touchstart ";p.closeByClickEvent&&(s+="click "),a.bind(s.split(" ").join(h.namespace+" "),function(e){clearTimeout(h.timer3),h.timer3=setTimeout(function(){h.checkClose(e)},1)}),h.$el.addClass(i.input+" "+p.css.input).attr({"aria-haspopup":"true",role:"textbox"}),(p.lockInput||h.el.readOnly)&&(p.lockInput=!0,h.$el.addClass(i.locked).attr({readonly:"readonly"})),h.isUnavailable()&&h.$el.addClass(i.noKeyboard),p.openOn&&h.bindFocus(),h.watermark||""!==h.getValue(h.$el)||""===h.inPlaceholder||""===h.$el.attr("placeholder")||(h.$el.addClass(i.placeholder),h.setValue(h.inPlaceholder,h.$el)),h.$el.trigger(n.kbInit,[h,h.el]),p.alwaysOpen&&h.reveal(),h.initialized=!0},h.toggle=function(){if(h.hasKeyboard()){var e=h.$keyboard.find("."+b.css.keyToggle),t=!h.enabled;return h.preview.readonly=t||h.options.lockInput,h.$keyboard.toggleClass(b.css.keyDisabled,t).find("."+b.css.keyButton).not(e).attr("aria-disabled",t).each(function(){this.disabled=t}),e.toggleClass(b.css.keyDisabled,t),t&&h.typing_options&&(h.typing_options.text=""),h}},h.setCurrent=function(){var e=b.css,t=y("."+e.isCurrent),a=t.data("keyboard");y.isEmptyObject(a)||a.el===h.el||a.close(!!a.options.autoAccept&&"true"),t.removeClass(e.isCurrent),y("."+e.hasFocus).removeClass(e.hasFocus),h.$el.addClass(e.isCurrent),h.$keyboard.addClass(e.hasFocus),h.isCurrent(!0),h.isOpen=!0},h.isUnavailable=function(){return h.$el.is(":disabled")||!h.options.activeOnReadonly&&h.$el.attr("readonly")&&!h.$el.hasClass(b.css.locked)},h.isCurrent=function(e){var t=b.currentKeyboard||!1;return e?t=b.currentKeyboard=h.el:!1===e&&t===h.el&&(t=b.currentKeyboard=""),t===h.el},h.hasKeyboard=function(){return h.$keyboard&&0<h.$keyboard.length},h.isVisible=function(){return!!h.hasKeyboard()&&h.$keyboard.is(":visible")},h.setFocus=function(){var e=h.$preview||h.$el;p.noFocus||e.focus(),h.isContentEditable?b.setEditableCaret(e,h.last.start,h.last.end):b.caret(e,h.last)},h.focusOn=function(){!h&&h.el.active||(h.isVisible()?h.setCurrent():(clearTimeout(h.timer),h.reveal()))},h.redraw=function(e){return e&&(h.options.layout=e),h.$keyboard.length&&(h.last.preVal=""+h.last.val,h.saveLastChange(),h.setValue(h.last.val,h.$el),h.removeKeyboard(),h.shiftActive=h.altActive=h.metaActive=!1),h.isOpen=p.alwaysOpen,h.reveal(!0),h},h.reveal=function(e){var t,a=h.isOpen,i=b.css;if(h.opening=!a,y("."+i.keyboard).not("."+i.alwaysOpen).each(function(){var e=y(this).data("keyboard");y.isEmptyObject(e)||e.close(!!e.options.autoAccept&&"true")}),!h.isUnavailable())return h.$el.removeClass(i.noKeyboard),p.openOn&&h.$el.unbind(y.trim((p.openOn+" ").split(/\s+/).join(h.namespace+" "))),h.$keyboard&&(!h.$keyboard||h.$keyboard.length&&!y.contains(h.el.ownerDocument.body,h.$keyboard[0]))||h.startup(),h.watermark||h.getValue()!==h.inPlaceholder||(h.$el.removeClass(i.placeholder),h.setValue("",h.$el)),h.originalContent=h.isContentEditable?h.$el.html():h.getValue(h.$el),h.el===h.preview||h.isContentEditable||h.setValue(h.originalContent),p.acceptValid&&p.checkValidOnInit&&h.checkValid(),p.resetDefault&&(h.shiftActive=h.altActive=h.metaActive=!1),h.showSet(),h.isVisible()||h.$el.trigger(b.events.kbBeforeVisible,[h,h.el]),(h.initialized||p.initialFocus||!p.initialFocus&&h.$el.hasClass(b.css.initialFocus))&&h.setCurrent(),h.toggle(),h.$keyboard.show(),p.usePreview&&b.msie&&(void 0===h.width&&(h.$preview.hide(),h.width=Math.ceil(h.$keyboard.width()),h.$preview.show()),h.$preview.width(h.width)),h.reposition(),h.checkDecimal(),h.lineHeight=parseInt(h.$preview.css("lineHeight"),10)||parseInt(h.$preview.css("font-size"),10)+4,p.caretToEnd&&(t=h.isContentEditable?b.getEditableLength(h.el):h.originalContent.length,h.saveCaret(t,t)),b.allie&&(0===h.last.end&&0<h.last.start&&(h.last.end=h.last.start),h.last.start<0&&(h.last.start=h.last.end=h.originalContent.length)),a||e?(b.caret(h.$preview,h.last),h.opening=!1):h.timer2=setTimeout(function(){var e;h.opening=!1,/(number|email)/i.test(h.el.type)||p.caretToEnd||h.saveCaret(e,e,h.$el),(p.initialFocus||h.$el.hasClass(b.css.initialFocus))&&b.caret(h.$preview,h.last),h.last.eventTime=(new Date).getTime(),h.$el.trigger(b.events.kbVisible,[h,h.el]),h.timer=setTimeout(function(){h&&h.saveCaret()},200)},10),h},h.updateLanguage=function(){var e=b.layouts,t=p.language||e[p.layout]&&e[p.layout].lang&&e[p.layout].lang||[p.language||"en"],a=b.language;t=y.isArray(t)?t[0]:t,t=(h.language=t).split("-")[0],p.display=y.extend(!0,{},a.en.display,a[t]&&a[t].display||{},h.settings.display),p.combos=y.extend(!0,{},a.en.combos,a[t]&&a[t].combos||{},h.settings.combos),p.wheelMessage=a[t]&&a[t].wheelMessage||a.en.wheelMessage,p.rtl=e[p.layout]&&e[p.layout].rtl||a[t]&&a[t].rtl||!1,a[t]&&a[t].comboRegex&&(h.regex=a[t].comboRegex),h.decimal=/^\./.test(p.display.dec),h.$el.toggleClass("rtl",p.rtl).css("direction",p.rtl?"rtl":"")},h.startup=function(){var e=b.css;(p.alwaysOpen||p.userClosed)&&h.$preview||h.makePreview(),h.hasKeyboard()||("custom"===p.layout&&(p.layoutHash="custom"+h.customHash()),h.layout="custom"===p.layout?p.layoutHash:p.layout,h.last.layout=h.layout,h.updateLanguage(),void 0===b.builtLayouts[h.layout]&&(y.isFunction(p.create)?h.$keyboard=p.create(h):h.$keyboard.length||h.buildKeyboard(h.layout,!0)),h.$keyboard=b.builtLayouts[h.layout].$keyboard.clone(),h.$keyboard.data("keyboard",h),""!==(h.el.id||"")&&h.$keyboard.attr("id",h.el.id+b.css.idSuffix),h.makePreview()),h.$keyboard.attr("data-"+e.keyboard+"-layout",p.layout).attr("data-"+e.keyboard+"-language",h.language),h.$decBtn=h.$keyboard.find("."+e.keyPrefix+"dec"),(p.enterNavigation||h.isTextArea)&&h.alwaysAllowed.push(b.keyCodes.enter),h.bindKeyboard(),h.$keyboard.appendTo(p.appendLocally?h.$el.parent():p.appendTo||"body"),h.bindKeys(),p.reposition&&y.ui&&y.ui.position&&"body"===p.appendTo&&y(window).bind("resize"+h.namespace,function(){h.reposition()})},h.reposition=function(){return h.position=!y.isEmptyObject(p.position)&&p.position,y.ui&&y.ui.position&&h.position&&(h.position.of=h.position.of||h.$el.data("keyboardPosition")||h.$el,h.position.collision=h.position.collision||"flipfit flipfit",h.position.at=p.usePreview?p.position.at:p.position.at2,h.isVisible()&&h.$keyboard.position(h.position)),h},h.makePreview=function(){if(p.usePreview){var e,t,a,i,n=b.css;for(h.$preview=h.$el.clone(!1).data("keyboard",h).removeClass(n.placeholder+" "+n.input).addClass(n.preview+" "+p.css.input).attr("tabindex","-1").show(),h.preview=h.$preview[0],"number"===h.preview.type&&(h.preview.type="text"),i=/^(data-|id|aria-haspopup)/i,e=(t=h.$preview.get(0).attributes).length-1;0<=e;e--)a=t[e]&&t[e].name,i.test(a)&&h.preview.removeAttribute(a);y("<div />").addClass(n.wrapper).append(h.$preview).prependTo(h.$keyboard)}else h.$preview=h.$el,h.preview=h.el},h.caret=function(e,t){var a=b.caret(h.$preview,e,t);return a instanceof y?(h.saveCaret(a.start,a.end),h):a},h.saveCaret=function(e,t,a){var i;h.isCurrent()&&(i=void 0===e?b.caret(a||h.$preview):b.caret(a||h.$preview,e,t),h.last.start=void 0===e?i.start:e,h.last.end=void 0===t?i.end:t)},h.saveLastChange=function(e){h.last.val=e||h.getValue(h.$preview||h.$el),h.isContentEditable&&(h.last.elms=h.el.cloneNode(!0))},h.setScroll=function(){if(!h.isContentEditable&&h.last.virtual){var e,t,a,i,n=h.last.val.substring(0,Math.max(h.last.start,h.last.end));h.$previewCopy||(h.$previewCopy=h.$preview.clone().removeAttr("id").css({position:"absolute",left:0,zIndex:-10,visibility:"hidden"}).addClass(b.css.inputClone),h.$previewCopy[0].disabled=!0,h.isTextArea||h.$previewCopy.css({"white-space":"pre",width:0}),p.usePreview?h.$preview.after(h.$previewCopy):h.$keyboard.prepend(h.$previewCopy)),h.isTextArea?(h.$previewCopy.height(h.lineHeight).val(n),h.preview.scrollTop=h.lineHeight*(Math.floor(h.$previewCopy[0].scrollHeight/h.lineHeight)-1)):(h.$previewCopy.val(n.replace(/\s/g," ")),a=/c/i.test(p.scrollAdjustment)?h.preview.clientWidth/2:p.scrollAdjustment,e=h.$previewCopy[0].scrollWidth-1,void 0===h.last.scrollWidth&&(h.last.scrollWidth=e,h.last.direction=!0),i=h.last.scrollWidth===e?h.last.direction:h.last.scrollWidth<e,t=h.preview.clientWidth-a,i?h.preview.scrollLeft=e<t?0:e-t:e>=h.preview.scrollWidth-t?h.preview.scrollLeft=h.preview.scrollWidth-a:h.preview.scrollLeft=0<e-a?e-a:0,h.last.scrollWidth=e,h.last.direction=i)}},h.bindFocus=function(){p.openOn&&h&&h.el.active&&(h.$el.bind(p.openOn+h.namespace,function(){h.focusOn()}),y(":focus")[0]===h.el&&h.$el.blur())},h.bindKeyboard=function(){var s,o=b.keyCodes,r=b.builtLayouts[h.layout],e=h.namespace+"keybindings";h.$preview.unbind(h.namespace).bind("click"+e+" touchstart"+e,function(){p.alwaysOpen&&!h.isCurrent()&&h.reveal(),h.timer2=setTimeout(function(){h&&h.saveCaret()},150)}).bind("keypress"+e,function(e){if(p.lockInput)return!1;if(h.isCurrent()){var t=e.charCode||e.which,a=t>=o.A&&t<=o.Z,i=t>=o.a&&t<=o.z,n=h.last.key=String.fromCharCode(t);if(!(t<o.space)){if(h.last.virtual=!1,h.last.event=e,h.last.$key=[],h.checkCaret&&h.saveCaret(),t!==o.capsLock&&(a||i)&&(h.capsLock=a&&!e.shiftKey||i&&e.shiftKey,h.capsLock&&!h.shiftActive&&(h.shiftActive=!0,h.showSet())),p.restrictInput){if((e.which===o.backSpace||0===e.which)&&y.inArray(e.keyCode,h.alwaysAllowed))return;-1===y.inArray(n,r.acceptedKeys)&&(e.preventDefault(),(s=y.extend({},e)).type=b.events.inputRestricted,h.$el.trigger(s,[h,h.el]))}else if((e.ctrlKey||e.metaKey)&&(e.which===o.A||e.which===o.C||e.which===o.V||e.which>=o.X&&e.which<=o.Z))return;r.hasMappedKeys&&r.mappedKeys.hasOwnProperty(n)&&(h.last.key=r.mappedKeys[n],h.insertText(h.last.key),e.preventDefault()),"function"==typeof p.beforeInsert&&(h.insertText(h.last.key),e.preventDefault()),h.checkMaxLength()}}}).bind("keyup"+e,function(e){if(h.isCurrent()){switch(h.last.virtual=!1,e.which){case o.tab:if(h.tab&&!p.lockInput){h.shiftActive=e.shiftKey;var t=b.keyaction.tab(h);if(h.tab=!1,!t)return!1}else e.preventDefault();break;case o.escape:return p.ignoreEsc||h.close(!(!p.autoAccept||!p.autoAcceptOnEsc)&&"true"),!1}clearTimeout(h.throttled),h.throttled=setTimeout(function(){h&&h.isVisible()&&h.checkCombos()},100),h.checkMaxLength(),h.last.preVal=""+h.last.val,h.saveLastChange();var a=y.Event(b.events.kbChange);if(a.action=h.last.key,h.$el.trigger(a,[h,h.el]),y.isFunction(p.change))return a.type=b.events.inputChange,p.change(a,h,h.el),!1;p.acceptValid&&p.autoAcceptOnValid&&y.isFunction(p.validate)&&p.validate(h,h.getValue(h.$preview))&&(h.$preview.blur(),h.accept())}}).bind("keydown"+e,function(e){if(h.last.keyPress=e.which,p.alwaysOpen&&!h.isCurrent()&&h.reveal(),e.which===o.tab)return!(h.tab=!0);if(p.lockInput||e.timeStamp===h.last.timeStamp)return!p.lockInput;switch(h.last.timeStamp=e.timeStamp,h.last.virtual=!1,e.which){case o.backSpace:b.keyaction.bksp(h,null,e),e.preventDefault();break;case o.enter:b.keyaction.enter(h,null,e);break;case o.capsLock:h.shiftActive=h.capsLock=!h.capsLock,h.showSet();break;case o.V:if(e.ctrlKey||e.metaKey){if(p.preventPaste)return void e.preventDefault();h.checkCombos()}}}).bind("mouseup touchend ".split(" ").join(e+" "),function(){h.last.virtual=!0,h.saveCaret()}),h.$keyboard.bind("mousedown click touchstart ".split(" ").join(h.namespace+" "),function(e){e.stopPropagation(),h.isCurrent()||(h.reveal(),y(h.el.ownerDocument).trigger("checkkeyboard"+h.namespace)),h.setFocus()}),p.preventPaste&&(h.$preview.bind("contextmenu"+h.namespace,function(e){e.preventDefault()}),h.$el.bind("contextmenu"+h.namespace,function(e){e.preventDefault()}))},h.bindButton=function(e,t){var a="."+b.css.keyButton,i=function(e){e.stopPropagation(),e.$target=y(this).closest("."+b.css.keyboard+", ."+b.css.input),t.call(this,e)};return y.fn.on?h.$keyboard.on(e,a,i):y.fn.delegate&&h.$keyboard.delegate(a,e,i),h},h.unbindButton=function(e){return y.fn.off?h.$keyboard.off(e):y.fn.undelegate&&h.$keyboard.undelegate("."+b.css.keyButton,e),h},h.bindKeys=function(){var s=b.css;h.unbindButton(h.namespace+" "+h.namespace+"kb").bindButton("mouseenter mouseleave touchstart ".split(" ").join(h.namespace+" "),function(e){if(!p.alwaysOpen&&!p.userClosed||"mouseleave"===e.type||h.isCurrent()||(h.reveal(),h.setFocus()),h.isCurrent()&&!this.disabled){var t,a,i=h.last,n=y(this),s=e.type;p.useWheel&&h.wheel&&(t=h.getLayers(n),a=(t.length?t.map(function(){return y(this).attr("data-value")||""}).get():"")||[n.text()],i.wheel_$Keys=t,i.wheelLayers=a,i.wheelIndex=y.inArray(n.attr("data-value"),a)),"mouseenter"!==s&&"touchstart"!==s||"password"===h.el.type||n.hasClass(p.css.buttonDisabled)||(n.addClass(p.css.buttonHover),p.useWheel&&h.wheel&&n.attr("title",function(e,t){return h.wheel&&""===t&&h.sets&&1<a.length&&"touchstart"!==s?p.wheelMessage:t})),"mouseleave"===s&&(n.removeClass("password"===h.el.type?"":p.css.buttonHover),p.useWheel&&h.wheel&&(i.wheelIndex=0,i.wheelLayers=[],i.wheel_$Keys=[],n.attr("title",function(e,t){return t===p.wheelMessage?"":t}).html(n.attr("data-html"))))}}).bindButton(p.keyBinding.split(" ").join(h.namespace+" ")+h.namespace+" "+b.events.kbRepeater,function(e){if(e.preventDefault(),!h.$keyboard.is(":visible")||this.disabled)return!1;var t,a=h.last,i=y(this),n=(new Date).getTime();if(p.useWheel&&h.wheel&&(i=a.wheel_$Keys.length&&-1<a.wheelIndex?a.wheel_$Keys.eq(a.wheelIndex):i),t=i.attr("data-action"),!(n-(a.eventTime||0)<p.preventDoubleEventTime)){if(a.eventTime=n,a.event=e,a.virtual=!0,a.$key=i,a.key=i.attr("data-value"),a.keyPress="",h.setFocus(),/^meta/.test(t)&&(t="meta"),t===a.key&&"string"==typeof b.keyaction[t])a.key=t=b.keyaction[t];else if(t in b.keyaction&&y.isFunction(b.keyaction[t])){if(!1===b.keyaction[t](h,this,e))return!1;t=null}return!!h.hasKeyboard()&&(null!=t&&(a.key=y(this).hasClass(s.keyAction)?t:a.key,h.insertText(a.key),h.capsLock||p.stickyShift||e.shiftKey||(h.shiftActive=!1,h.showSet(i.attr("data-name")))),b.caret(h.$preview,a),h.checkCombos(),(e=y.extend({},e,y.Event(b.events.kbChange))).target=h.el,e.action=a.key,h.$el.trigger(e,[h,h.el]),a.preVal=""+a.val,h.saveLastChange(),y.isFunction(p.change)?(e.type=b.events.inputChange,p.change(e,h,h.el),!1):void 0)}}).bindButton("mouseup"+h.namespace+" "+"mouseleave touchend touchmove touchcancel ".split(" ").join(h.namespace+"kb "),function(e){h.last.virtual=!0;var t,a=y(this);if("touchmove"===e.type){if((t=a.offset()).right=t.left+a.outerWidth(),t.bottom=t.top+a.outerHeight(),e.originalEvent.touches[0].pageX>=t.left&&e.originalEvent.touches[0].pageX<t.right&&e.originalEvent.touches[0].pageY>=t.top&&e.originalEvent.touches[0].pageY<t.bottom)return!0}else/(mouseleave|touchend|touchcancel)/i.test(e.type)?a.removeClass(p.css.buttonHover):(!p.noFocus&&h.isCurrent()&&h.isVisible()&&h.$preview.focus(),h.checkCaret&&b.caret(h.$preview,h.last));return h.mouseRepeat=[!1,""],clearTimeout(h.repeater),p.acceptValid&&p.autoAcceptOnValid&&y.isFunction(p.validate)&&p.validate(h,h.getValue())&&(h.$preview.blur(),h.accept()),!1}).bindButton("click"+h.namespace,function(){return!1}).bindButton("mousewheel"+h.namespace,h.throttleEvent(function(e,t){var a=y(this);if(a&&!a.hasClass(s.keyAction)&&h.last.wheel_$Keys[0]===this&&p.useWheel&&h.wheel){t=t||e.deltaY;var i,n=h.last.wheelLayers||[];return 1<n.length?((i=h.last.wheelIndex+(0<t?-1:1))>n.length-1&&(i=0),i<0&&(i=n.length-1)):i=0,h.last.wheelIndex=i,a.html(n[i]),!1}},30)).bindButton("mousedown touchstart ".split(" ").join(h.namespace+"kb "),function(){var e=y(this);if(e&&(!e.hasClass(s.keyAction)||e.is("."+s.keyPrefix+"tab bksp space enter".split(" ").join(",."+s.keyPrefix))))return 0!==p.repeatRate&&(h.mouseRepeat=[!0,e],setTimeout(function(){h&&h.mouseRepeat[0]&&h.mouseRepeat[1]===e&&!e[0].disabled&&h.repeatKey(e)},p.repeatDelay)),!1})},h.throttleEvent=function(e,t){var a;return function(){a||(e.apply(this,arguments),a=!0,setTimeout(function(){a=!1},t))}},h.execCommand=function(e,t){h.el.ownerDocument.execCommand(e,!1,t),h.el.normalize(),p.reposition&&h.reposition()},h.getValue=function(e){return(e=e||h.$preview)[h.isContentEditable?"text":"val"]()},h.setValue=function(e,t){return t=t||h.$preview,h.isContentEditable?e!==t.text()&&(b.replaceContent(t,e),h.saveCaret()):t.val(e),h},h.insertText=function(e){if(!h.$preview)return h;if("function"==typeof p.beforeInsert&&(e=p.beforeInsert(h.last.event,h,h.el,e)),void 0===e||!1===e)return h.last.key="",h;if(h.isContentEditable)return h.insertContentEditable(e);var t,a=!1,i="\b"===e,n=h.getValue(),s=b.caret(h.$preview),o=n.length;return s.end<s.start&&(s.end=s.start),s.start>o&&(s.end=s.start=o),h.isTextArea&&b.msie&&"\n"===n.substring(s.start,s.start+1)&&(s.start+=1,s.end+=1),t=s.start,"{d}"===e&&(e="",s.end+=1),i&&(e="",a=i&&t===s.end&&0<t),n=n.substring(0,t-(a?1:0))+e+n.substring(s.end),t+=a?-1:e.length,h.setValue(n),h.saveCaret(t,t),h.setScroll(),h},h.insertContentEditable=function(e){return h.$preview.focus(),h.execCommand("insertText",e),h.saveCaret(),h},h.checkMaxLength=function(){if(h.$preview){var e,t,a=h.getValue(),i=h.isContentEditable?b.getEditableLength(h.el):a.length;return!1!==p.maxLength&&i>p.maxLength&&(e=b.caret(h.$preview).start,t=Math.min(e,p.maxLength),p.maxInsert||(a=h.last.val,t=e-1),h.setValue(a.substring(0,p.maxLength)),h.saveCaret(t,t)),h.$decBtn.length&&h.checkDecimal(),h}},h.repeatKey=function(e){e.trigger(b.events.kbRepeater),h.mouseRepeat[0]&&(h.repeater=setTimeout(function(){h&&h.repeatKey(e)},h.repeatTime))},h.getKeySet=function(){var e=[];return h.altActive&&e.push("alt"),h.shiftActive&&e.push("shift"),h.metaActive&&e.push(h.metaActive),e.length?e.join("+"):"normal"},h.showKeySet=function(e){return"string"==typeof e?(h.last.keyset=[h.shiftActive,h.altActive,h.metaActive],h.shiftActive=/shift/i.test(e),h.altActive=/alt/i.test(e),/\bmeta/.test(e)?(h.metaActive=!0,h.showSet(e.match(/\bmeta[\w-]+/i)[0])):(h.metaActive=!1,h.showSet())):h.showSet(e),h},h.showSet=function(e){if(h.hasKeyboard()){p=h.options;var t=b.css,a="."+t.keyPrefix,i=p.css.buttonActive,n="",s=(h.shiftActive?1:0)+(h.altActive?2:0);if(h.shiftActive||(h.capsLock=!1),h.metaActive?(h.shiftActive&&(e=(e||"").replace("-shift","")),h.altActive&&(e=(e||"").replace("-alt","")),""===(n=/^meta/i.test(e)?e:"")?n=!0===h.metaActive?"":h.metaActive:h.metaActive=n,(!p.stickyShift&&h.last.keyset[2]!==h.metaActive||(h.shiftActive||h.altActive)&&!h.$keyboard.find("."+t.keySet+"-"+n+h.rows[s]).length)&&(h.shiftActive=h.altActive=!1)):!p.stickyShift&&h.last.keyset[2]!==h.metaActive&&h.shiftActive&&(h.shiftActive=h.altActive=!1),n=0!==(s=(h.shiftActive?1:0)+(h.altActive?2:0))||h.metaActive?""===n?"":"-"+n:"-normal",!h.$keyboard.find("."+t.keySet+n+h.rows[s]).length)return h.shiftActive=h.last.keyset[0],h.altActive=h.last.keyset[1],void(h.metaActive=h.last.keyset[2]);h.$keyboard.find(a+"alt,"+a+"shift,."+t.keyAction+"[class*=meta]").removeClass(i).end().find(a+"alt").toggleClass(i,h.altActive).end().find(a+"shift").toggleClass(i,h.shiftActive).end().find(a+"lock").toggleClass(i,h.capsLock).end().find("."+t.keySet).hide().end().find("."+(t.keyAction+a+n).replace("--","-")).addClass(i),h.$keyboard.find("."+t.keySet+n+h.rows[s])[0].style.display="inline-block",h.metaActive&&h.$keyboard.find(a+h.metaActive).toggleClass(i,!1!==h.metaActive),h.last.keyset=[h.shiftActive,h.altActive,h.metaActive],h.$el.trigger(b.events.kbKeysetChange,[h,h.el]),p.reposition&&h.reposition()}},h.checkCombos=function(){if(!(h.isVisible()||h.hasKeyboard()&&h.$keyboard.hasClass(b.css.hasFocus)))return h.getValue(h.$preview||h.$el);var e,t,a,i,n=h.getValue(),s=b.caret(h.$preview),o=b.builtLayouts[h.layout],r=h.isContentEditable?b.getEditableLength(h.el):n.length,l=r;return""===n||(s.end<s.start&&(s.end=s.start),s.start>l&&(s.end=s.start=l),b.msie&&"\n"===n.substring(s.start,s.start+1)&&(s.start+=1,s.end+=1),p.useCombos&&(b.msie?n=n.replace(h.regex,function(e,t,a){return p.combos.hasOwnProperty(t)&&p.combos[t][a]||e}):h.$preview.length&&(t=s.start-(0<=s.start-2?2:0),b.caret(h.$preview,t,s.end),a=(i=function(e){return(e||"").replace(h.regex,function(e,t,a){return p.combos.hasOwnProperty(t)&&p.combos[t][a]||e})})((t=b.caret(h.$preview)).text),t&&t.replaceStr&&a!==t.text&&(h.isContentEditable?b.replaceContent(c,i):h.setValue(t.replaceStr(a))),n=h.getValue())),p.restrictInput&&""!==n&&(t=o.acceptedKeys.length,(e=o.acceptedKeysRegex)||(a=y.map(o.acceptedKeys,function(e){return e.replace(h.escapeRegex,"\\$&")}),-1<h.alwaysAllowed.indexOf(b.keyCodes.enter)&&a.push("\\n"),e=o.acceptedKeysRegex=new RegExp("("+a.join("|")+")","g")),(a=n.match(e))?n=a.join(""):(n="",l=0)),s.start+=r-l,s.end+=r-l,h.setValue(n),h.saveCaret(s.start,s.end),h.setScroll(),h.checkMaxLength()),p.acceptValid&&h.checkValid(),n},h.checkValid=function(){var e=b.css,t=h.$keyboard.find("."+e.keyPrefix+"accept"),a=!0;y.isFunction(p.validate)&&(a=p.validate(h,h.getValue(),!1)),t.toggleClass(e.inputInvalid,!a).toggleClass(e.inputValid,a).attr("title",t.attr("data-title")+" ("+p.display[a?"valid":"invalid"]+")")},h.checkDecimal=function(){h.decimal&&/\./g.test(h.preview.value)||!h.decimal&&/\,/g.test(h.preview.value)?h.$decBtn.attr({disabled:"disabled","aria-disabled":"true"}).removeClass(p.css.buttonHover).addClass(p.css.buttonDisabled):h.$decBtn.removeAttr("disabled").attr({"aria-disabled":"false"}).addClass(p.css.buttonDefault).removeClass(p.css.buttonDisabled)},h.getLayers=function(e){var t=b.css,a=e.attr("data-pos");return e.closest("."+t.keyboard).find('button[data-pos="'+a+'"]').filter(function(){return""!==y(this).find("."+t.keyText).text()}).add(e)},h.switchInput=function(e,t){if(y.isFunction(p.switchInput))p.switchInput(h,e,t);else{h.$keyboard.length&&h.$keyboard.hide();var a,i=!1,n=y("button, input, select, textarea, a, [contenteditable]").filter(":visible").not(":disabled"),s=n.index(h.$el)+(e?1:-1);if(h.$keyboard.length&&h.$keyboard.show(),s>n.length-1&&(i=p.stopAtEnd,s=0),s<0&&(i=p.stopAtEnd,s=n.length-1),!i){if(!(t=h.close(t)))return;(a=n.eq(s).data("keyboard"))&&a.options.openOn.length?a.focusOn():n.eq(s).focus()}}return!1},h.close=function(e){if(h.isOpen&&h.$keyboard.length){clearTimeout(h.throttled);var t=b.css,a=b.events,i=e?h.checkCombos():h.originalContent;if(e&&y.isFunction(p.validate)&&!p.validate(h,i,!0)&&(i=h.originalContent,e=!1,p.cancelClose))return;h.isCurrent(!1),h.isOpen=p.alwaysOpen||p.userClosed,h.isContentEditable&&!e?h.$el.html(i):h.setValue(i,h.$el),h.$el.removeClass(t.isCurrent+" "+t.inputAutoAccepted).addClass(e?!0===e?"":t.inputAutoAccepted:"").trigger(a.inputChange),p.alwaysOpen||h.$el.trigger(a.kbBeforeClose,[h,h.el,e||!1]),b.caret(h.$preview,h.last),h.$el.trigger(e?a.inputAccepted:a.inputCanceled,[h,h.el]).trigger(p.alwaysOpen?a.kbInactive:a.kbHidden,[h,h.el]).blur(),h&&(h.last.eventTime=(new Date).getTime(),p.alwaysOpen||p.userClosed&&"true"===e||!h.$keyboard.length||(h.removeKeyboard(),h.timer=setTimeout(function(){h&&h.bindFocus()},200)),h.watermark||""!==h.el.value||""===h.inPlaceholder||(h.$el.addClass(t.placeholder),h.setValue(h.inPlaceholder,h.$el)))}return!!e},h.accept=function(){return h.close(!0)},h.checkClose=function(e){if(!h.opening){var t=y.keyboard.css,a=e.$target||y(e.target).closest("."+b.css.keyboard+", ."+b.css.input);if(a.length||(a=y(e.target)),a.length&&a.hasClass(t.keyboard)){var i=a.data("keyboard");i!==h&&!i.$el.hasClass(t.isCurrent)&&i.options.openOn&&e.type===p.openOn&&i.focusOn()}else h.escClose(e,a)}},h.escCloseCallback={keepOpen:function(){return!h.isOpen}},h.escClose=function(e,t){if(h.isOpen){if(e&&"keyup"===e.type)return e.which!==b.keyCodes.escape||p.ignoreEsc?"":h.close(!(!p.autoAccept||!p.autoAcceptOnEsc)&&"true");var a=!1,i=t.length&&t||y(e.target);if(y.each(h.escCloseCallback,function(e,t){"function"==typeof t&&(a=a||t(i))}),!a&&(!h.isCurrent()&&h.isOpen||h.isOpen&&i[0]!==h.el)){if((p.stayOpen||p.userClosed)&&!i.hasClass(b.css.input))return;if(b.allie&&e.preventDefault(),p.closeByClickEvent){var n=i[0]&&i[0].nodeName.toLowerCase();"input"!==n&&"textarea"!==n&&"click"!==e.type||h.close(!!p.autoAccept&&"true")}else h.close(!!p.autoAccept&&"true")}}},h.keyBtn=y("<button />").attr({role:"button",type:"button","aria-disabled":"false",tabindex:"-1"}).addClass(b.css.keyButton),h.processName=function(e){var t,a,i=(e||"").replace(/[^a-z0-9-_]/gi,""),n=i.length,s=[];if(1<n&&e===i)return e;if(n=e.length){for(t=0;t<n;t++)a=e[t],s.push(/[a-z0-9-_]/i.test(a)?/[-_]/.test(a)&&0!==t?"":a:(0===t?"":"-")+a.charCodeAt(0));return s.join("")}return e},h.processKeys=function(e){var t,a=e.split(/:(?!\/\/)/),i=e.indexOf("</"),n=e.indexOf(":",e.indexOf("<")),s={name:null,map:"",title:""};return-1<i&&(n<0||i<n)?s.name=e:(/\(.+\)/.test(a[0])||/^:\(.+\)/.test(e)||/\([(:)]\)/.test(e)?/\([(:)]\)/.test(e)?(t=a[0].match(/([^(]+)\((.+)\)/))&&t.length?(s.name=t[1],s.map=t[2],s.title=1<a.length?a.slice(1).join(":"):""):(s.name=e.match(/([^(]+)/)[0],":"===s.name&&(a=a.slice(1)),null===t&&(s.map=":",a=a.slice(2)),s.title=a.length?a.join(":"):""):(s.map=e.match(/\(([^()]+?)\)/)[1],""===(t=(e=e.replace(/\(([^()]+)\)/,"")).split(":"))[0]?(s.name=":",a=a.slice(1)):s.name=t[0],s.title=1<a.length?a.slice(1).join(":"):""):(""!==e&&""===a[0]?(s.name=":",a=a.slice(1)):s.name=a[0],s.title=1<a.length?a.slice(1).join(":"):""),s.title=y.trim(s.title).replace(/_/g," ")),s},h.addKey=function(e,t,a){var i,n,s,o={},r=h.processKeys(a?e:t),l=b.css;return!a&&p.display[r.name]?(s=h.processKeys(p.display[r.name])).action=h.processKeys(e).name:(s=r).action=r.name,o.name=h.processName(r.name),""!==s.name&&(""!==s.map?(b.builtLayouts[h.layout].mappedKeys[s.map]=s.name,b.builtLayouts[h.layout].acceptedKeys.push(s.name)):a&&b.builtLayouts[h.layout].acceptedKeys.push(s.name)),i=a?""===o.name?"":l.keyPrefix+o.name:l.keyAction+" "+l.keyPrefix+s.action,i+=(2<s.name.length?" "+l.keyWide:"")+" "+p.css.buttonDefault,o.html='<span class="'+l.keyText+'">'+s.name.replace(/[\u00A0-\u9999]/gim,function(e){return"&#"+e.charCodeAt(0)+";"})+"</span>",o.$key=h.keyBtn.clone().attr({"data-value":a?s.name:s.action,"data-name":s.action,"data-pos":h.temp[1]+","+h.temp[2],"data-action":s.action,"data-html":o.html}).addClass(i).html(o.html).appendTo(h.temp[0]),s.map&&o.$key.attr("data-mapped",s.map),(s.title||r.title)&&o.$key.attr({"data-title":r.title||s.title,title:r.title||s.title}),"function"==typeof p.buildKey&&(n=(o=p.buildKey(h,o)).$key.html(),o.$key.attr("data-html",n)),o.$key},h.customHash=function(e){var t,a,i,n,s=[],o=[];for(a in e=void 0===e?p.customLayout:e)e.hasOwnProperty(a)&&s.push(e[a]);if((i=0)===(n=(o=o.concat.apply(o,s).join(" ")).length))return i;for(t=0;t<n;t++)i=(i<<5)-i+o.charCodeAt(t),i&=i;return i},h.buildKeyboard=function(e,t){y.isEmptyObject(p.display)&&h.updateLanguage();var a,i,n,s,o=b.css,r=0,l=b.builtLayouts[e||h.layout||p.layout]={mappedKeys:{},acceptedKeys:[]},c=l.acceptedKeys=p.restrictInclude&&(""+p.restrictInclude).split(/\s+/)||[],d=o.keyboard+" "+p.css.popup+" "+p.css.container+(p.alwaysOpen||p.userClosed?" "+o.alwaysOpen:""),u=y("<div />").addClass(d).attr({role:"textbox"}).hide();return-1<(a=y.inArray("{space}",c))&&(c[a]=" "),d=t&&"custom"===p.layout||!b.layouts.hasOwnProperty(p.layout)?(p.layout="custom",b.layouts.custom=p.customLayout||{normal:["{cancel}"]}):b.layouts[t?p.layout:e||h.layout||p.layout],y.each(d,function(e,t){if(""!==e&&!/^(name|lang|rtl)$/i.test(e))for("default"===e&&(e="normal"),r++,n=y("<div />").attr("name",e).addClass(o.keySet+" "+o.keySet+"-"+e).appendTo(u).toggle("normal"===e),i=0;i<t.length;i++)s=y.trim(t[i]).replace(/\{(\.?)[\s+]?:[\s+]?(\.?)\}/g,"{$1:$2}"),h.buildRow(n,i,s.split(/\s+/),c),n.find("."+o.keyButton+",."+o.keySpacer).filter(":last").after('<br class="'+o.endRow+'"/>')}),1<r&&(h.sets=!0),l.hasMappedKeys=!y.isEmptyObject(l.mappedKeys),l.$keyboard=u},h.buildRow=function(e,t,a,i){var n,s,o,r,l,c,d=b.css;for(o=0;o<a.length;o++)if(r=!(h.temp=[e,t,o]),0!==a[o].length)if(/^\{\S+\}$/.test(a[o])){if(l=a[o].match(/^\{(\S+)\}$/)[1],/\!\!/.test(l)&&(l=l.replace("!!",""),r=!0),/^sp:((\d+)?([\.|,]\d+)?)(em|px)?$/i.test(l)&&(c=parseFloat(l.replace(/,/,".").match(/^sp:((\d+)?([\.|,]\d+)?)(em|px)?$/i)[1]||0),y('<span class="'+d.keyText+'"></span>').width(l.match(/px/i)?c+"px":2*c+"em").addClass(d.keySpacer).appendTo(e)),/^empty(:((\d+)?([\.|,]\d+)?)(em|px)?)?$/i.test(l)){c=/:/.test(l)?parseFloat(l.replace(/,/,".").match(/^empty:((\d+)?([\.|,]\d+)?)(em|px)?$/i)[1]||0):"",h.addKey(""," ",!0).addClass(p.css.buttonDisabled+" "+p.css.buttonEmpty).attr("aria-disabled",!0).width(c?l.match("px")?c+"px":2*c+"em":"");continue}if(/^meta[\w-]+\:?(\w+)?/i.test(l)){h.addKey(l.split(":")[0],l).addClass(d.keyHasActive);continue}switch((s=l.split(":"))[0].toLowerCase()){case"a":case"accept":h.addKey("accept",l).addClass(p.css.buttonAction+" "+d.keyAction);break;case"alt":case"altgr":h.addKey("alt",l).addClass(d.keyHasActive);break;case"b":case"bksp":h.addKey("bksp",l);break;case"c":case"cancel":h.addKey("cancel",l).addClass(p.css.buttonAction+" "+d.keyAction);break;case"combo":h.addKey("combo",l).addClass(d.keyHasActive).attr("title",function(e,t){return t+" "+p.display[p.useCombos?"active":"disabled"]}).toggleClass(p.css.buttonActive,p.useCombos);break;case"dec":i.push(h.decimal?".":","),h.addKey("dec",l);break;case"e":case"enter":h.addKey("enter",l).addClass(p.css.buttonAction+" "+d.keyAction);break;case"lock":h.addKey("lock",l).addClass(d.keyHasActive);break;case"s":case"shift":h.addKey("shift",l).addClass(d.keyHasActive);break;case"sign":i.push("-"),h.addKey("sign",l);break;case"space":i.push(" "),h.addKey("space",l);break;case"t":case"tab":h.addKey("tab",l);break;default:b.keyaction.hasOwnProperty(s[0])&&h.addKey(s[0],l).toggleClass(p.css.buttonAction+" "+d.keyAction,r)}}else n=a[o],h.addKey(n,n,!0)},h.removeBindings=function(e){y(document).unbind(e),h.el.ownerDocument!==document&&y(h.el.ownerDocument).unbind(e),y(window).unbind(e),h.$el.unbind(e)},h.removeKeyboard=function(){h.$decBtn=[],p.usePreview&&h.$preview.removeData("keyboard"),h.$preview.unbind(h.namespace+"keybindings"),h.preview=null,h.$preview=null,h.$previewCopy=null,h.$keyboard.removeData("keyboard"),h.$keyboard.remove(),h.$keyboard=[],h.isOpen=!1,h.isCurrent(!1)},h.destroy=function(e){var t,a=b.css,i=h.extensionNamespace.length,n=[a.input,a.locked,a.placeholder,a.noKeyboard,a.alwaysOpen,p.css.input,a.isCurrent].join(" ");for(clearTimeout(h.timer),clearTimeout(h.timer2),clearTimeout(h.timer3),h.$keyboard.length&&h.removeKeyboard(),h.removeBindings(h.namespace),h.removeBindings(h.namespace+"callbacks"),t=0;t<i;t++)h.removeBindings(h.extensionNamespace[t]);h.el.active=!1,h.$el.removeClass(n).removeAttr("aria-haspopup").removeAttr("role").removeData("keyboard"),h=null,"function"==typeof e&&e()},h.init()};return b.keyCodes={backSpace:8,tab:9,enter:13,capsLock:20,escape:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,A:65,Z:90,V:86,C:67,X:88,a:97,z:122},b.css={idSuffix:"_keyboard",initialFocus:"keyboard-init-focus",input:"ui-keyboard-input",inputClone:"ui-keyboard-preview-clone",wrapper:"ui-keyboard-preview-wrapper",preview:"ui-keyboard-preview",keyboard:"ui-keyboard",keySet:"ui-keyboard-keyset",keyButton:"ui-keyboard-button",keyWide:"ui-keyboard-widekey",keyPrefix:"ui-keyboard-",keyText:"ui-keyboard-text",keyHasActive:"ui-keyboard-hasactivestate",keyAction:"ui-keyboard-actionkey",keySpacer:"ui-keyboard-spacer",keyToggle:"ui-keyboard-toggle",keyDisabled:"ui-keyboard-disabled",divWrapperCE:"ui-keyboard-div-wrapper",locked:"ui-keyboard-lockedinput",alwaysOpen:"ui-keyboard-always-open",noKeyboard:"ui-keyboard-nokeyboard",placeholder:"ui-keyboard-placeholder",hasFocus:"ui-keyboard-has-focus",isCurrent:"ui-keyboard-input-current",inputValid:"ui-keyboard-valid-input",inputInvalid:"ui-keyboard-invalid-input",inputAutoAccepted:"ui-keyboard-autoaccepted",endRow:"ui-keyboard-button-endrow"},b.events={kbChange:"keyboardChange",kbBeforeClose:"beforeClose",kbBeforeVisible:"beforeVisible",kbVisible:"visible",kbInit:"initialized",kbInactive:"inactive",kbHidden:"hidden",kbRepeater:"repeater",kbKeysetChange:"keysetChange",inputAccepted:"accepted",inputCanceled:"canceled",inputChange:"change",inputRestricted:"restricted"},b.keyaction={accept:function(e){return e.close(!0),!1},alt:function(e){e.altActive=!e.altActive,e.showSet()},bksp:function(e){e.isContentEditable?(e.execCommand("delete"),e.saveCaret()):e.insertText("\b")},cancel:function(e){return e.close(),!1},clear:function(e){e.$preview[e.isContentEditable?"text":"val"](""),e.$decBtn.length&&e.checkDecimal()},combo:function(e){var t=e.options,a=!t.useCombos,i=e.$keyboard.find("."+b.css.keyPrefix+"combo");return t.useCombos=a,i.toggleClass(t.css.buttonActive,a).attr("title",i.attr("data-title")+" ("+t.display[a?"active":"disabled"]+")"),a&&e.checkCombos(),!1},dec:function(e){e.insertText(e.decimal?".":",")},del:function(e){e.isContentEditable?e.execCommand("forwardDelete"):e.insertText("{d}")},default:function(e){e.shiftActive=e.altActive=e.metaActive=!1,e.showSet()},enter:function(e,t,a){var i=e.options;return a.shiftKey?i.enterNavigation?e.switchInput(!a[i.enterMod],!0):e.close(!0):!i.enterNavigation||e.isTextArea&&!a[i.enterMod]?(e.isTextArea&&y(a.target).closest("button").length&&e.insertText((b.msie?" ":"")+"\n"),void(e.isContentEditable&&!i.enterNavigation&&(e.execCommand("insertHTML",'<div><br class="'+b.css.divWrapperCE+'"></div>'),setTimeout(function(){b.keyaction.right(e),e.saveCaret()},0)))):e.switchInput(!a[i.enterMod],!!i.autoAccept&&"true")},lock:function(e){e.last.keyset[0]=e.shiftActive=e.capsLock=!e.capsLock,e.showSet()},left:function(e){var t=b.caret(e.$preview);0<=t.start-1&&(e.last.start=e.last.end=t.start-1,b.caret(e.$preview,e.last),e.setScroll())},meta:function(e,t){var a=y(t);e.metaActive=!a.hasClass(e.options.css.buttonActive),e.showSet(a.attr("data-name"))},next:function(e){return e.switchInput(!0,e.options.autoAccept),!1},normal:function(e){e.shiftActive=e.altActive=e.metaActive=!1,e.showSet()},prev:function(e){return e.switchInput(!1,e.options.autoAccept),!1},right:function(e){var t=b.caret(e.$preview),a=e.isContentEditable?b.getEditableLength(e.el):e.getValue().length;t.end+1<=a&&(e.last.start=e.last.end=t.end+1,b.caret(e.$preview,e.last),e.setScroll())},shift:function(e){e.last.keyset[0]=e.shiftActive=!e.shiftActive,e.showSet()},sign:function(e){if(/^[+-]?\d*\.?\d*$/.test(e.getValue())){var t,a=b.caret(e.$preview),i=e.getValue(),n=e.isContentEditable?b.getEditableLength(e.el):i.length;e.setValue(-1*i),t=n-i.length,e.last.start=a.start+t,e.last.end=a.end+t,b.caret(e.$preview,e.last),e.setScroll()}},space:function(e){e.insertText(" ")},tab:function(e){var t=e.options;if(!e.isTextArea){if(t.tabNavigation)return e.switchInput(!e.shiftActive,!0);if(e.isInput)return!1}e.insertText("\t")},toggle:function(e){e.enabled=!e.enabled,e.toggle()},NBSP:" ",ZWSP:"​",ZWNJ:"‌",ZWJ:"‍",LRM:"‎",RLM:"‏"},b.builtLayouts={},b.layouts={alpha:{normal:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} a b c d e f g h i j [ ] \\","k l m n o p q r s ; ' {enter}","{shift} t u v w x y z , . / {shift}","{accept} {space} {cancel}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} A B C D E F G H I J { } |",'K L M N O P Q R S : " {enter}',"{shift} T U V W X Y Z < > ? {shift}","{accept} {space} {cancel}"]},qwerty:{normal:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w e r t y u i o p [ ] \\","a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}","{accept} {space} {cancel}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'A S D F G H J K L : " {enter}',"{shift} Z X C V B N M < > ? {shift}","{accept} {space} {cancel}"]},international:{normal:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w e r t y u i o p [ ] \\","a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}","{accept} {alt} {space} {alt} {cancel}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'A S D F G H J K L : " {enter}',"{shift} Z X C V B N M < > ? {shift}","{accept} {alt} {space} {alt} {cancel}"],alt:["~ ¡ ² ³ ¤ € ¼ ½ ¾ ‘ ’ ¥ × {bksp}","{tab} ä å é ® þ ü ú í ó ö « » ¬","á ß ð f g h j k ø ¶ ´ {enter}","{shift} æ x © v b ñ µ ç > ¿ {shift}","{accept} {alt} {space} {alt} {cancel}"],"alt-shift":["~ ¹ ² ³ £ € ¼ ½ ¾ ‘ ’ ¥ ÷ {bksp}","{tab} Ä Å É ® Þ Ü Ú Í Ó Ö « » ¦","Ä § Ð F G H J K Ø ° ¨ {enter}","{shift} Æ X ¢ V B Ñ µ Ç . ¿ {shift}","{accept} {alt} {space} {alt} {cancel}"]},colemak:{normal:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w f p g j l u y ; [ ] \\","{bksp} a r s t d h n e i o ' {enter}","{shift} z x c v b k m , . / {shift}","{accept} {space} {cancel}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W F P G J L U Y : { } |",'{bksp} A R S T D H N E I O " {enter}',"{shift} Z X C V B K M < > ? {shift}","{accept} {space} {cancel}"]},dvorak:{normal:["` 1 2 3 4 5 6 7 8 9 0 [ ] {bksp}","{tab} ' , . p y f g c r l / = \\","a o e u i d h t n s - {enter}","{shift} ; q j k x b m w v z {shift}","{accept} {space} {cancel}"],shift:["~ ! @ # $ % ^ & * ( ) { } {bksp}",'{tab} " < > P Y F G C R L ? + |',"A O E U I D H T N S _ {enter}","{shift} : Q J K X B M W V Z {shift}","{accept} {space} {cancel}"]},num:{normal:["= ( ) {b}","{clear} / * -","7 8 9 +","4 5 6 {sign}","1 2 3 %","0 {dec} {a} {c}"]}},b.language={en:{display:{a:"✔:Accept (Shift+Enter)",accept:"Accept:Accept (Shift+Enter)",alt:"Alt:⌥ AltGr",b:"⌫:Backspace",bksp:"Bksp:Backspace",c:"✖:Cancel (Esc)",cancel:"Cancel:Cancel (Esc)",clear:"C:Clear",combo:"ö:Toggle Combo Keys",dec:".:Decimal",e:"⏎:Enter",empty:" ",enter:"Enter:Enter ⏎",left:"←",lock:"Lock:⇪ Caps Lock",next:"Next ⇨",prev:"⇦ Prev",right:"→",s:"⇧:Shift",shift:"Shift:Shift",sign:"±:Change Sign",space:" :Space",t:"⇥:Tab",tab:"⇥ Tab:Tab",toggle:" ",valid:"valid",invalid:"invalid",active:"active",disabled:"disabled"},wheelMessage:"Use mousewheel to see other keys",comboRegex:/([`\'~\^\"ao])([a-z])/gim,combos:{"`":{a:"à",A:"À",e:"è",E:"È",i:"ì",I:"Ì",o:"ò",O:"Ò",u:"ù",U:"Ù",y:"ỳ",Y:"Ỳ"},"'":{a:"á",A:"Á",e:"é",E:"É",i:"í",I:"Í",o:"ó",O:"Ó",u:"ú",U:"Ú",y:"ý",Y:"Ý"},'"':{a:"ä",A:"Ä",e:"ë",E:"Ë",i:"ï",I:"Ï",o:"ö",O:"Ö",u:"ü",U:"Ü",y:"ÿ",Y:"Ÿ"},"^":{a:"â",A:"Â",e:"ê",E:"Ê",i:"î",I:"Î",o:"ô",O:"Ô",u:"û",U:"Û",y:"ŷ",Y:"Ŷ"},"~":{a:"ã",A:"Ã",e:"ẽ",E:"Ẽ",i:"ĩ",I:"Ĩ",o:"õ",O:"Õ",u:"ũ",U:"Ũ",y:"ỹ",Y:"Ỹ",n:"ñ",N:"Ñ"}}}},b.defaultOptions={language:null,rtl:!1,layout:"qwerty",customLayout:null,position:{of:null,my:"center top",at:"center top",at2:"center bottom"},reposition:!0,usePreview:!0,alwaysOpen:!1,initialFocus:!0,noFocus:!1,stayOpen:!1,userClosed:!1,ignoreEsc:!1,closeByClickEvent:!1,css:{input:"ui-widget-content ui-corner-all",container:"ui-widget-content ui-widget ui-corner-all ui-helper-clearfix",popup:"",buttonDefault:"ui-state-default ui-corner-all",buttonHover:"ui-state-hover",buttonAction:"ui-state-active",buttonActive:"ui-state-active",buttonDisabled:"ui-state-disabled",buttonEmpty:"ui-keyboard-empty"},autoAccept:!1,autoAcceptOnEsc:!1,lockInput:!1,restrictInput:!1,restrictInclude:"",acceptValid:!1,autoAcceptOnValid:!1,checkValidOnInit:!0,cancelClose:!0,tabNavigation:!1,enterNavigation:!1,enterMod:"altKey",stopAtEnd:!0,appendLocally:!1,appendTo:"body",wrapBRs:!0,stickyShift:!0,preventPaste:!1,caretToEnd:!1,scrollAdjustment:10,maxLength:!1,maxInsert:!0,repeatDelay:500,repeatRate:20,resetDefault:!0,openOn:"focus",activeOnReadonly:!1,keyBinding:"mousedown touchstart",useWheel:!0,useCombos:!0,validate:function(){return!0}},b.comboRegex=/([`\'~\^\"ao])([a-z])/gim,b.currentKeyboard="",y('\x3c!--[if lte IE 8]><script>jQuery("body").addClass("oldie");<\/script><![endif]--\x3e\x3c!--[if IE]><script>jQuery("body").addClass("ie");<\/script><![endif]--\x3e').appendTo("body").remove(),b.msie=y("body").hasClass("oldie"),b.allie=y("body").hasClass("ie"),b.watermark=void 0!==document.createElement("input").placeholder,b.checkCaretSupport=function(){if("boolean"!=typeof b.checkCaret){var e=y('<div style="height:0px;width:0px;overflow:hidden;position:fixed;top:0;left:-100px;"><input type="text" value="testing"/></div>').prependTo("body");b.caret(e.find("input"),3,3),b.checkCaret=3!==b.caret(e.find("input").hide().show()).start,e.remove()}return b.checkCaret},b.caret=function(e,t,a){if(!e||!e.length||e.is(":hidden")||"hidden"===e.css("visibility"))return{};var i,n,s,o,r=e.data("keyboard"),l=r&&r.options.noFocus,c=/(textarea|input)/i.test(e[0].nodeName);return l||e.focus(),void 0!==t?("object"==typeof t&&"start"in t&&"end"in t?(i=t.start,n=t.end):void 0===a&&(a=t),"number"==typeof t&&"number"==typeof a?(i=t,n=a):"start"===t?i=n=0:"string"==typeof t&&(i=n="end"),c?e.caret(i,n,l):b.setEditableCaret(e,i,n)):(o=c?e.caret():b.getEditableCaret(e[0]),i=o.start,n=o.end,s=c&&e[0].value||e.text()||"",{start:i,end:n,text:s.substring(i,n),replaceStr:function(e){return s.substring(0,i)+e+s.substring(n,s.length)}})},b.isTextNode=function(e){return e&&3===e.nodeType},b.isBlock=function(e,t){var a=e.ownerDocument.defaultView;return t&&1===t.nodeType&&t!==e&&"block"===a.getComputedStyle(t).display?1:0},b.wrapBRs=function(i){var e=y(i).find("br:not(."+b.css.divWrapperCE+")");e.length&&y.each(e,function(e,t){var a=t.parentNode.childNodes.length;(1!==a||1===a&&!b.isBlock(i,t.parentNode))&&y(t).addClass(b.css.divWrapperCE).wrap("<div>")})},b.getEditableCaret=function(l){if(!(l=y(l)[0]).isContentEditable)return{};var e,t,c=(y(l).data("keyboard")||{}).options,a=l.ownerDocument.getSelection().getRangeAt(0),i=s(a.startContainer,a.startOffset),n=i.position;function s(e,t){var a,i="",n=!1,s=0,o=y.makeArray(l.childNodes);function r(e){e&&(s+=e,i+=c&&c.replaceCR||"\n")}for(;!n&&o.length;){if((a=o.shift())===e&&(n=!0),r(b.isBlock(l,a.previousSibling)),b.isTextNode(a)){if(s+=n?t:a.length,i+=a.textContent,n)return{position:s,text:i}}else!n&&a.childNodes&&(o=y.makeArray(a.childNodes).concat(o));r(b.isTextNode(a.previousSibling)&&b.isBlock(l,a))}return{position:s,text:i}}return!1!==c.wrapBRs&&b.wrapBRs(l),t=a.endContainer===a.startContainer&&a.endOffset===a.startOffset?(e=n,""):(e=(i=s(a.endContainer,a.endOffset)).position,i.text.substring(n,e)),{start:n,end:e,text:t}},b.getEditableLength=function(e){var t=b.setEditableCaret(e,"getMax");return"number"==typeof t?t:null},b.setEditableCaret=function(u,e,t){if(!(u=y(u)[0]).isContentEditable)return{};var a=u.ownerDocument,i=a.createRange(),n=a.getSelection(),p=(y(u).data("keyboard")||{}).options,s=e,o=t,r="",l=c("getMax"===e?"end":e);function c(a){"end"===a?a=u.innerHTML.length:a<0&&(a=0);var e,t,i="",n=!1,s=0,o=0,r=0,l=y.makeArray(u.childNodes);function c(e){return i+=e?p&&p.replaceCR||"\n":"",0<e}function d(e){var t=s+e;return o=r,r+=e,0<=a-t?a-(s=t)<=0:a-t<=0}for(;!n&&l.length;)if(e=l.shift(),c(t=b.isBlock(u,e.previousSibling))&&d(t)&&(n=!0),c(t=b.isTextNode(e.previousSibling)&&b.isBlock(u,e))&&d(t)&&(n=!0),b.isTextNode(e)){if(i+=e.textContent,d(e.length))return{node:e,offset:t=a-s==0&&1<=s-o?e.length:a-s,position:a,text:i}}else!n&&e.childNodes&&(l=y.makeArray(e.childNodes).concat(l));return l.length?{node:e,offset:a-s,position:a,text:i}:{node:e,offset:e&&e.length||0,position:r,text:i}}if(l.node){if(s=l.position,"getMax"===e)return s;i.setStart(l.node,l.offset),void 0!==t&&t!==e&&(l=c(t)),l.node&&(o=l.position,i.setEnd(l.node,l.offset),r=s===o?"":l.text.substring(s,o)),n.removeAllRanges(),n.addRange(i)}return{start:s,end:o,text:r}},b.replaceContent=function(e,t){e=y(e)[0];for(var a,i,n,s=typeof t,o=b.getEditableCaret(e).start,r=0,l=[e];a=l.pop();)if(b.isTextNode(a))"function"===s?r<=o&&o<=r+a.length&&(a.textContent=t(a.textContent)):"string"===s&&(n=t.substring(r,r+a.length))!==a.textContent&&(a.textContent=n),r+=a.length;else if(a&&a.childNodes)for(i=a.childNodes.length;i--;)l.push(a.childNodes[i]);i=b.getEditableCaret(e),b.setEditableCaret(e,i.start,i.start)},y.fn.keyboard=function(e){return this.each(function(){y(this).data("keyboard")||new y.keyboard(this,e)})},y.fn.getkeyboard=function(){return this.data("keyboard")},y.fn.caret=function(t,a,e){if(void 0===this[0]||this.is(":hidden")||"hidden"===this.css("visibility")||!/(INPUT|TEXTAREA)/i.test(this[0].nodeName))return this;var i,n,s,o,r,l=this,c=l[0],d=c.ownerDocument.selection,u=c.scrollTop,p=!1,h=!0;try{p="selectionStart"in c}catch(e){h=!1}return h&&void 0!==t?(/(email|number)/i.test(c.type)||(p?(c.selectionStart=t,c.selectionEnd=a):((i=c.createTextRange()).collapse(!0),i.moveStart("character",t),i.moveEnd("character",a-t),i.select())),e||!l.is(":visible")&&"hidden"===l.css("visibility")||c.focus(),c.scrollTop=u,this):(/(email|number)/i.test(c.type)?t=a=l.val().length:p?(t=c.selectionStart,a=c.selectionEnd):d?a="TEXTAREA"===c.nodeName.toUpperCase()?(r=l.val(),(s=(n=d.createRange()).duplicate()).moveToElementText(c),s.setEndPoint("EndToEnd",n),(t=s.text.replace(/\r/g,"\n").length)+n.text.replace(/\r/g,"\n").length):(r=l.val().replace(/\r/g,"\n"),(n=d.createRange().duplicate()).moveEnd("character",r.length),t=""===n.text?r.length:r.lastIndexOf(n.text),(n=d.createRange().duplicate()).moveStart("character",-r.length),n.text.length):t=a=(c.value||"").length,o=c.value||"",{start:t,end:a,text:o.substring(t,a),replace:function(e){return o.substring(0,t)+e+o.substring(a,o.length)}})},b});
/*! jQuery UI Virtual Keyboard v1.29.0 */
!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(y){"use strict";var b=y.keyboard=function(c,o){var p,h=this;h.version="1.29.0",h.$el=y(c),h.el=c,h.$el.data("keyboard",h),h.init=function(){h.initialized=!1;var e,t,a,i=b.css,n=b.events;h.settings=o||{},o&&o.position&&(t=y.extend({},o.position),o.position=null),h.options=p=y.extend(!0,{},b.defaultOptions,o),t&&(p.position=t,o.position=t),h.el.active=!0,h.namespace=".keyboard"+Math.random().toString(16).slice(2),h.extensionNamespace=[],h.shiftActive=h.altActive=h.metaActive=h.sets=h.capsLock=!1,h.rows=["","-shift","-alt","-alt-shift"],h.inPlaceholder=h.$el.attr("placeholder")||"",h.watermark=b.watermark&&""!==h.inPlaceholder,h.repeatTime=1e3/(p.repeatRate||20),p.preventDoubleEventTime=p.preventDoubleEventTime||100,h.isOpen=!1,h.wheel="function"==typeof y.fn.mousewheel,h.escapeRegex=/[-\/\\^$*+?.()|[\]{}]/g,h.isTextArea="textarea"===h.el.nodeName.toLowerCase(),h.isInput="input"===h.el.nodeName.toLowerCase(),h.isContentEditable=!h.isTextArea&&!h.isInput&&h.el.isContentEditable,e=b.keyCodes,h.alwaysAllowed=[e.capsLock,e.pageUp,e.pageDown,e.end,e.home,e.left,e.up,e.right,e.down,e.insert,e.delete],h.$keyboard=[],h.enabled=!0,h.checkCaret=p.lockInput||b.checkCaretSupport(),h.isContentEditable&&(p.usePreview=!1),h.last={start:0,end:0,key:"",val:"",preVal:"",layout:"",virtual:!0,keyset:[!1,!1,!1],wheel_$Keys:[],wheelIndex:0,wheelLayers:[]},h.temp=["",0,0],y.each([n.kbInit,n.kbBeforeVisible,n.kbVisible,n.kbHidden,n.inputCanceled,n.inputAccepted,n.kbBeforeClose,n.inputRestricted],function(e,t){"function"==typeof p[t]&&h.$el.bind(t+h.namespace+"callbacks",p[t])}),p.alwaysOpen&&(p.stayOpen=!0),a=y(document),h.el.ownerDocument!==document&&(a=a.add(h.el.ownerDocument));var s="keyup checkkeyboard mousedown touchstart ";p.closeByClickEvent&&(s+="click "),a.bind(s.split(" ").join(h.namespace+" "),function(e){clearTimeout(h.timer3),h.timer3=setTimeout(function(){h.checkClose(e)},1)}),h.$el.addClass(i.input+" "+p.css.input).attr({"aria-haspopup":"true",role:"textbox"}),(p.lockInput||h.el.readOnly)&&(p.lockInput=!0,h.$el.addClass(i.locked).attr({readonly:"readonly"})),h.isUnavailable()&&h.$el.addClass(i.noKeyboard),p.openOn&&h.bindFocus(),h.watermark||""!==h.getValue(h.$el)||""===h.inPlaceholder||""===h.$el.attr("placeholder")||(h.$el.addClass(i.placeholder),h.setValue(h.inPlaceholder,h.$el)),h.$el.trigger(n.kbInit,[h,h.el]),p.alwaysOpen&&h.reveal(),h.initialized=!0},h.toggle=function(){if(h.hasKeyboard()){var e=h.$keyboard.find("."+b.css.keyToggle),t=!h.enabled;return h.preview.readonly=t||h.options.lockInput,h.$keyboard.toggleClass(b.css.keyDisabled,t).find("."+b.css.keyButton).not(e).attr("aria-disabled",t).each(function(){this.disabled=t}),e.toggleClass(b.css.keyDisabled,t),t&&h.typing_options&&(h.typing_options.text=""),h}},h.setCurrent=function(){var e=b.css,t=y("."+e.isCurrent),a=t.data("keyboard");y.isEmptyObject(a)||a.el===h.el||a.close(!!a.options.autoAccept&&"true"),t.removeClass(e.isCurrent),y("."+e.hasFocus).removeClass(e.hasFocus),h.$el.addClass(e.isCurrent),h.$keyboard.addClass(e.hasFocus),h.isCurrent(!0),h.isOpen=!0},h.isUnavailable=function(){return h.$el.is(":disabled")||!h.options.activeOnReadonly&&h.$el.attr("readonly")&&!h.$el.hasClass(b.css.locked)},h.isCurrent=function(e){var t=b.currentKeyboard||!1;return e?t=b.currentKeyboard=h.el:!1===e&&t===h.el&&(t=b.currentKeyboard=""),t===h.el},h.hasKeyboard=function(){return h.$keyboard&&0<h.$keyboard.length},h.isVisible=function(){return!!h.hasKeyboard()&&h.$keyboard.is(":visible")},h.setFocus=function(){var e=h.$preview||h.$el;p.noFocus||e.focus(),h.isContentEditable?b.setEditableCaret(e,h.last.start,h.last.end):b.caret(e,h.last)},h.focusOn=function(){!h&&h.el.active||(h.isVisible()?h.setCurrent():(clearTimeout(h.timer),h.reveal()))},h.redraw=function(e){return e&&(h.options.layout=e),h.$keyboard.length&&(h.last.preVal=""+h.last.val,h.saveLastChange(),h.setValue(h.last.val,h.$el),h.removeKeyboard(),h.shiftActive=h.altActive=h.metaActive=!1),h.isOpen=p.alwaysOpen,h.reveal(!0),h},h.reveal=function(e){var t,a=h.isOpen,i=b.css;if(h.opening=!a,y("."+i.keyboard).not("."+i.alwaysOpen).each(function(){var e=y(this).data("keyboard");y.isEmptyObject(e)||e.close(!!e.options.autoAccept&&"true")}),!h.isUnavailable())return h.$el.removeClass(i.noKeyboard),p.openOn&&h.$el.unbind(y.trim((p.openOn+" ").split(/\s+/).join(h.namespace+" "))),h.$keyboard&&(!h.$keyboard||h.$keyboard.length&&!y.contains(h.el.ownerDocument.body,h.$keyboard[0]))||h.startup(),h.watermark||h.getValue()!==h.inPlaceholder||(h.$el.removeClass(i.placeholder),h.setValue("",h.$el)),h.originalContent=h.isContentEditable?h.$el.html():h.getValue(h.$el),h.el===h.preview||h.isContentEditable||h.setValue(h.originalContent),p.acceptValid&&p.checkValidOnInit&&h.checkValid(),p.resetDefault&&(h.shiftActive=h.altActive=h.metaActive=!1),h.showSet(),h.isVisible()||h.$el.trigger(b.events.kbBeforeVisible,[h,h.el]),(h.initialized||p.initialFocus||!p.initialFocus&&h.$el.hasClass(b.css.initialFocus))&&h.setCurrent(),h.toggle(),h.$keyboard.show(),p.usePreview&&b.msie&&(void 0===h.width&&(h.$preview.hide(),h.width=Math.ceil(h.$keyboard.width()),h.$preview.show()),h.$preview.width(h.width)),h.reposition(),h.checkDecimal(),h.lineHeight=parseInt(h.$preview.css("lineHeight"),10)||parseInt(h.$preview.css("font-size"),10)+4,p.caretToEnd&&(t=h.isContentEditable?b.getEditableLength(h.el):h.originalContent.length,h.saveCaret(t,t)),b.allie&&(0===h.last.end&&0<h.last.start&&(h.last.end=h.last.start),h.last.start<0&&(h.last.start=h.last.end=h.originalContent.length)),a||e?(b.caret(h.$preview,h.last),h.opening=!1):h.timer2=setTimeout(function(){var e;h.opening=!1,/(number|email)/i.test(h.el.type)||p.caretToEnd||h.saveCaret(e,e,h.$el),(p.initialFocus||h.$el.hasClass(b.css.initialFocus))&&b.caret(h.$preview,h.last),h.last.eventTime=(new Date).getTime(),h.$el.trigger(b.events.kbVisible,[h,h.el]),h.timer=setTimeout(function(){h&&h.saveCaret()},200)},10),h},h.updateLanguage=function(){var e=b.layouts,t=p.language||e[p.layout]&&e[p.layout].lang&&e[p.layout].lang||[p.language||"en"],a=b.language;t="[object Array]"===Object.prototype.toString.call(t)?t[0]:t,t=(h.language=t).split("-")[0],p.display=y.extend(!0,{},a.en.display,a[t]&&a[t].display||{},h.settings.display),p.combos=y.extend(!0,{},a.en.combos,a[t]&&a[t].combos||{},h.settings.combos),p.wheelMessage=a[t]&&a[t].wheelMessage||a.en.wheelMessage,p.rtl=e[p.layout]&&e[p.layout].rtl||a[t]&&a[t].rtl||!1,a[t]&&a[t].comboRegex&&(h.regex=a[t].comboRegex),h.decimal=/^\./.test(p.display.dec),h.$el.toggleClass("rtl",p.rtl).css("direction",p.rtl?"rtl":"")},h.startup=function(){var e=b.css;(p.alwaysOpen||p.userClosed)&&h.$preview||h.makePreview(),h.hasKeyboard()||("custom"===p.layout&&(p.layoutHash="custom"+h.customHash()),h.layout="custom"===p.layout?p.layoutHash:p.layout,h.last.layout=h.layout,h.updateLanguage(),void 0===b.builtLayouts[h.layout]&&("function"==typeof p.create?h.$keyboard=p.create(h):h.$keyboard.length||h.buildKeyboard(h.layout,!0)),h.$keyboard=b.builtLayouts[h.layout].$keyboard.clone(),h.$keyboard.data("keyboard",h),""!==(h.el.id||"")&&h.$keyboard.attr("id",h.el.id+b.css.idSuffix),h.makePreview()),h.$keyboard.attr("data-"+e.keyboard+"-layout",p.layout).attr("data-"+e.keyboard+"-language",h.language),h.$decBtn=h.$keyboard.find("."+e.keyPrefix+"dec"),(p.enterNavigation||h.isTextArea)&&h.alwaysAllowed.push(b.keyCodes.enter),h.bindKeyboard(),h.$keyboard.appendTo(p.appendLocally?h.$el.parent():p.appendTo||"body"),h.bindKeys(),p.reposition&&y.ui&&y.ui.position&&"body"===p.appendTo&&y(window).bind("resize"+h.namespace,function(){h.reposition()})},h.reposition=function(){return h.position=!y.isEmptyObject(p.position)&&p.position,y.ui&&y.ui.position&&h.position&&(h.position.of=h.position.of||h.$el.data("keyboardPosition")||h.$el,h.position.collision=h.position.collision||"flipfit flipfit",h.position.at=p.usePreview?p.position.at:p.position.at2,h.isVisible()&&h.$keyboard.position(h.position)),h},h.makePreview=function(){if(p.usePreview){var e,t,a,i,n=b.css;for(h.$preview=h.$el.clone(!1).data("keyboard",h).removeClass(n.placeholder+" "+n.input).addClass(n.preview+" "+p.css.input).attr("tabindex","-1").show(),h.preview=h.$preview[0],"number"===h.preview.type&&(h.preview.type="text"),i=/^(data-|id|aria-haspopup)/i,e=(t=h.$preview.get(0).attributes).length-1;0<=e;e--)a=t[e]&&t[e].name,i.test(a)&&h.preview.removeAttribute(a);y("<div />").addClass(n.wrapper).append(h.$preview).prependTo(h.$keyboard)}else h.$preview=h.$el,h.preview=h.el},h.caret=function(e,t){var a=b.caret(h.$preview,e,t);return a instanceof y?(h.saveCaret(a.start,a.end),h):a},h.saveCaret=function(e,t,a){var i;h.isCurrent()&&(i=void 0===e?b.caret(a||h.$preview):b.caret(a||h.$preview,e,t),h.last.start=void 0===e?i.start:e,h.last.end=void 0===t?i.end:t)},h.saveLastChange=function(e){h.last.val=e||h.getValue(h.$preview||h.$el),h.isContentEditable&&(h.last.elms=h.el.cloneNode(!0))},h.setScroll=function(){if(!h.isContentEditable&&h.last.virtual){var e,t,a,i,n=h.last.val.substring(0,Math.max(h.last.start,h.last.end));h.$previewCopy||(h.$previewCopy=h.$preview.clone().removeAttr("id").css({position:"absolute",left:0,zIndex:-10,visibility:"hidden"}).addClass(b.css.inputClone),h.$previewCopy[0].disabled=!0,h.isTextArea||h.$previewCopy.css({"white-space":"pre",width:0}),p.usePreview?h.$preview.after(h.$previewCopy):h.$keyboard.prepend(h.$previewCopy)),h.isTextArea?(h.$previewCopy.height(h.lineHeight).val(n),h.preview.scrollTop=h.lineHeight*(Math.floor(h.$previewCopy[0].scrollHeight/h.lineHeight)-1)):(h.$previewCopy.val(n.replace(/\s/g," ")),a=/c/i.test(p.scrollAdjustment)?h.preview.clientWidth/2:p.scrollAdjustment,e=h.$previewCopy[0].scrollWidth-1,void 0===h.last.scrollWidth&&(h.last.scrollWidth=e,h.last.direction=!0),i=h.last.scrollWidth===e?h.last.direction:h.last.scrollWidth<e,t=h.preview.clientWidth-a,i?h.preview.scrollLeft=e<t?0:e-t:e>=h.preview.scrollWidth-t?h.preview.scrollLeft=h.preview.scrollWidth-a:h.preview.scrollLeft=0<e-a?e-a:0,h.last.scrollWidth=e,h.last.direction=i)}},h.bindFocus=function(){p.openOn&&h&&h.el.active&&(h.$el.bind(p.openOn+h.namespace,function(){h.focusOn()}),y(":focus")[0]===h.el&&h.$el.blur())},h.bindKeyboard=function(){var s,o=b.keyCodes,r=b.builtLayouts[h.layout],e=h.namespace+"keybindings";h.$preview.unbind(h.namespace).bind("click"+e+" touchstart"+e,function(){p.alwaysOpen&&!h.isCurrent()&&h.reveal(),h.timer2=setTimeout(function(){h&&h.saveCaret()},150)}).bind("keypress"+e,function(e){if(p.lockInput)return!1;if(h.isCurrent()){var t=e.charCode||e.which,a=t>=o.A&&t<=o.Z,i=t>=o.a&&t<=o.z,n=h.last.key=String.fromCharCode(t);if(!(t<o.space)){if(h.last.virtual=!1,h.last.event=e,h.last.$key=[],h.checkCaret&&h.saveCaret(),t!==o.capsLock&&(a||i)&&(h.capsLock=a&&!e.shiftKey||i&&e.shiftKey,h.capsLock&&!h.shiftActive&&(h.shiftActive=!0,h.showSet())),p.restrictInput){if((e.which===o.backSpace||0===e.which)&&y.inArray(e.keyCode,h.alwaysAllowed))return;-1===y.inArray(n,r.acceptedKeys)&&(e.preventDefault(),(s=y.extend({},e)).type=b.events.inputRestricted,h.$el.trigger(s,[h,h.el]))}else if((e.ctrlKey||e.metaKey)&&(e.which===o.A||e.which===o.C||e.which===o.V||e.which>=o.X&&e.which<=o.Z))return;r.hasMappedKeys&&r.mappedKeys.hasOwnProperty(n)&&(h.last.key=r.mappedKeys[n],h.insertText(h.last.key),e.preventDefault()),"function"==typeof p.beforeInsert&&(h.insertText(h.last.key),e.preventDefault()),h.checkMaxLength()}}}).bind("keyup"+e,function(e){if(h.isCurrent()){switch(h.last.virtual=!1,e.which){case o.tab:if(h.tab&&!p.lockInput){h.shiftActive=e.shiftKey;var t=b.keyaction.tab(h);if(h.tab=!1,!t)return!1}else e.preventDefault();break;case o.escape:return p.ignoreEsc||h.close(!(!p.autoAccept||!p.autoAcceptOnEsc)&&"true"),!1}clearTimeout(h.throttled),h.throttled=setTimeout(function(){h&&h.isVisible()&&h.checkCombos()},100),h.checkMaxLength(),h.last.preVal=""+h.last.val,h.saveLastChange();var a=y.Event(b.events.kbChange);if(a.action=h.last.key,h.$el.trigger(a,[h,h.el]),"function"==typeof p.change)return a.type=b.events.inputChange,p.change(a,h,h.el),!1;p.acceptValid&&p.autoAcceptOnValid&&"function"==typeof p.validate&&p.validate(h,h.getValue(h.$preview))&&(h.$preview.blur(),h.accept())}}).bind("keydown"+e,function(e){if(h.last.keyPress=e.which,p.alwaysOpen&&!h.isCurrent()&&h.reveal(),e.which===o.tab)return!(h.tab=!0);if(p.lockInput||e.timeStamp===h.last.timeStamp)return!p.lockInput;switch(h.last.timeStamp=e.timeStamp,h.last.virtual=!1,e.which){case o.backSpace:b.keyaction.bksp(h,null,e),e.preventDefault();break;case o.enter:b.keyaction.enter(h,null,e);break;case o.capsLock:h.shiftActive=h.capsLock=!h.capsLock,h.showSet();break;case o.V:if(e.ctrlKey||e.metaKey){if(p.preventPaste)return void e.preventDefault();h.checkCombos()}}}).bind("mouseup touchend ".split(" ").join(e+" "),function(){h.last.virtual=!0,h.saveCaret()}),h.$keyboard.bind("mousedown click touchstart ".split(" ").join(h.namespace+" "),function(e){e.stopPropagation(),h.isCurrent()||(h.reveal(),y(h.el.ownerDocument).trigger("checkkeyboard"+h.namespace)),h.setFocus()}),p.preventPaste&&(h.$preview.bind("contextmenu"+h.namespace,function(e){e.preventDefault()}),h.$el.bind("contextmenu"+h.namespace,function(e){e.preventDefault()}))},h.bindButton=function(e,t){var a="."+b.css.keyButton,i=function(e){e.stopPropagation(),e.$target=y(this).closest("."+b.css.keyboard+", ."+b.css.input),t.call(this,e)};return y.fn.on?h.$keyboard.on(e,a,i):y.fn.delegate&&h.$keyboard.delegate(a,e,i),h},h.unbindButton=function(e){return y.fn.off?h.$keyboard.off(e):y.fn.undelegate&&h.$keyboard.undelegate("."+b.css.keyButton,e),h},h.bindKeys=function(){var s=b.css;h.unbindButton(h.namespace+" "+h.namespace+"kb").bindButton("mouseenter mouseleave touchstart ".split(" ").join(h.namespace+" "),function(e){if(!p.alwaysOpen&&!p.userClosed||"mouseleave"===e.type||h.isCurrent()||(h.reveal(),h.setFocus()),h.isCurrent()&&!this.disabled){var t,a,i=h.last,n=y(this),s=e.type;p.useWheel&&h.wheel&&(t=h.getLayers(n),a=(t.length?t.map(function(){return y(this).attr("data-value")||""}).get():"")||[n.text()],i.wheel_$Keys=t,i.wheelLayers=a,i.wheelIndex=y.inArray(n.attr("data-value"),a)),"mouseenter"!==s&&"touchstart"!==s||"password"===h.el.type||n.hasClass(p.css.buttonDisabled)||(n.addClass(p.css.buttonHover),p.useWheel&&h.wheel&&n.attr("title",function(e,t){return h.wheel&&""===t&&h.sets&&1<a.length&&"touchstart"!==s?p.wheelMessage:t})),"mouseleave"===s&&(n.removeClass("password"===h.el.type?"":p.css.buttonHover),p.useWheel&&h.wheel&&(i.wheelIndex=0,i.wheelLayers=[],i.wheel_$Keys=[],n.attr("title",function(e,t){return t===p.wheelMessage?"":t}).html(n.attr("data-html"))))}}).bindButton(p.keyBinding.split(" ").join(h.namespace+" ")+h.namespace+" "+b.events.kbRepeater,function(e){if(e.preventDefault(),!h.$keyboard.is(":visible")||this.disabled)return!1;var t,a=h.last,i=y(this),n=(new Date).getTime();if(p.useWheel&&h.wheel&&(i=a.wheel_$Keys.length&&-1<a.wheelIndex?a.wheel_$Keys.eq(a.wheelIndex):i),t=i.attr("data-action"),!(n-(a.eventTime||0)<p.preventDoubleEventTime)){if(a.eventTime=n,a.event=e,a.virtual=!0,a.$key=i,a.key=i.attr("data-value"),a.keyPress="",h.setFocus(),/^meta/.test(t)&&(t="meta"),t===a.key&&"string"==typeof b.keyaction[t])a.key=t=b.keyaction[t];else if(t in b.keyaction&&"function"==typeof b.keyaction[t]){if(!1===b.keyaction[t](h,this,e))return!1;t=null}return!!h.hasKeyboard()&&(null!=t&&(a.key=y(this).hasClass(s.keyAction)?t:a.key,h.insertText(a.key),h.capsLock||p.stickyShift||e.shiftKey||(h.shiftActive=!1,h.showSet(i.attr("data-name")))),b.caret(h.$preview,a),h.checkCombos(),(e=y.extend({},e,y.Event(b.events.kbChange))).target=h.el,e.action=a.key,h.$el.trigger(e,[h,h.el]),a.preVal=""+a.val,h.saveLastChange(),"function"==typeof p.change?(e.type=b.events.inputChange,p.change(e,h,h.el),!1):void 0)}}).bindButton("mouseup"+h.namespace+" "+"mouseleave touchend touchmove touchcancel ".split(" ").join(h.namespace+"kb "),function(e){h.last.virtual=!0;var t,a=y(this);if("touchmove"===e.type){if((t=a.offset()).right=t.left+a.outerWidth(),t.bottom=t.top+a.outerHeight(),e.originalEvent.touches[0].pageX>=t.left&&e.originalEvent.touches[0].pageX<t.right&&e.originalEvent.touches[0].pageY>=t.top&&e.originalEvent.touches[0].pageY<t.bottom)return!0}else/(mouseleave|touchend|touchcancel)/i.test(e.type)?a.removeClass(p.css.buttonHover):(!p.noFocus&&h.isCurrent()&&h.isVisible()&&h.$preview.focus(),h.checkCaret&&b.caret(h.$preview,h.last));return h.mouseRepeat=[!1,""],clearTimeout(h.repeater),p.acceptValid&&p.autoAcceptOnValid&&"function"==typeof p.validate&&p.validate(h,h.getValue())&&(h.$preview.blur(),h.accept()),!1}).bindButton("click"+h.namespace,function(){return!1}).bindButton("mousewheel"+h.namespace,h.throttleEvent(function(e,t){var a=y(this);if(a&&!a.hasClass(s.keyAction)&&h.last.wheel_$Keys[0]===this&&p.useWheel&&h.wheel){t=t||e.deltaY;var i,n=h.last.wheelLayers||[];return 1<n.length?((i=h.last.wheelIndex+(0<t?-1:1))>n.length-1&&(i=0),i<0&&(i=n.length-1)):i=0,h.last.wheelIndex=i,a.html(n[i]),!1}},30)).bindButton("mousedown touchstart ".split(" ").join(h.namespace+"kb "),function(){var e=y(this);if(e&&(!e.hasClass(s.keyAction)||e.is("."+s.keyPrefix+"tab bksp space enter".split(" ").join(",."+s.keyPrefix))))return 0!==p.repeatRate&&(h.mouseRepeat=[!0,e],setTimeout(function(){h&&h.mouseRepeat[0]&&h.mouseRepeat[1]===e&&!e[0].disabled&&h.repeatKey(e)},p.repeatDelay)),!1})},h.throttleEvent=function(e,t){var a;return function(){a||(e.apply(this,arguments),a=!0,setTimeout(function(){a=!1},t))}},h.execCommand=function(e,t){h.el.ownerDocument.execCommand(e,!1,t),h.el.normalize(),p.reposition&&h.reposition()},h.getValue=function(e){return(e=e||h.$preview)[h.isContentEditable?"text":"val"]()},h.setValue=function(e,t){return t=t||h.$preview,h.isContentEditable?e!==t.text()&&(b.replaceContent(t,e),h.saveCaret()):t.val(e),h},h.insertText=function(e){if(!h.$preview)return h;if("function"==typeof p.beforeInsert&&(e=p.beforeInsert(h.last.event,h,h.el,e)),void 0===e||!1===e)return h.last.key="",h;if(h.isContentEditable)return h.insertContentEditable(e);var t,a=!1,i="\b"===e,n=h.getValue(),s=b.caret(h.$preview),o=n.length;return s.end<s.start&&(s.end=s.start),s.start>o&&(s.end=s.start=o),h.isTextArea&&b.msie&&"\n"===n.substring(s.start,s.start+1)&&(s.start+=1,s.end+=1),t=s.start,"{d}"===e&&(e="",s.end+=1),i&&(e="",a=i&&t===s.end&&0<t),n=n.substring(0,t-(a?1:0))+e+n.substring(s.end),t+=a?-1:e.length,h.setValue(n),h.saveCaret(t,t),h.setScroll(),h},h.insertContentEditable=function(e){return h.$preview.focus(),h.execCommand("insertText",e),h.saveCaret(),h},h.checkMaxLength=function(){if(h.$preview){var e,t,a=h.getValue(),i=h.isContentEditable?b.getEditableLength(h.el):a.length;return!1!==p.maxLength&&i>p.maxLength&&(e=b.caret(h.$preview).start,t=Math.min(e,p.maxLength),p.maxInsert||(a=h.last.val,t=e-1),h.setValue(a.substring(0,p.maxLength)),h.saveCaret(t,t)),h.$decBtn.length&&h.checkDecimal(),h}},h.repeatKey=function(e){e.trigger(b.events.kbRepeater),h.mouseRepeat[0]&&(h.repeater=setTimeout(function(){h&&h.repeatKey(e)},h.repeatTime))},h.getKeySet=function(){var e=[];return h.altActive&&e.push("alt"),h.shiftActive&&e.push("shift"),h.metaActive&&e.push(h.metaActive),e.length?e.join("+"):"normal"},h.showKeySet=function(e){return"string"==typeof e?(h.last.keyset=[h.shiftActive,h.altActive,h.metaActive],h.shiftActive=/shift/i.test(e),h.altActive=/alt/i.test(e),/\bmeta/.test(e)?(h.metaActive=!0,h.showSet(e.match(/\bmeta[\w-]+/i)[0])):(h.metaActive=!1,h.showSet())):h.showSet(e),h},h.showSet=function(e){if(h.hasKeyboard()){p=h.options;var t=b.css,a="."+t.keyPrefix,i=p.css.buttonActive,n="",s=(h.shiftActive?1:0)+(h.altActive?2:0);if(h.shiftActive||(h.capsLock=!1),h.metaActive?(h.shiftActive&&(e=(e||"").replace("-shift","")),h.altActive&&(e=(e||"").replace("-alt","")),""===(n=/^meta/i.test(e)?e:"")?n=!0===h.metaActive?"":h.metaActive:h.metaActive=n,(!p.stickyShift&&h.last.keyset[2]!==h.metaActive||(h.shiftActive||h.altActive)&&!h.$keyboard.find("."+t.keySet+"-"+n+h.rows[s]).length)&&(h.shiftActive=h.altActive=!1)):!p.stickyShift&&h.last.keyset[2]!==h.metaActive&&h.shiftActive&&(h.shiftActive=h.altActive=!1),n=0!==(s=(h.shiftActive?1:0)+(h.altActive?2:0))||h.metaActive?""===n?"":"-"+n:"-normal",!h.$keyboard.find("."+t.keySet+n+h.rows[s]).length)return h.shiftActive=h.last.keyset[0],h.altActive=h.last.keyset[1],void(h.metaActive=h.last.keyset[2]);h.$keyboard.find(a+"alt,"+a+"shift,."+t.keyAction+"[class*=meta]").removeClass(i).end().find(a+"alt").toggleClass(i,h.altActive).end().find(a+"shift").toggleClass(i,h.shiftActive).end().find(a+"lock").toggleClass(i,h.capsLock).end().find("."+t.keySet).hide().end().find("."+(t.keyAction+a+n).replace("--","-")).addClass(i),h.$keyboard.find("."+t.keySet+n+h.rows[s])[0].style.display="inline-block",h.metaActive&&h.$keyboard.find(a+h.metaActive).toggleClass(i,!1!==h.metaActive),h.last.keyset=[h.shiftActive,h.altActive,h.metaActive],h.$el.trigger(b.events.kbKeysetChange,[h,h.el]),p.reposition&&h.reposition()}},h.checkCombos=function(){if(!(h.isVisible()||h.hasKeyboard()&&h.$keyboard.hasClass(b.css.hasFocus)))return h.getValue(h.$preview||h.$el);var e,t,a,i,n=h.getValue(),s=b.caret(h.$preview),o=b.builtLayouts[h.layout],r=h.isContentEditable?b.getEditableLength(h.el):n.length,l=r;return""===n||(s.end<s.start&&(s.end=s.start),s.start>l&&(s.end=s.start=l),b.msie&&"\n"===n.substring(s.start,s.start+1)&&(s.start+=1,s.end+=1),p.useCombos&&(b.msie?n=n.replace(h.regex,function(e,t,a){return p.combos.hasOwnProperty(t)&&p.combos[t][a]||e}):h.$preview.length&&(t=s.start-(0<=s.start-2?2:0),b.caret(h.$preview,t,s.end),a=(i=function(e){return(e||"").replace(h.regex,function(e,t,a){return p.combos.hasOwnProperty(t)&&p.combos[t][a]||e})})((t=b.caret(h.$preview)).text),t&&t.replaceStr&&a!==t.text&&(h.isContentEditable?b.replaceContent(c,i):h.setValue(t.replaceStr(a))),n=h.getValue())),p.restrictInput&&""!==n&&(t=o.acceptedKeys.length,(e=o.acceptedKeysRegex)||(a=y.map(o.acceptedKeys,function(e){return e.replace(h.escapeRegex,"\\$&")}),-1<h.alwaysAllowed.indexOf(b.keyCodes.enter)&&a.push("\\n"),e=o.acceptedKeysRegex=new RegExp("("+a.join("|")+")","g")),(a=n.match(e))?n=a.join(""):(n="",l=0)),s.start+=r-l,s.end+=r-l,h.setValue(n),h.saveCaret(s.start,s.end),h.setScroll(),h.checkMaxLength()),p.acceptValid&&h.checkValid(),n},h.checkValid=function(){var e=b.css,t=h.$keyboard.find("."+e.keyPrefix+"accept"),a=!0;"function"==typeof p.validate&&(a=p.validate(h,h.getValue(),!1)),t.toggleClass(e.inputInvalid,!a).toggleClass(e.inputValid,a).attr("title",t.attr("data-title")+" ("+p.display[a?"valid":"invalid"]+")")},h.checkDecimal=function(){h.decimal&&/\./g.test(h.preview.value)||!h.decimal&&/\,/g.test(h.preview.value)?h.$decBtn.attr({disabled:"disabled","aria-disabled":"true"}).removeClass(p.css.buttonHover).addClass(p.css.buttonDisabled):h.$decBtn.removeAttr("disabled").attr({"aria-disabled":"false"}).addClass(p.css.buttonDefault).removeClass(p.css.buttonDisabled)},h.getLayers=function(e){var t=b.css,a=e.attr("data-pos");return e.closest("."+t.keyboard).find('button[data-pos="'+a+'"]').filter(function(){return""!==y(this).find("."+t.keyText).text()}).add(e)},h.switchInput=function(e,t){if("function"==typeof p.switchInput)p.switchInput(h,e,t);else{h.$keyboard.length&&h.$keyboard.hide();var a,i=!1,n=y("button, input, select, textarea, a, [contenteditable]").filter(":visible").not(":disabled"),s=n.index(h.$el)+(e?1:-1);if(h.$keyboard.length&&h.$keyboard.show(),s>n.length-1&&(i=p.stopAtEnd,s=0),s<0&&(i=p.stopAtEnd,s=n.length-1),!i){if(!(t=h.close(t)))return;(a=n.eq(s).data("keyboard"))&&a.options.openOn.length?a.focusOn():n.eq(s).focus()}}return!1},h.close=function(e){if(h.isOpen&&h.$keyboard.length){clearTimeout(h.throttled);var t=b.css,a=b.events,i=e?h.checkCombos():h.originalContent;if(e&&"function"==typeof p.validate&&!p.validate(h,i,!0)&&(i=h.originalContent,e=!1,p.cancelClose))return;h.isCurrent(!1),h.isOpen=p.alwaysOpen||p.userClosed,h.isContentEditable&&!e?h.$el.html(i):h.setValue(i,h.$el),h.$el.removeClass(t.isCurrent+" "+t.inputAutoAccepted).addClass(e?!0===e?"":t.inputAutoAccepted:"").trigger(a.inputChange),p.alwaysOpen||h.$el.trigger(a.kbBeforeClose,[h,h.el,e||!1]),b.caret(h.$preview,h.last),h.$el.trigger(e?a.inputAccepted:a.inputCanceled,[h,h.el]).trigger(p.alwaysOpen?a.kbInactive:a.kbHidden,[h,h.el]).blur(),h&&(h.last.eventTime=(new Date).getTime(),p.alwaysOpen||p.userClosed&&"true"===e||!h.$keyboard.length||(h.removeKeyboard(),h.timer=setTimeout(function(){h&&h.bindFocus()},200)),h.watermark||""!==h.el.value||""===h.inPlaceholder||(h.$el.addClass(t.placeholder),h.setValue(h.inPlaceholder,h.$el)))}return!!e},h.accept=function(){return h.close(!0)},h.checkClose=function(e){if(!h.opening){var t=y.keyboard.css,a=e.$target||y(e.target).closest("."+b.css.keyboard+", ."+b.css.input);if(a.length||(a=y(e.target)),a.length&&a.hasClass(t.keyboard)){var i=a.data("keyboard");i!==h&&!i.$el.hasClass(t.isCurrent)&&i.options.openOn&&e.type===p.openOn&&i.focusOn()}else h.escClose(e,a)}},h.escCloseCallback={keepOpen:function(){return!h.isOpen}},h.escClose=function(e,t){if(h.isOpen){if(e&&"keyup"===e.type)return e.which!==b.keyCodes.escape||p.ignoreEsc?"":h.close(!(!p.autoAccept||!p.autoAcceptOnEsc)&&"true");var a=!1,i=t.length&&t||y(e.target);if(y.each(h.escCloseCallback,function(e,t){"function"==typeof t&&(a=a||t(i))}),!a&&(!h.isCurrent()&&h.isOpen||h.isOpen&&i[0]!==h.el)){if((p.stayOpen||p.userClosed)&&!i.hasClass(b.css.input))return;if(b.allie&&e.preventDefault(),p.closeByClickEvent){var n=i[0]&&i[0].nodeName.toLowerCase();"input"!==n&&"textarea"!==n&&"click"!==e.type||h.close(!!p.autoAccept&&"true")}else h.close(!!p.autoAccept&&"true")}}},h.keyBtn=y("<button />").attr({role:"button",type:"button","aria-disabled":"false",tabindex:"-1"}).addClass(b.css.keyButton),h.processName=function(e){var t,a,i=(e||"").replace(/[^a-z0-9-_]/gi,""),n=i.length,s=[];if(1<n&&e===i)return e;if(n=e.length){for(t=0;t<n;t++)a=e[t],s.push(/[a-z0-9-_]/i.test(a)?/[-_]/.test(a)&&0!==t?"":a:(0===t?"":"-")+a.charCodeAt(0));return s.join("")}return e},h.processKeys=function(e){var t,a=e.split(/:(?!\/\/)/),i=e.indexOf("</"),n=e.indexOf(":",e.indexOf("<")),s={name:null,map:"",title:""};return-1<i&&(n<0||i<n)?s.name=e:(/\(.+\)/.test(a[0])||/^:\(.+\)/.test(e)||/\([(:)]\)/.test(e)?/\([(:)]\)/.test(e)?(t=a[0].match(/([^(]+)\((.+)\)/))&&t.length?(s.name=t[1],s.map=t[2],s.title=1<a.length?a.slice(1).join(":"):""):(s.name=e.match(/([^(]+)/)[0],":"===s.name&&(a=a.slice(1)),null===t&&(s.map=":",a=a.slice(2)),s.title=a.length?a.join(":"):""):(s.map=e.match(/\(([^()]+?)\)/)[1],""===(t=(e=e.replace(/\(([^()]+)\)/,"")).split(":"))[0]?(s.name=":",a=a.slice(1)):s.name=t[0],s.title=1<a.length?a.slice(1).join(":"):""):(""!==e&&""===a[0]?(s.name=":",a=a.slice(1)):s.name=a[0],s.title=1<a.length?a.slice(1).join(":"):""),s.title=y.trim(s.title).replace(/_/g," ")),s},h.addKey=function(e,t,a){var i,n,s,o={},r=h.processKeys(a?e:t),l=b.css;return!a&&p.display[r.name]?(s=h.processKeys(p.display[r.name])).action=h.processKeys(e).name:(s=r).action=r.name,o.name=h.processName(r.name),""!==s.name&&(""!==s.map?(b.builtLayouts[h.layout].mappedKeys[s.map]=s.name,b.builtLayouts[h.layout].acceptedKeys.push(s.name)):a&&b.builtLayouts[h.layout].acceptedKeys.push(s.name)),i=a?""===o.name?"":l.keyPrefix+o.name:l.keyAction+" "+l.keyPrefix+s.action,i+=(2<s.name.length?" "+l.keyWide:"")+" "+p.css.buttonDefault,o.html='<span class="'+l.keyText+'">'+s.name.replace(/[\u00A0-\u9999]/gim,function(e){return"&#"+e.charCodeAt(0)+";"})+"</span>",o.$key=h.keyBtn.clone().attr({"data-value":a?s.name:s.action,"data-name":s.action,"data-pos":h.temp[1]+","+h.temp[2],"data-action":s.action,"data-html":o.html}).addClass(i).html(o.html).appendTo(h.temp[0]),s.map&&o.$key.attr("data-mapped",s.map),(s.title||r.title)&&o.$key.attr({"data-title":r.title||s.title,title:r.title||s.title}),"function"==typeof p.buildKey&&(n=(o=p.buildKey(h,o)).$key.html(),o.$key.attr("data-html",n)),o.$key},h.customHash=function(e){var t,a,i,n,s=[],o=[];for(a in e=void 0===e?p.customLayout:e)e.hasOwnProperty(a)&&s.push(e[a]);if((i=0)===(n=(o=o.concat.apply(o,s).join(" ")).length))return i;for(t=0;t<n;t++)i=(i<<5)-i+o.charCodeAt(t),i&=i;return i},h.buildKeyboard=function(e,t){y.isEmptyObject(p.display)&&h.updateLanguage();var a,i,n,s,o=b.css,r=0,l=b.builtLayouts[e||h.layout||p.layout]={mappedKeys:{},acceptedKeys:[]},c=l.acceptedKeys=p.restrictInclude&&(""+p.restrictInclude).split(/\s+/)||[],d=o.keyboard+" "+p.css.popup+" "+p.css.container+(p.alwaysOpen||p.userClosed?" "+o.alwaysOpen:""),u=y("<div />").addClass(d).attr({role:"textbox"}).hide();return-1<(a=y.inArray("{space}",c))&&(c[a]=" "),d=t&&"custom"===p.layout||!b.layouts.hasOwnProperty(p.layout)?(p.layout="custom",b.layouts.custom=p.customLayout||{normal:["{cancel}"]}):b.layouts[t?p.layout:e||h.layout||p.layout],y.each(d,function(e,t){if(""!==e&&!/^(name|lang|rtl)$/i.test(e))for("default"===e&&(e="normal"),r++,n=y("<div />").attr("name",e).addClass(o.keySet+" "+o.keySet+"-"+e).appendTo(u).toggle("normal"===e),i=0;i<t.length;i++)s=y.trim(t[i]).replace(/\{(\.?)[\s+]?:[\s+]?(\.?)\}/g,"{$1:$2}"),h.buildRow(n,i,s.split(/\s+/),c),n.find("."+o.keyButton+",."+o.keySpacer).filter(":last").after('<br class="'+o.endRow+'"/>')}),1<r&&(h.sets=!0),l.hasMappedKeys=!y.isEmptyObject(l.mappedKeys),l.$keyboard=u},h.buildRow=function(e,t,a,i){var n,s,o,r,l,c,d=b.css;for(o=0;o<a.length;o++)if(r=!(h.temp=[e,t,o]),0!==a[o].length)if(/^\{\S+\}$/.test(a[o])){if(l=a[o].match(/^\{(\S+)\}$/)[1],/\!\!/.test(l)&&(l=l.replace("!!",""),r=!0),/^sp:((\d+)?([\.|,]\d+)?)(em|px)?$/i.test(l)&&(c=parseFloat(l.replace(/,/,".").match(/^sp:((\d+)?([\.|,]\d+)?)(em|px)?$/i)[1]||0),y('<span class="'+d.keyText+'"></span>').width(l.match(/px/i)?c+"px":2*c+"em").addClass(d.keySpacer).appendTo(e)),/^empty(:((\d+)?([\.|,]\d+)?)(em|px)?)?$/i.test(l)){c=/:/.test(l)?parseFloat(l.replace(/,/,".").match(/^empty:((\d+)?([\.|,]\d+)?)(em|px)?$/i)[1]||0):"",h.addKey(""," ",!0).addClass(p.css.buttonDisabled+" "+p.css.buttonEmpty).attr("aria-disabled",!0).width(c?l.match("px")?c+"px":2*c+"em":"");continue}if(/^meta[\w-]+\:?(\w+)?/i.test(l)){h.addKey(l.split(":")[0],l).addClass(d.keyHasActive);continue}switch((s=l.split(":"))[0].toLowerCase()){case"a":case"accept":h.addKey("accept",l).addClass(p.css.buttonAction+" "+d.keyAction);break;case"alt":case"altgr":h.addKey("alt",l).addClass(d.keyHasActive);break;case"b":case"bksp":h.addKey("bksp",l);break;case"c":case"cancel":h.addKey("cancel",l).addClass(p.css.buttonAction+" "+d.keyAction);break;case"combo":h.addKey("combo",l).addClass(d.keyHasActive).attr("title",function(e,t){return t+" "+p.display[p.useCombos?"active":"disabled"]}).toggleClass(p.css.buttonActive,p.useCombos);break;case"dec":i.push(h.decimal?".":","),h.addKey("dec",l);break;case"e":case"enter":h.addKey("enter",l).addClass(p.css.buttonAction+" "+d.keyAction);break;case"lock":h.addKey("lock",l).addClass(d.keyHasActive);break;case"s":case"shift":h.addKey("shift",l).addClass(d.keyHasActive);break;case"sign":i.push("-"),h.addKey("sign",l);break;case"space":i.push(" "),h.addKey("space",l);break;case"t":case"tab":h.addKey("tab",l);break;default:b.keyaction.hasOwnProperty(s[0])&&h.addKey(s[0],l).toggleClass(p.css.buttonAction+" "+d.keyAction,r)}}else n=a[o],h.addKey(n,n,!0)},h.removeBindings=function(e){y(document).unbind(e),h.el.ownerDocument!==document&&y(h.el.ownerDocument).unbind(e),y(window).unbind(e),h.$el.unbind(e)},h.removeKeyboard=function(){h.$decBtn=[],p.usePreview&&h.$preview.removeData("keyboard"),h.$preview.unbind(h.namespace+"keybindings"),h.preview=null,h.$preview=null,h.$previewCopy=null,h.$keyboard.removeData("keyboard"),h.$keyboard.remove(),h.$keyboard=[],h.isOpen=!1,h.isCurrent(!1)},h.destroy=function(e){var t,a=b.css,i=h.extensionNamespace.length,n=[a.input,a.locked,a.placeholder,a.noKeyboard,a.alwaysOpen,p.css.input,a.isCurrent].join(" ");for(clearTimeout(h.timer),clearTimeout(h.timer2),clearTimeout(h.timer3),h.$keyboard.length&&h.removeKeyboard(),h.options.openOn&&h.removeBindings(h.options.openOn),h.removeBindings(h.namespace),h.removeBindings(h.namespace+"callbacks"),t=0;t<i;t++)h.removeBindings(h.extensionNamespace[t]);h.el.active=!1,h.$el.removeClass(n).removeAttr("aria-haspopup").removeAttr("role").removeData("keyboard"),h=null,"function"==typeof e&&e()},h.init()};return b.keyCodes={backSpace:8,tab:9,enter:13,capsLock:20,escape:27,space:32,pageUp:33,pageDown:34,end:35,home:36,left:37,up:38,right:39,down:40,insert:45,delete:46,A:65,Z:90,V:86,C:67,X:88,a:97,z:122},b.css={idSuffix:"_keyboard",initialFocus:"keyboard-init-focus",input:"ui-keyboard-input",inputClone:"ui-keyboard-preview-clone",wrapper:"ui-keyboard-preview-wrapper",preview:"ui-keyboard-preview",keyboard:"ui-keyboard",keySet:"ui-keyboard-keyset",keyButton:"ui-keyboard-button",keyWide:"ui-keyboard-widekey",keyPrefix:"ui-keyboard-",keyText:"ui-keyboard-text",keyHasActive:"ui-keyboard-hasactivestate",keyAction:"ui-keyboard-actionkey",keySpacer:"ui-keyboard-spacer",keyToggle:"ui-keyboard-toggle",keyDisabled:"ui-keyboard-disabled",divWrapperCE:"ui-keyboard-div-wrapper",locked:"ui-keyboard-lockedinput",alwaysOpen:"ui-keyboard-always-open",noKeyboard:"ui-keyboard-nokeyboard",placeholder:"ui-keyboard-placeholder",hasFocus:"ui-keyboard-has-focus",isCurrent:"ui-keyboard-input-current",inputValid:"ui-keyboard-valid-input",inputInvalid:"ui-keyboard-invalid-input",inputAutoAccepted:"ui-keyboard-autoaccepted",endRow:"ui-keyboard-button-endrow"},b.events={kbChange:"keyboardChange",kbBeforeClose:"beforeClose",kbBeforeVisible:"beforeVisible",kbVisible:"visible",kbInit:"initialized",kbInactive:"inactive",kbHidden:"hidden",kbRepeater:"repeater",kbKeysetChange:"keysetChange",inputAccepted:"accepted",inputCanceled:"canceled",inputChange:"change",inputRestricted:"restricted"},b.keyaction={accept:function(e){return e.close(!0),!1},alt:function(e){e.altActive=!e.altActive,e.showSet()},bksp:function(e){e.isContentEditable?(e.execCommand("delete"),e.saveCaret()):e.insertText("\b")},cancel:function(e){return e.close(),!1},clear:function(e){e.$preview[e.isContentEditable?"text":"val"](""),e.$decBtn.length&&e.checkDecimal()},combo:function(e){var t=e.options,a=!t.useCombos,i=e.$keyboard.find("."+b.css.keyPrefix+"combo");return t.useCombos=a,i.toggleClass(t.css.buttonActive,a).attr("title",i.attr("data-title")+" ("+t.display[a?"active":"disabled"]+")"),a&&e.checkCombos(),!1},dec:function(e){e.insertText(e.decimal?".":",")},del:function(e){e.isContentEditable?e.execCommand("forwardDelete"):e.insertText("{d}")},default:function(e){e.shiftActive=e.altActive=e.metaActive=!1,e.showSet()},enter:function(e,t,a){var i=e.options;return a.shiftKey?i.enterNavigation?e.switchInput(!a[i.enterMod],!0):e.close(!0):!i.enterNavigation||e.isTextArea&&!a[i.enterMod]?(e.isTextArea&&y(a.target).closest("button").length&&e.insertText((b.msie?" ":"")+"\n"),void(e.isContentEditable&&!i.enterNavigation&&(e.execCommand("insertHTML",'<div><br class="'+b.css.divWrapperCE+'"></div>'),setTimeout(function(){b.keyaction.right(e),e.saveCaret()},0)))):e.switchInput(!a[i.enterMod],!!i.autoAccept&&"true")},lock:function(e){e.last.keyset[0]=e.shiftActive=e.capsLock=!e.capsLock,e.showSet()},left:function(e){var t=b.caret(e.$preview);0<=t.start-1&&(e.last.start=e.last.end=t.start-1,b.caret(e.$preview,e.last),e.setScroll())},meta:function(e,t){var a=y(t);e.metaActive=!a.hasClass(e.options.css.buttonActive),e.showSet(a.attr("data-name"))},next:function(e){return e.switchInput(!0,e.options.autoAccept),!1},normal:function(e){e.shiftActive=e.altActive=e.metaActive=!1,e.showSet()},prev:function(e){return e.switchInput(!1,e.options.autoAccept),!1},right:function(e){var t=b.caret(e.$preview),a=e.isContentEditable?b.getEditableLength(e.el):e.getValue().length;t.end+1<=a&&(e.last.start=e.last.end=t.end+1,b.caret(e.$preview,e.last),e.setScroll())},shift:function(e){e.last.keyset[0]=e.shiftActive=!e.shiftActive,e.showSet()},sign:function(e){if(/^[+-]?\d*\.?\d*$/.test(e.getValue())){var t,a=b.caret(e.$preview),i=e.getValue(),n=e.isContentEditable?b.getEditableLength(e.el):i.length;e.setValue(-1*i),t=n-i.length,e.last.start=a.start+t,e.last.end=a.end+t,b.caret(e.$preview,e.last),e.setScroll()}},space:function(e){e.insertText(" ")},tab:function(e){var t=e.options;if(!e.isTextArea){if(t.tabNavigation)return e.switchInput(!e.shiftActive,!0);if(e.isInput)return!1}e.insertText("\t")},toggle:function(e){e.enabled=!e.enabled,e.toggle()},NBSP:" ",ZWSP:"​",ZWNJ:"‌",ZWJ:"‍",LRM:"‎",RLM:"‏"},b.builtLayouts={},b.layouts={alpha:{normal:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} a b c d e f g h i j [ ] \\","k l m n o p q r s ; ' {enter}","{shift} t u v w x y z , . / {shift}","{accept} {space} {cancel}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} A B C D E F G H I J { } |",'K L M N O P Q R S : " {enter}',"{shift} T U V W X Y Z < > ? {shift}","{accept} {space} {cancel}"]},qwerty:{normal:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w e r t y u i o p [ ] \\","a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}","{accept} {space} {cancel}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'A S D F G H J K L : " {enter}',"{shift} Z X C V B N M < > ? {shift}","{accept} {space} {cancel}"]},international:{normal:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w e r t y u i o p [ ] \\","a s d f g h j k l ; ' {enter}","{shift} z x c v b n m , . / {shift}","{accept} {alt} {space} {alt} {cancel}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W E R T Y U I O P { } |",'A S D F G H J K L : " {enter}',"{shift} Z X C V B N M < > ? {shift}","{accept} {alt} {space} {alt} {cancel}"],alt:["~ ¡ ² ³ ¤ € ¼ ½ ¾ ‘ ’ ¥ × {bksp}","{tab} ä å é ® þ ü ú í ó ö « » ¬","á ß ð f g h j k ø ¶ ´ {enter}","{shift} æ x © v b ñ µ ç > ¿ {shift}","{accept} {alt} {space} {alt} {cancel}"],"alt-shift":["~ ¹ ² ³ £ € ¼ ½ ¾ ‘ ’ ¥ ÷ {bksp}","{tab} Ä Å É ® Þ Ü Ú Í Ó Ö « » ¦","Ä § Ð F G H J K Ø ° ¨ {enter}","{shift} Æ X ¢ V B Ñ µ Ç . ¿ {shift}","{accept} {alt} {space} {alt} {cancel}"]},colemak:{normal:["` 1 2 3 4 5 6 7 8 9 0 - = {bksp}","{tab} q w f p g j l u y ; [ ] \\","{bksp} a r s t d h n e i o ' {enter}","{shift} z x c v b k m , . / {shift}","{accept} {space} {cancel}"],shift:["~ ! @ # $ % ^ & * ( ) _ + {bksp}","{tab} Q W F P G J L U Y : { } |",'{bksp} A R S T D H N E I O " {enter}',"{shift} Z X C V B K M < > ? {shift}","{accept} {space} {cancel}"]},dvorak:{normal:["` 1 2 3 4 5 6 7 8 9 0 [ ] {bksp}","{tab} ' , . p y f g c r l / = \\","a o e u i d h t n s - {enter}","{shift} ; q j k x b m w v z {shift}","{accept} {space} {cancel}"],shift:["~ ! @ # $ % ^ & * ( ) { } {bksp}",'{tab} " < > P Y F G C R L ? + |',"A O E U I D H T N S _ {enter}","{shift} : Q J K X B M W V Z {shift}","{accept} {space} {cancel}"]},num:{normal:["= ( ) {b}","{clear} / * -","7 8 9 +","4 5 6 {sign}","1 2 3 %","0 {dec} {a} {c}"]}},b.language={en:{display:{a:"✔:Accept (Shift+Enter)",accept:"Accept:Accept (Shift+Enter)",alt:"Alt:⌥ AltGr",b:"⌫:Backspace",bksp:"Bksp:Backspace",c:"✖:Cancel (Esc)",cancel:"Cancel:Cancel (Esc)",clear:"C:Clear",combo:"ö:Toggle Combo Keys",dec:".:Decimal",e:"⏎:Enter",empty:" ",enter:"Enter:Enter ⏎",left:"←",lock:"Lock:⇪ Caps Lock",next:"Next ⇨",prev:"⇦ Prev",right:"→",s:"⇧:Shift",shift:"Shift:Shift",sign:"±:Change Sign",space:" :Space",t:"⇥:Tab",tab:"⇥ Tab:Tab",toggle:" ",valid:"valid",invalid:"invalid",active:"active",disabled:"disabled"},wheelMessage:"Use mousewheel to see other keys",comboRegex:/([`\'~\^\"ao])([a-z])/gim,combos:{"`":{a:"à",A:"À",e:"è",E:"È",i:"ì",I:"Ì",o:"ò",O:"Ò",u:"ù",U:"Ù",y:"ỳ",Y:"Ỳ"},"'":{a:"á",A:"Á",e:"é",E:"É",i:"í",I:"Í",o:"ó",O:"Ó",u:"ú",U:"Ú",y:"ý",Y:"Ý"},'"':{a:"ä",A:"Ä",e:"ë",E:"Ë",i:"ï",I:"Ï",o:"ö",O:"Ö",u:"ü",U:"Ü",y:"ÿ",Y:"Ÿ"},"^":{a:"â",A:"Â",e:"ê",E:"Ê",i:"î",I:"Î",o:"ô",O:"Ô",u:"û",U:"Û",y:"ŷ",Y:"Ŷ"},"~":{a:"ã",A:"Ã",e:"ẽ",E:"Ẽ",i:"ĩ",I:"Ĩ",o:"õ",O:"Õ",u:"ũ",U:"Ũ",y:"ỹ",Y:"Ỹ",n:"ñ",N:"Ñ"}}}},b.defaultOptions={language:null,rtl:!1,layout:"qwerty",customLayout:null,position:{of:null,my:"center top",at:"center top",at2:"center bottom"},reposition:!0,usePreview:!0,alwaysOpen:!1,initialFocus:!0,noFocus:!1,stayOpen:!1,userClosed:!1,ignoreEsc:!1,closeByClickEvent:!1,css:{input:"ui-widget-content ui-corner-all",container:"ui-widget-content ui-widget ui-corner-all ui-helper-clearfix",popup:"",buttonDefault:"ui-state-default ui-corner-all",buttonHover:"ui-state-hover",buttonAction:"ui-state-active",buttonActive:"ui-state-active",buttonDisabled:"ui-state-disabled",buttonEmpty:"ui-keyboard-empty"},autoAccept:!1,autoAcceptOnEsc:!1,lockInput:!1,restrictInput:!1,restrictInclude:"",acceptValid:!1,autoAcceptOnValid:!1,checkValidOnInit:!0,cancelClose:!0,tabNavigation:!1,enterNavigation:!1,enterMod:"altKey",stopAtEnd:!0,appendLocally:!1,appendTo:"body",wrapBRs:!0,stickyShift:!0,preventPaste:!1,caretToEnd:!1,scrollAdjustment:10,maxLength:!1,maxInsert:!0,repeatDelay:500,repeatRate:20,resetDefault:!0,openOn:"focus",activeOnReadonly:!1,keyBinding:"mousedown touchstart",useWheel:!0,useCombos:!0,validate:function(){return!0}},b.comboRegex=/([`\'~\^\"ao])([a-z])/gim,b.currentKeyboard="",y('\x3c!--[if lte IE 8]><script>jQuery("body").addClass("oldie");<\/script><![endif]--\x3e\x3c!--[if IE]><script>jQuery("body").addClass("ie");<\/script><![endif]--\x3e').appendTo("body").remove(),b.msie=y("body").hasClass("oldie"),b.allie=y("body").hasClass("ie"),b.watermark=void 0!==document.createElement("input").placeholder,b.checkCaretSupport=function(){if("boolean"!=typeof b.checkCaret){var e=y('<div style="height:0px;width:0px;overflow:hidden;position:fixed;top:0;left:-100px;"><input type="text" value="testing"/></div>').prependTo("body");b.caret(e.find("input"),3,3),b.checkCaret=3!==b.caret(e.find("input").hide().show()).start,e.remove()}return b.checkCaret},b.caret=function(e,t,a){if(!e||!e.length||e.is(":hidden")||"hidden"===e.css("visibility"))return{};var i,n,s,o,r=e.data("keyboard"),l=r&&r.options.noFocus,c=/(textarea|input)/i.test(e[0].nodeName);return l||e.focus(),void 0!==t?("object"==typeof t&&"start"in t&&"end"in t?(i=t.start,n=t.end):void 0===a&&(a=t),"number"==typeof t&&"number"==typeof a?(i=t,n=a):"start"===t?i=n=0:"string"==typeof t&&(i=n="end"),c?e.caret(i,n,l):b.setEditableCaret(e,i,n)):(o=c?e.caret():b.getEditableCaret(e[0]),i=o.start,n=o.end,s=c&&e[0].value||e.text()||"",{start:i,end:n,text:s.substring(i,n),replaceStr:function(e){return s.substring(0,i)+e+s.substring(n,s.length)}})},b.isTextNode=function(e){return e&&3===e.nodeType},b.isBlock=function(e,t){var a=e.ownerDocument.defaultView;return t&&1===t.nodeType&&t!==e&&"block"===a.getComputedStyle(t).display?1:0},b.wrapBRs=function(i){var e=y(i).find("br:not(."+b.css.divWrapperCE+")");e.length&&y.each(e,function(e,t){var a=t.parentNode.childNodes.length;(1!==a||1===a&&!b.isBlock(i,t.parentNode))&&y(t).addClass(b.css.divWrapperCE).wrap("<div>")})},b.getEditableCaret=function(l){if(!(l=y(l)[0]).isContentEditable)return{};var e,t,c=(y(l).data("keyboard")||{}).options,a=l.ownerDocument.getSelection().getRangeAt(0),i=s(a.startContainer,a.startOffset),n=i.position;function s(e,t){var a,i="",n=!1,s=0,o=y.makeArray(l.childNodes);function r(e){e&&(s+=e,i+=c&&c.replaceCR||"\n")}for(;!n&&o.length;){if((a=o.shift())===e&&(n=!0),r(b.isBlock(l,a.previousSibling)),b.isTextNode(a)){if(s+=n?t:a.length,i+=a.textContent,n)return{position:s,text:i}}else!n&&a.childNodes&&(o=y.makeArray(a.childNodes).concat(o));r(b.isTextNode(a.previousSibling)&&b.isBlock(l,a))}return{position:s,text:i}}return!1!==c.wrapBRs&&b.wrapBRs(l),t=a.endContainer===a.startContainer&&a.endOffset===a.startOffset?(e=n,""):(e=(i=s(a.endContainer,a.endOffset)).position,i.text.substring(n,e)),{start:n,end:e,text:t}},b.getEditableLength=function(e){var t=b.setEditableCaret(e,"getMax");return"number"==typeof t?t:null},b.setEditableCaret=function(u,e,t){if(!(u=y(u)[0]).isContentEditable)return{};var a=u.ownerDocument,i=a.createRange(),n=a.getSelection(),p=(y(u).data("keyboard")||{}).options,s=e,o=t,r="",l=c("getMax"===e?"end":e);function c(a){"end"===a?a=u.innerHTML.length:a<0&&(a=0);var e,t,i="",n=!1,s=0,o=0,r=0,l=y.makeArray(u.childNodes);function c(e){return i+=e?p&&p.replaceCR||"\n":"",0<e}function d(e){var t=s+e;return o=r,r+=e,0<=a-t?a-(s=t)<=0:a-t<=0}for(;!n&&l.length;)if(e=l.shift(),c(t=b.isBlock(u,e.previousSibling))&&d(t)&&(n=!0),c(t=b.isTextNode(e.previousSibling)&&b.isBlock(u,e))&&d(t)&&(n=!0),b.isTextNode(e)){if(i+=e.textContent,d(e.length))return{node:e,offset:t=a-s==0&&1<=s-o?e.length:a-s,position:a,text:i}}else!n&&e.childNodes&&(l=y.makeArray(e.childNodes).concat(l));return l.length?{node:e,offset:a-s,position:a,text:i}:{node:e,offset:e&&e.length||0,position:r,text:i}}if(l.node){if(s=l.position,"getMax"===e)return s;i.setStart(l.node,l.offset),void 0!==t&&t!==e&&(l=c(t)),l.node&&(o=l.position,i.setEnd(l.node,l.offset),r=s===o?"":l.text.substring(s,o)),n.removeAllRanges(),n.addRange(i)}return{start:s,end:o,text:r}},b.replaceContent=function(e,t){e=y(e)[0];for(var a,i,n,s=typeof t,o=b.getEditableCaret(e).start,r=0,l=[e];a=l.pop();)if(b.isTextNode(a))"function"===s?r<=o&&o<=r+a.length&&(a.textContent=t(a.textContent)):"string"===s&&(n=t.substring(r,r+a.length))!==a.textContent&&(a.textContent=n),r+=a.length;else if(a&&a.childNodes)for(i=a.childNodes.length;i--;)l.push(a.childNodes[i]);i=b.getEditableCaret(e),b.setEditableCaret(e,i.start,i.start)},y.fn.keyboard=function(e){return this.each(function(){y(this).data("keyboard")||new y.keyboard(this,e)})},y.fn.getkeyboard=function(){return this.data("keyboard")},y.fn.caret=function(t,a,e){if(void 0===this[0]||this.is(":hidden")||"hidden"===this.css("visibility")||!/(INPUT|TEXTAREA)/i.test(this[0].nodeName))return this;var i,n,s,o,r,l=this,c=l[0],d=c.ownerDocument.selection,u=c.scrollTop,p=!1,h=!0;try{p="selectionStart"in c}catch(e){h=!1}return h&&void 0!==t?(/(email|number)/i.test(c.type)||(p?(c.selectionStart=t,c.selectionEnd=a):((i=c.createTextRange()).collapse(!0),i.moveStart("character",t),i.moveEnd("character",a-t),i.select())),e||!l.is(":visible")&&"hidden"===l.css("visibility")||c.focus(),c.scrollTop=u,this):(/(email|number)/i.test(c.type)?t=a=l.val().length:p?(t=c.selectionStart,a=c.selectionEnd):d?a="TEXTAREA"===c.nodeName.toUpperCase()?(r=l.val(),(s=(n=d.createRange()).duplicate()).moveToElementText(c),s.setEndPoint("EndToEnd",n),(t=s.text.replace(/\r/g,"\n").length)+n.text.replace(/\r/g,"\n").length):(r=l.val().replace(/\r/g,"\n"),(n=d.createRange().duplicate()).moveEnd("character",r.length),t=""===n.text?r.length:r.lastIndexOf(n.text),(n=d.createRange().duplicate()).moveStart("character",-r.length),n.text.length):t=a=(c.value||"").length,o=c.value||"",{start:t,end:a,text:o.substring(t,a),replace:function(e){return o.substring(0,t)+e+o.substring(a,o.length)}})},b});

@@ -5,3 +5,3 @@ {

"description": "Virtual Keyboard using jQuery UI",
"version": "1.28.9",
"version": "1.29.0",
"author": {

@@ -8,0 +8,0 @@ "name": "Jeremy Satterfield",

@@ -150,2 +150,9 @@ <img alt="keyboard logo" align="right" src="./docs/css/images/keyboard-logo.png">A jQuery on-screen keyboard (OSK) plugin that works in the browser.<br>

### Version 1.29.0 (2019-05-02)
* Core:
* Update to work with jQuery v3.4+.
* Docs:
* Update jQuery & UI (using slim & custom jQuery UI).
### Version 1.28.9 (2019-03-09)

@@ -175,9 +182,1 @@

* Update dependencies.
### Version 1.28.7 (2018-10-09)
* Core:
* Fix JS Error. Closes [issue #699](https://github.com/Mottie/Keyboard/issues/699).
* Readme:
* Fix Usability (spelling error). See [PR #694](https://github.com/Mottie/Keyboard/pull/694); thanks [@0xflotus](https://github.com/0xflotus)!
* Fix comboRegex (spelling error). See [PR #695](https://github.com/Mottie/Keyboard/pull/695); thanks [@0xflotus](https://github.com/0xflotus)!

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc