/*! jQuery UI Virtual Keyboard v1.30.1 */ !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.30.1",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.$preview.focus(),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").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=h.preview.scrollWidth-t?h.preview.scrollLeft=h.preview.scrollWidth-a:h.preview.scrollLeft=0=o.A&&t<=o.Z,i=t>=o.a&&t<=o.z,n=h.last.key=String.fromCharCode(t);if(!(t=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=t.left&&e.originalEvent.touches[0].pageX=t.top&&e.originalEvent.touches[0].pageYn.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.endo&&(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&&0p.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.endl&&(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,"\\$&")}),-1n.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("