/* * * GrapeCity InputMan Library 1.0.0 * http://grapecity.com/ * * Copyright(c) GrapeCity, Inc. All rights reserved. * **/ var GCIM;(function(n){var t=function(){function t(n){this.DEFAULT_DISPLAYCOUNT=5,this._owner=n,this._hightlightIndex=-1,this._dataList=[],this._isDeleteItem=!1,this._isFocusOnList=!1,this._isMouseOnList=!1,this._refreshElement(),this._createDropdown(),this._firstItemShowing=0,this._lastItemShowing=this.GetDisplayItemsCount()-1}return t.prototype._refreshElement=function(){this._controlContainer=this._owner._getControlContainer(),this._inputElement=this._owner.GetInputElement(),this._maxItems=this._owner.GetMaxHistoryCount(),this._inputElement&&(this._inputElement.autocomplete="off")},t.prototype._createDropdown=function(){var i=this,t=n.Utility.CreateElement("div");t.style.position="absolute",t.style.zIndex="999999",t.style.display="none",t.style.backgroundColor="white",t.style.border="solid 1px black",t.style.overflowX="hidden",t.style.overflowY="auto",t.id=this._owner._getId()+"_HistoryList",n.Utility.AttachEvent(t,"focus",function(){i._isFocusOnList=!0,t.blur(),i._owner.SetInnerFocus(n.FocusType.ContextMenu)}),n.Utility.AttachEvent(t,"mouseover",function(){i._isMouseOnList=!0}),n.Utility.AttachEvent(t,"mouseout",function(){i._isMouseOnList=!1}),n.Utility.DisabledContextMenu(t),this._dropDownElement=t},t.prototype.GetIsDeleteItem=function(){return this._isDeleteItem},t.prototype.SetIsDeleteItem=function(n){this._isDeleteItem=n},t.prototype.GetIsFocusOnList=function(){return this._isFocusOnList},t.prototype.SetIsFocusOnList=function(n){this._isFocusOnList=n},t.prototype.GetIsMouseOnList=function(){return this._isMouseOnList},t.prototype.ShowDropdown=function(){var e=this,t,f,r;this._refreshElement(),this.IsVisible()&&this.HideDropdown(),n.Utility.ClearChildren(this._dropDownElement),t=this._addDisplayItems();if(t===0)return;var o=n.Utility.GetElementPosition(this._controlContainer).Left,s=n.Utility.GetElementPosition(this._controlContainer).Top+this._controlContainer.offsetHeight,u=this._controlContainer.offsetWidth,i="";t>this._maxItems&&(f=n.Utility.MeasureText("WHQ",this._dropDownElement.firstChild).Height,i=this._maxItems*(f+2)+"px"),t>this.DEFAULT_DISPLAYCOUNT&&this._maxItems>this.DEFAULT_DISPLAYCOUNT&&(i="95px",this._dropDownElement.style.overflowY="auto"),r="",n.Utility.IsTouchMouseDown==!0&&(r=this._owner.GetTouchDropDownScale().toString()),u-=2,this._dropDownElement.style.left=o+"px",this._dropDownElement.style.top=s+"px",this._dropDownElement.style.width=u+"px",this._dropDownElement.style.display="",n.Utility.SetZoomStyle(this._dropDownElement,r),this._dropDownElement.style.height=i,this._owner._getControlEffect()===n.ControlEffect.JQueryUI?(this._dropDownElement.className="ui-widget-content ui-corner-all",this._dropDownElement.style.border=""):(this._dropDownElement.className="",this._dropDownElement.style.border="solid 1px black"),document.body.appendChild(this._dropDownElement),this._docClickListerner=function(){e.HideDropdown()},n.Utility.AttachEvent(document,"click",this._docClickListerner)},t.prototype.DetachEvent=function(){n.Utility.DetachEvent(document,"click",this._docClickListerner)},t.prototype._addDisplayItems=function(){for(var r=this,f=this._owner._uIUpdate.GetText(),u=[],e,i,t=0;tf.GetLength()&&u.push(this._dataList[t]);for(e=u.length>this._maxItems?this._maxItems:u.length,t=0;t0&&this._hightlightIndex==i-1||n<0&&this._hightlightIndex==0)&&(r=!0),r?n>0?this.SetHighlighItem(0):n<0&&this.SetHighlighItem(i-1):(u=this.GetDisplayItemsCount(),n===1||n===-1?t=this._hightlightIndex+n:n>1?t=this._lastItemShowing!==this._hightlightIndex?this._lastItemShowing:Math.min(this._hightlightIndex+u,i-1):n<-1&&(t=this._firstItemShowing!==this._hightlightIndex?this._firstItemShowing:Math.max(this._hightlightIndex-u,0)),this.SetHighlighItem(t))},t.prototype.SetValue=function(){var i=this._dropDownElement.childNodes[this._hightlightIndex].innerHTML,t,r;i=n.Utility.DecodingFromHTML(i),this._owner.InternalSetText(i,!0),this._owner.SetInnerFocus(n.FocusType.ContextMenu),t=this._owner._uIUpdate.GetText().GetLength(),r=Math.abs(this._owner.SelectionEnd-this._owner.SelectionStart),r!=0?this._owner.InternalSetSelection(0,t):this._owner.InternalSetSelection(t,t)},t.prototype.ScrollCheck=function(){var t,i;this._hightlightIndex!==-1&&(t=this.GetDisplayItemsCount(),this._hightlightIndex>this._lastItemShowing&&(this._firstItemShowing=this._hightlightIndex-(t-1),this._lastItemShowing=this._hightlightIndex),this._hightlightIndex0&&(u+="\r\n"),u+=this._lines[t];else for(t=0;tthis.GetText().GetLength()?(this.SelectionStart=this.GetText().GetLength(),this.SelectionEnd=this.GetText().GetLength()):(u=this.GetSelectionLength(),this.SelectionStart=i,this.SelectionEnd=+i+u>this.GetText().GetLength()?this.GetText().GetLength():+i+u)),this)},i.prototype.GetSelectionLength=function(){return Math.abs(this.SelectionStart-this.SelectionEnd)},i.prototype.SetSelectionLength=function(t){var r,i;t=n.Utility.CheckInt(t);if(t<0)throw"ArgumentOutOfRangeException";return t==null?this:(r=t.toString(),n.Utility.FilterText("0123456789",r)==r&&(i=this.GetSelectionStart(),this.SelectionStart=i,this.SelectionEnd=i+t>this.GetText().GetLength()?this.GetText().GetLength():i+t),this)},i.prototype.GetText=function(){if(this._passwordMode)return this._realText;var n=this._uIUpdate.GetText();return n!=null?n:this.Text},i.prototype.SetText=function(t){var r,i;return t=n.Utility.CheckString(t),this.SetInnerText(t),r=this.GetText(),this._oldText==r||this._uIProcess.japInput||(this._oldText=r,this.Text=r,this._uIUpdate.SetHideText(this.Text),i={},i.Name=this._specialClientEvents.TextChanged,i.Args=null,i.Type="DropDownTextChanged",this._uIProcess.FireEvent(this,i.Name,i.Args,i.Type)),this},i.prototype.GetTextHAlign=function(){return this._textHAlign},i.prototype.SetTextHAlign=function(t){t=n.Utility.CheckEnum(n.HorizontalAlignment,t),this._inputElement.style.textAlign=t!==n.HorizontalAlignment.NotSet?t:"left",this._textHAlign=t},i.prototype.GetWidth=function(){if(this._useDefaultLength(this._width)){var n=this.GetBorderWidth();return n=n===""?1:n,this._getDefaultSize().Width-n*2}else return this._width},i.prototype.Clear=function(){return this.SetText(""),this},i.prototype.OnClick=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.Click=t},i.prototype.OnDoubleClick=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.DoubleClick=t},i.prototype.OnInvalidInput=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.InvalidInput=t},i.prototype.OnKeyDown=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.KeyDown=t},i.prototype.OnKeyPress=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.KeyPress=t},i.prototype.OnKeyUp=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.KeyUp=t},i.prototype.OnTextChanged=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.TextChanged=t},i.prototype.Click=function(){var i=this._specialClientEvents.Click,t={};n.Utility.FireEvent(this,i,t)},i.prototype.DoubleClick=function(){var t=this._uIProcess.DoubleClick(this.GetInputElement(),this.SelectionStart,this.GetText()),r,i;return t.SelectionStart!=null&&(this.SelectionStart=t.SelectionStart),t.SelectionEnd!=null&&(this.SelectionEnd=t.SelectionEnd),t.SetSelection==!0&&this.SetSelection(this.SelectionStart,this.SelectionEnd),r=this._specialClientEvents.DoubleClick,i={},n.Utility.FireEvent(this,r,i),!0},i.prototype._isSupportClipBoard=function(){return this._control._isSupportClipBoard()},i.prototype.GetUseClipboard=function(){return this._control.GetUseClipboard()},i.prototype.KeyDown=function(t){var u=t.keyCode,e={},y,r,o,l,h,a,c,f,s,p,v;e.Shift=!1,e.Ctrl=!1,e.Alt=!1,t.shiftKey&&(e.Shift=!0),t.ctrlKey&&(e.Ctrl=!0),t.altKey&&(e.Alt=!0),(n.Utility.IsPad()||n.Utility.IsTouchMouseDown===!0)&&u==n.Key.Return&&(e.Ctrl=!0);if(this._contextMenu.IsShow())return(u==n.Key.Up||u==n.Key.Down||u==n.Key.Return||u==n.Key.T||u==n.Key.C||u==n.Key.P||u==n.Key.D||u==n.Key.U||u==n.Key.A)&&this._contextMenu.KeyDown(t),(u==n.Key.Escape||u==n.Key.Alt)&&this._contextMenu.Close(),u==n.Key.Up||u==n.Key.Down||u==n.Key.PageUp||u==n.Key.PageDown?(f={},f.KeyCode=n.Key.Left,f):!1;if(this._touchToolBar.IsShow())return(u==n.Key.Escape||u==n.Key.Alt)&&this._touchToolBar.Close(),!1;if((u!=229||this._isJapanConvertKeyPress)&&(u!=n.Key.Return||this.GetText()==this.Text))this._imeMode&&(y=e.Shift||e.Ctrl||u==20||u>=112&&u<=123,y||(this.ImeInput("ReInput",!0,t),this._imeSelectTimes=0,this._imeMode=!1)),u==229&&this._isJapanConvertKeyPress&&(this._isJapanConvertKeyPress=!1);else return n.Utility.IsIE8OrBelow&&(this._imeMode=!0),!0;r={},e.Shift&&(u|=65536),e.Ctrl&&(u|=131072),e.Alt&&(u|=262144),o="",l=null,u==n.Key.Return&&this._control._multiLine&&this._control._acceptReturn||(h=this._control._getShortcutObj(),h!==null&&h.GetBlockKeyMessage()&&(a=h._data.GetKeyActionsByEvent(this._control,t),o=a.KeyAction,l=a.ClientFunction,h._uiProcess.ProcessTriggerAll(this._control,t))),e.Alt&&u===n.Key.Down&&(o=n.KeyActions.DropDown),l!=null&&(n.Utility.FireEvent(this,l,{},""),o===null&&n.Utility.PreventDefault(t));if(o==n.KeyActions.DropDown||u==262182||u==262184||u==n.Key.Escape)return this.Close(!1,!0,!1),!1;9557)&&(r<96||r>105)?r==n.Key.Space?this._imeSelect==!1&&(this._imeSelectTimes==1?this._imeSelect=!0:p.ToHalfWidth(u)!=String.fromCharCode(r)?this._imeSelectTimes++:this._hasValidatedImeInput&&(this._uIProcess.inputJap=!0,n.Utility.IsIE&&(this._hasValidatedImeInput=!1),this.ImeInput("DirectInput",undefined,t),this._imeSelectTimes=0)):r<65||r>90?r!=n.Key.Space&&r!=n.Key.Multiply&&r!=n.Key.Add&&r!=n.Key.Subtract&&r!=n.Key.Decimal&&r!=n.Key.Divide&&r!=219&&r!=220&&r!=221&&r!=222&&(r<186||r>192)&&r!=226?r==n.Key.Down||r==n.Key.Up?this._imeSelect==!1&&this._imeSelectTimes==1&&(this._imeSelect=!0):r==n.Key.BackSpace||r==n.Key.Delete?this._imeSelectTimes=0:r==n.Key.Escape?this._imeSelectTimes=0:r==244?this._isJapanConvertKeyPress=!0:n.Utility.IsIE||r!=243?n.Utility.IsIE&&r==229&&(this._hasValidatedImeInput=!1):(this.ImeInput("ReInput",!0,t),this._imeSelectTimes=0,this._imeMode=!1):(this._imeSelectTimes<1||this.ImeInput("ReInput",undefined,t),this._imeSelectTimes=0,n.Utility.IsIE&&(this._hasValidatedImeInput=!1)):(this._imeSelectTimes=0,this._hasValidatedImeInput=!1):(r<96||(r=r-48),u=p.ToHalfWidth(u),u==String.fromCharCode(r)||this._imeSelect?u==String.fromCharCode(r)&&this._imeSelectTimes<1?this._hasValidatedImeInput=!1:this._imeSelect||(this.ImeInput("ReInput",undefined,t),this._hasValidatedImeInput=!1,this._imeMode=!0):this._hasValidatedImeInput=!1,this._imeSelectTimes=0));if(this._uIProcess.keyupResponse==!0){this._uIProcess.keyupResponse=!1;var f=this._uIProcess.KeyUp(this.GetInputElement(),i.MultiLine,this.SelectionStart,this.SelectionEnd,this.GetText()),d=this.SelectionStart,a=this.SelectionEnd,l=!1,b=!1;f.SelectionStart!=null&&this.SelectionStart!=f.SelectionStart&&(this.SelectionStart=f.SelectionStart,l=!0),f.SelectionEnd!=null&&this.SelectionEnd!=f.SelectionEnd&&(this.SelectionEnd=f.SelectionEnd,b=!0),o=this.GetText(),this._passwordMode&&(k=this._uIUpdate.GetText(),e=this.Text,this._realText=e,c=e.GetLength()-k.GetLength(),c!=0&&(l&&b?o=e.Substring(0,this.SelectionStart)+e.Substring(a,e.GetLength()):l||(a=this.SelectionStart+c,o=e.Substring(0,d)+e.Substring(a,e.GetLength())),this._realText=o)),f.SystemEdit==!0&&(this.Text=o,this._realText=o,this._uIUpdate.SetHideText(o)),f.Text!=null&&this.InternalSetText(f.Text),f.SetSelection==!0&&this.SetSelection(this.SelectionStart,this.SelectionEnd)}y=this._specialClientEvents.KeyUp,v={},v.key=t.keyCode,n.Utility.FireEvent(this,y,v),r==n.Key.Return&&this._control._multiLine&&this._control._acceptReturn||(s=this._control._getShortcutObj(),s!==null&&(s.GetBlockKeyMessage()||(s._uiProcess.ProcessGcTextBoxAction(this._control,t),s._uiProcess.ProcessTriggerAll(this._control,t))))},i.prototype._CheckScrollBar=function(t,i){this._inputElement.style.webkitOverflowScrolling!==undefined&&(this._inputElement.style.webkitOverflowScrolling="touch");switch(t){case n.ScrollBars.Both:i==n.ScrollBarMode.Automatic?(this._inputElement.style.overflowX="auto",this._inputElement.style.overflowY="auto"):(this._inputElement.style.overflowX=this._control._wordWrap?"auto":"scroll",this._inputElement.style.overflowY="scroll");break;case n.ScrollBars.None:this._inputElement.style.overflowX="hidden",this._inputElement.style.overflowY="hidden",this._inputElement.style.webkitOverflowScrolling!==undefined&&(this._inputElement.style.webkitOverflowScrolling="auto");break;case n.ScrollBars.Vertical:i==n.ScrollBarMode.Automatic?(this._inputElement.style.overflowX="hidden",this._inputElement.style.overflowY="auto"):(this._inputElement.style.overflowX="hidden",this._inputElement.style.overflowY="scroll");break;case n.ScrollBars.Horizontal:this._inputElement.style.overflowY="hidden",this._inputElement.style.overflowX=i==n.ScrollBarMode.Automatic?"auto":this._control._wordWrap?"auto":"scroll";break}},i.prototype.SetAutoConvert=function(n){this._autoConvert=n,this._uIProcess.ResetFilter()},i.prototype._setEditModeInternal=function(n){this._editMode=n},i.prototype.GetRealText=function(){var n=this._realText;return!this._control.GetMultiLine()&&n&&(n=n.replace(/[\r\n]/g,"")),n},i.prototype.InternalSetText=function(n){var r=this._uIProcess.FormatCheck(n,i.AcceptTab,i.AcceptReturn),t=r;this._maxLength!=0&&(t=this._uIProcess.MaxLengthCheck(r,this._maxLength,i.LengthAsByte)),i.MaxLineCount!=0&&i.MultiLine&&(t=this._uIProcess.MaxLineCheck("","",t,i.MaxLineCount,i.CountWrappedLine)),this.DirectSetText(t)},i.prototype.DirectSetText=function(n,t){this._systemChange=!1;var r=n;this._passwordMode&&(r=this._uIProcess.GetPasswordText(n,this._passwordChar,i.MultiLine)),t||this._uIUpdate.SetText(r),this._uIUpdate.SetHideText(n),this.Text!=n&&(this.Text=n),this._passwordMode||this.Text==this._uIUpdate.GetText()||this._imeMode||this._uIUpdate.GetText()&&(this.Text=this._uIUpdate.GetText()),this._realText=this.Text},i.prototype.SetInnerText=function(n){this.SelectionStart=0,this.SelectionEnd=0,this.InternalSetText(n)},i.prototype.GetDisPlayText=function(n){var t=n;return this._passwordMode&&(t=this._uIProcess.GetPasswordText(n,this._passwordChar,i.MultiLine)),t},i.prototype.GetOverwrite=function(){return this._overwrite},i.prototype.SetOverwrite=function(n){this._overwrite=n},i.prototype.GetOldValue=function(){return this._oldText},i.prototype.GetValue=function(){return this.GetText()},i.prototype._DoSetSelection=function(t,i,r){n.Utility.SetSelection(this,t,i,!0)},i.prototype.SetInnerSelection=function(n,t){this.SelectionStart=n,this.SelectionEnd=t},i.prototype.SetInternalSelectionStart=function(n){this.SelectionStart=n},i.prototype.SetInternalSelectionEnd=function(n){this.SelectionEnd=n},i.prototype.Select=function(){if(this._imeMode)return;this.SelectionStart=n.Utility.GetSelectionStartPosition(this.GetInputElement()),this.SelectionEnd=this.SelectionStart+this._uIProcess._getSelectionTextLength(this._control.GetMultiLine())},i.prototype.SelectStart=function(n){if(this._imeMode)return!1;if(this._isLeftMouseButtonPressed){var t=this._uIProcess.SelectStart(this.GetInputElement(),n,i.MultiLine);t.SelectionStart!=null&&(this.SelectionStart=t.SelectionStart),t.SelectionEnd!=null&&(this.SelectionEnd=t.SelectionEnd)}},i.prototype.SetInnerSelectionStart=function(n){this.SelectionStart=n;var t=this._control;t.DropDownEditData.SelectionStart=n,t.SetLastClientValues()},i.prototype.SetInnerSelectionEnd=function(n){this.SelectionEnd=n;var t=this._control;t.DropDownEditData.SelectionEnd=n,t.SetLastClientValues()},i.prototype.Focus=function(t){this._oldTextValue=this.GetText();if(n.Utility.LoadComplete==!1)return;var r=this._uIProcess.Focus(this._focusType,this.GetInputElement(),this.GetText(),i.MultiLine,i.HighlightText,this._contextMenu.IsShow());if(r==null)return;r.SelectionStart!=null&&(this.SelectionStart=r.SelectionStart),r.SelectionEnd!=null&&(this.SelectionEnd=r.SelectionEnd),this._uIProcess.japInput==!0?(this._truePosition!=-1&&(this.SelectionStart=this._truePosition,this.SelectionEnd=this._truePosition),this._uIProcess.japInput=!1):this._focusType!=n.FocusType.ContextMenu&&this._focusType!=n.FocusType.None&&this._focusType!=n.FocusType.ClientEvent&&this._focusType!=n.FocusType.DragDrop&&(this._oldText=this.GetText(),this._oldSelectionStart=this.SelectionStart,this._oldSelectionEnd=this.SelectionEnd,this._lastSelectionStart=this._oldSelectionStart,this._lastSelectionEnd=this._oldSelectionEnd),r.SetSelection==!0&&this.SetSelection(this.SelectionStart,this.SelectionEnd),this._dropEdit&&(this._dropEdit=!1),this.FocusExit&&(this._uIProcess.MoveControl(this._getId(),!0),this.FocusExit=!1)},i.prototype.SetInnerFocus=function(t){this._focusType=t!=null?t:n.FocusType.ClientEvent,this.SetFocus(),this.SetSelection(this.SelectionStart,this.SelectionEnd)},i.prototype.LoseFocus=function(t){var u=this,r;this._contextMenu.IsShow()&&this._contextMenu.Close(),this._touchToolBar.IsShow()&&this._touchToolBar.Close(),n.Utility.IsIE?this._imeMode?(this.ImeInput("LoseFocusInput",undefined,t),this._imeSelectTimes=0):this.Text!=this.GetText()&&this.InternalSetText(this.Text):this._imeMode&&this.ImeInput("ReInput",!0,t),this._focusType=n.FocusType.None,n.Utility.IsIE||this.GetDisPlayText(this.Text)==this._uIUpdate.GetText()||(r=this.Text,i.MultiLine?(r=r.replace(/\r/g,"\\r"),r=r.replace(/\n/g,"\\n")):(r=r.replace(/\r\n/g,""),r=r.replace(/\r/g,""),r=r.replace(/\n/g,"")),setTimeout(function(){u.InternalSetText(r)},0)),this._isShown&&((!n.Utility.IsIE||n.Utility.IsActiveElement(this._control.GetInputElement().id).IsActive)&&(n.Utility.IsIE||this._control.IsActive)?this.Close(!1,!1,!1):(this._control._focusType=n.FocusType.None,this._control._isFocusToDropDownEdit||(this._control.LoseFocus(t),this._control._focused=!1),n.Utility.IsOnFocus=!1,this.Close(!0,!1,!1))),this._control.SetLastClientValues()},i.prototype.PropertyChange=function(t){var r,u;return this._dragEdit?(this._dragEdit=!1,this._systemChange=!0,this.SetSelectionLength(0),this._uIUpdate.SetHideText(this.GetText())):this._dropEdit?(this._dropEdit=!1,this._focusType=n.FocusType.DragDrop,this._oldText=this.Text,this._lastText=this._oldText,this._systemChange=!0,this.SelectionStart=n.Utility.GetSelectionStartPosition(this.GetInputElement()),this.SelectionEnd=this.SelectionStart+this._uIProcess._getSelectionTextLength(this._control.GetMultiLine()),r=this.GetText(),this._passwordMode&&(u=this.SelectionEnd-this._dropText.GetLength(),r=this.Text.Substring(0,u)+this._dropText+this.Text.Substring(u,this.Text.GetLength()),this._realText=r),this.Text=r,this._uIUpdate.SetHideText(r)):!i.MultiLine,!1},i.prototype.MouseMove=function(t){var c,e,r,i,u,o,f,h,s;if(!this.GetAllowResize())return;if(this._resizeMoving){n.Utility.IsIE||n.Utility.ClearSelection(this.GetInputElement()),c=t.screenX-this._positionX,e=t.screenY-this._positionY,this.VAlign==="up"&&(e=-e),r=this._startWidth+c,i=this._startHeight+e,r=Math.max(8,r),i=Math.max(8,i),u=this.GetInputElement().parentElement,o=u.children[0].style,o.width=r+"px",o.height=i+"px",f=i-this._getHeightDirectly(),isNaN(f)&&(f=0),this._setWidthDirectly(r),this._setHeightDirectly(i),this.VAlign==="up"&&(h=n.Utility.GetCSSLength(u.style.top),u.style.top=h-f+"px"),this._isSizeChanged=!0;try{s=this._control._dropDown.OpeningAnimation;if(s!=n.DropDownAnimation.None){var v=this.GetInputElement(),a=r+100+"px",l=i+100+"px";v.style.clip="rect(0px "+a+" "+l+" 0px)"}}catch(y){}}},i.prototype.MouseDown=function(t){var f=this,r,e,u,i;if(n.Utility.IsTouchMouseDown==!0)if((this._getInnerShowTouchToolBarValue()&n.TouchToolBarDisplayOptions.TapSelection)!=0&&this._touchToolBar!=null)if(n.Utility.IsClickInSelection(t)){n.Utility.PreventDefault(t);return}r=n.Utility.GetMouseButton(t),!n.Utility.IsIE&&this._imeMode&&r==n.MouseButton.Left&&(this._isImplementImeInput=!0),this._mouseButton=r,this._beforeDragSelectionStart=this.SelectionStart,this._beforeDragSelectionEnd=this.SelectionEnd;if(this._mouseButton==n.MouseButton.Right)this._focusType=n.FocusType.Click;else{e=t.srcElement||t.target;if(e.id===this._getId()+"_ResizeGrip")if(!t.altKey&&!t.shiftKey){this._positionX=t.screenX,this._positionY=t.screenY,this._startWidth=parseInt(this.GetInputElement().style.width,10),this._startHeight=parseInt(this.GetInputElement().style.height,10),this._resizeMoving=!0,n.Utility.IsIE||(this._startCursorPositionBeforeMoving=this.SelectionStart,this._endCursorPositionBeforeMoving=this.SelectionEnd),this.Resizing=function(n){f.MouseMove(n)},this.LoseCapture=function(n){f.MouseUp(n)},this.GetInputElement().setCapture&&this.GetInputElement().setCapture(),n.Utility.AttachEvent(document,"mousemove",this.Resizing,!1),n.Utility.AttachEvent(document,"mouseup",this.LoseCapture,!1);return}this._isLeftMouseButtonPressed=!0,this._focusType=n.FocusType.Click,this._contextMenu.IsShow()&&this._contextMenu.Close(),this._touchToolBar.IsShow()&&this._touchToolBar.Close();try{u=this._uIProcess._getSelectionTextLength(this._control.GetMultiLine()),u!=0&&n.Utility.ClearSelection(this.GetInputElement())}catch(o){}}i=this._uIProcess.MouseDown(this.GetInputElement(),r);if(i==null)return;i.SelectionStart!=null&&(this.SelectionStart=i.SelectionStart),i.SelectionEnd!=null&&(this.SelectionEnd=i.SelectionEnd)},i.prototype.MouseUp=function(t){var o=this,e=t,s=n.Utility.GetMouseButton(t),r,f,u;if(this._resizeMoving){this._resizeMoving=!1,n.Utility.IsIE||this.SetSelection(this._startCursorPositionBeforeMoving,this._endCursorPositionBeforeMoving),this.GetInputElement().releaseCapture&&this.GetInputElement().releaseCapture(),n.Utility.IsIE?(document.detachEvent("onmousemove",this.Resizing),document.detachEvent("onmouseup",this.LoseCapture)):(document.removeEventListener("mousemove",this.Resizing,!0),document.removeEventListener("mouseup",this.LoseCapture,!0));return}if(n.Utility.IsIE&&(this._imeMode||this.Text!=this.GetText()))this._imeMode?(this.ImeInput("ClickInput",undefined,t),this._imeSelectTimes=0):this.InternalSetText(this.Text);else if(!n.Utility.IsIE&&(this._imeMode||this.GetDisPlayText(this.Text)!=this._uIUpdate.GetText())){if(!this._isImplementImeInput)return;this.ImeInput("ClickInput",undefined,t),this._imeSelectTimes=0,this.GetDisPlayText(this.Text)!=this._uIUpdate.GetText()&&(this._isImplementImeInput=!1,r=this.Text,i.MultiLine?(r=r.replace(/\r/g,"\\r"),r=r.replace(/\n/g,"\\n")):(r=r.replace(/\r\n/g,""),r=r.replace(/\r/g,""),r=r.replace(/\n/g,"")),setTimeout(function(){o.SetText(r)},0)),this.Select()}else{this._isLeftMouseButtonPressed=!1,f=null,e!=null&&e.Ctrl!=null&&(f=e.Ctrl),u=this._uIProcess.MouseUp(this.GetInputElement(),this.SelectionStart,this.SelectionEnd,this._mouseButton,i.MultiLine,this.GetText(),f,i.HighlightText,t);if(u==null)return;u.SelectionStart!=null&&(this.SelectionStart=u.SelectionStart),u.SelectionEnd!=null&&(this.SelectionEnd=u.SelectionEnd),u.SetSelection==!0&&this.SetSelection(this.SelectionStart,this.SelectionEnd)}this._mouseButton=n.MouseButton.Left},i.prototype.MouseOut=function(){if(!this._focused)return;if(this._isMouseDown!=!0)return;if(this._mouseUpPointerType!=undefined&&this._mouseUpPointerType!==4&&this._mouseUpPointerType!=="mouse")return;var r=Math.min(this._beforeDragSelectionStart,this._beforeDragSelectionEnd),i=Math.max(this._beforeDragSelectionStart,this._beforeDragSelectionEnd),t=this.GetText().Substring(r,i);t==""||this._resizeMoving||(this.SetSelection(this._beforeDragSelectionStart,this._beforeDragSelectionEnd),n.Utility.DragDrop(this.GetInputElement())),this._isMouseDown=!1},i.prototype.MouseLeave=function(){},i.prototype.ShouldCancelMouseWheelDefaultBehavior=function(){return!1},i.prototype.MouseWheel=function(){},i.prototype.IsDragStart=function(t,i,r){var u={},o,e,f,s;u.IsDragStart=!1,o=1,n.Utility.IsStandCompliantModeOn()&&n.Utility.IsIE7&&(t.style.position.toLowerCase()=="absolute"||t.style.position.toLowerCase()=="relative")&&(o=n.Utility.GetPageZoomRate()),e=i+(document.body.scrollLeft||document.documentElement.scrollLeft),f=r+(document.body.scrollTop||document.documentElement.scrollTop),e/=o,f/=o;var y=t.offsetWidth,p=t.offsetHeight,l=20;(this.Left==null||this.Top==null)&&(s=this._control._getDropDownPos(this._getRealCSSWidth(),this._getRealCSSHeight(),this.Align),this.Left=s.Left,this.Top=s.Top);var c=this.Left+y,h=this.Top+p,v=c-l,a=h-l;return u.PositionX=e,u.PositionY=f,ec||fh?u:(u.IsDragStart=!0,u)},i.prototype.DragStart=function(){this._passwordMode?event.dataTransfer.effectAllowed="none":this._dragEdit=!0},i.prototype.DragEnd=function(n){t.prototype.DragEnd.call(this,n),this._dragEdit=!1},i.prototype.DragDrop=function(){var u=event.dataTransfer.getData("Text"),n=this._uIProcess.DragDrop(u,i.ExitOnLastChar,this.SelectionStart,this.SelectionEnd,this._maxLength,i.LengthAsByte,i.MaxLineCount,i.CountWrappedLine,i.MultiLine,this.GetText()),r,t;if(n==null)return;n.DropText!=null&&(this._passwordMode?(r=this._uIProcess.GetPasswordText(n.DropText,this._passwordChar,i.MultiLine),event.dataTransfer.setData("Text",r),this._dropText=n.DropText):event.dataTransfer.setData("Text",n.DropText),this._dropEdit=!0);if(n.EventInfo!=null)for(t=0;t=53))return;this._imeMode=!0,this._hasValidatedImeInput=!1;try{this.ImeInput("DirectInput",undefined,t)}finally{this._imeMode=!1}},i.prototype.GetHideElement=function(){return null},i.prototype.GetBorderContainer=function(){return this._getContainer()},i.prototype._getControlContainer=function(){return this._getContainer()},i.prototype.GetInputElement=function(){return this._inputElement},i.prototype._addBorderStatus=function(n){},i.prototype._removeBorderStatus=function(n){},i.prototype._getInnerShowTouchToolBarValue=function(){return this._control._getInnerShowTouchToolBarValue()},i.prototype.GetTouchContextMenuScale=function(){return this._control.GetTouchContextMenuScale()},i.MaxLineCount=0,i.CountWrappedLine=!1,i.AcceptTab=!1,i.MultiLine=!0,i.AcceptReturn=!1,i.LengthAsByte=!1,i.ExitOnLastChar=!1,i.ExitOnLeftRightKey=n.ExitOnLeftRightKey.None,i.HighlightText=!1,i}(n.BaseControl);n.DropDownEditControl=t})(GCIM||(GCIM={}));var __extends=this&&this.__extends||function(n,t){function r(){this.constructor=n}for(var i in t)t.hasOwnProperty(i)&&(n[i]=t[i]);n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)},GCIM;(function(n){var t=function(){function n(){}return n.None="none",n.EllipsisEnd="ellipsisend",n.EllipsisPath="ellipsispath",n}(),r,i,u;n.EllipsisMode=t,r=function(){function n(){}return n.Append="append",n.Replace="replace",n}(),n.OutputMode=r,i=function(){function n(){}return n.KatakanaHalf="katakanahalf",n.Katakana="katakana",n.Hiragana="hiragana",n}(),n.KanaMode=i,u=function(u){function f(n,t){this._dataFromServer=arguments[2];var i=n.tagName.toLowerCase();if(i!="input"&&i!="textarea")throw"container element must be an input element";this._multiLine=i==="textarea",u.call(this,n,t,!0)}return __extends(f,u),f.prototype._getComponentType=function(){return n.IMControlType.Edit},f.prototype._beginInit=function(){var f,s,h,e,o;u.prototype._beginInit.call(this),this._isFocusWithIn=!1,this._focusFinished=!0,this._previousText="",this._dropDown=new n.DropDown(this),this._spin=new n.Spin(this),this._dataFromServer&&this._dataFromServer.DropDown&&this._dataFromServer.DropDown.Visible!==undefined&&(this._dropDown.Visible=this._dataFromServer.DropDown.Visible),this._addressObj=null,this._scrollBarMode=n.ScrollBarMode.Fixed,this._keyActionList=null,this._useSystemPasswordChar=!1,this._overwrite=!1,this._format="",this._showHistory=!1,this._autoConvert=!0,this._lengthAsByte=!1,this._maxLength=0,this._maxHistoryCount=10,this._acceptsCrLf=n.CrLfMode.NoControl,this._acceptReturn=!0,this._acceptTab=!1,this._highlightText=!1,this._ellipsis=t.None,this._ellipsisString="...",this._exitOnLastChar=!1,this._hasPasswordOnFocus=!1,this.PasswordMode=!1,this._passwordChar="",this._overflowTip=!1,this._maxLineCount=0,this._countWrappedLine=!1,this._isInUpdatePanelAndAsyncPostBack=!1,this._useClipboard=!0,this._readingImeStringOutput={},this._readingImeStringOutput.OutputMode=r.Append,this._readingImeStringOutput.KanaMode=i.KatakanaHalf,this._readingImeStringOutput.TargetControl=null,this._ellipsis=t.None,this._scrollBars=n.ScrollBars.None,this._prevval="",this._rubyText="",this._readingStringForEvent="",f=this,s=f!=null,this._isInUpdatePanelAndAsyncPostBack?s&&(this._oldText=f._oldText,this._dropDown.AutoDropDown&&(this._focusType=f._focusType)):this._oldText=this.Text,this._lastStart=this.SelectionStart,this._lastEnd=this.SelectionEnd,this._lastText="",this._buffText="",this._isUndoAfterDel=!1,this._mouseButton=n.MouseButton.Left,this._isLeftMouseButtonPressed=!1,this._imeSelect=!1,this._imeSelectTimes=0,this.DragEdit=!1,this.DropEdit=!1,this._isFuncKeyPressed=!1,this._systemChange=!0,this._imeMode=!1,this._focusExit=!1,this._truePosition=-1,this._lastInputText="",this._beforeDragSelectionStart=0,this._beforeDragSelectionEnd=0,this._isMouseDownWhenSelectMultiText=!1,h="o"+this._getId()+"IMControl.ContextMenu",this._contextMenu=new n.ContextMenu(h,this,this.PasswordMode),this.Text!=null&&this.Text!=""&&(this.PasswordMode||this._multiLine||!this._enableAutoComplete||this._isInUpdatePanelAndAsyncPostBack||(this._autoCompleteType!="None"?this.SetCookie(this._autoCompleteType,this.Text):this.SetCookie(this._getId(),this.Text))),this._toolTip=null,e={SelectionStart:this.SelectionStart,SelectionEnd:this.SelectionEnd,Text:this.Text,OldSelectionStart:this._oldSelectionStart,OldSelectionEnd:this._oldSelectionEnd,OldText:this._oldText,LastStart:this._lastStart,LastEnd:this._lastEnd,LastText:this._lastText,BuffText:this._buffText,LastSelectionStart:undefined,LastSelectionEnd:undefined},this.DropDownEditData=e,this._isChangedByDropDownEdit=!1,this.DropText="",this._isTextEllipsis=!1,this._textHeadLength=0,this._isJapanConvertKeyPress=!1,n.Utility.IsIE||(this.IsActive=!1),this._hasValidatedImeInput=!0,this._isFocusToDropDownEdit=!1,this._isCausedByClickingDropDownBt=!1,this._isCausedByImplementingDrop=!1,n.Utility.IsIE||(this._maxLineCount=0,this._ellipsis=t.None,this._isImplementImeInput=!1),o=document.getElementById(this._getId()+"_Button"),n.Utility.DisabledHoldVisual(o),this.Text="",this._isPasting=!1,this._wordWrap=!0,this._autoCompleteType="None",this._isFromServer=!1,this._historyList=[],this._lines=[],this._tempIMEMode=n.ImeMode.Auto,this._lastPassWordChar="",this._shouldShowClearButton=!0,this._switchPasswordChar=!1},f.prototype._createUIProcess=function(){this._uIProcess=new n.GcTextBoxUIProcess(this._autoConvert,this._format,this,this)},f.prototype._createUIRender=function(){this._render=new n.TextBoxRender(this)},f.prototype._renderHtmlElement=function(){this.Create()},f.prototype._endInit=function(){this._uIProcess.ID=this._getId(),this._uIProcess._gcTextBoxOwner=this,this.SetImeMode(n.ImeMode.Auto),this._autoComplete=new n.AutoComplete(this),this._enableAutoComplete=this._isFromServer?this._showHistory&&this._autoCompleteType!="Disabled"&&!this._readOnly&&this.GetEnabled():this._showHistory&&!this._readOnly&&this.GetEnabled(),u.prototype._endInit.call(this)},f.prototype._saveOldControlData=function(t){var i=u.prototype._saveOldControlData.call(this,t);return t!=null&&t._focusType!==n.FocusType.None&&(i.FocusType=t._focusType),i},f.prototype._loadOldControlData=function(n){if(n==null)return;u.prototype._loadOldControlData.call(this,n),n.FocusType!=null&&(this._focusType=n.FocusType)},f.prototype._updateLayout=function(){this._render._updateBorder(),this._render._layout()},f.prototype._registInputElemnetEvent=function(){var t=this,i;if(this.GetInputElement()==null)return;u.prototype._registInputElemnetEvent.call(this),i=this.GetInputElement(),n.Utility.AttachEvent(i,"mouseover",function(i){n.GlobalEventHandler.OnMouseOver(t,i)},!1),n.Utility.AttachEvent(i,"dragenter",function(i){n.GlobalEventHandler.OnDragEnter(t,i)},!1),n.Utility.AttachEvent(i,"dragleave",function(i){n.GlobalEventHandler.OnDragLeave(t,i)},!1),n.Utility.IsIE11OrLater?i.addEventListener("textinput",function(i){n.GlobalEventHandler.OnPropertyChanged(t,i)},!1):n.Utility.IsIE&&!n.Utility.IsIE11OrLater?i.attachEvent("onpropertychange",function(i){n.GlobalEventHandler.OnPropertyChanged(t,i)}):i.addEventListener("keyup",function(i){n.GlobalEventHandler.OnPropertyChanged(t,i),t.CheckPropertyChange(t.GetDisplayText2())}),n.Utility.IsIE10OrLater&&(n.Utility.AttachEvent(i,n.PointerEvents.GetPointerUpName(),function(i){n.GlobalEventHandler.OnMSPointerUp(t,i)}),n.Utility.AttachEvent(i,"MSHoldVisual",function(i){n.GlobalEventHandler.OnMSHoldVisual(t,i)})),n.Utility.AttachEvent(i,"blur",function(i){n.GlobalEventHandler.OnEditFieldLoseFocus(t,i)},!1),n.Utility.AttachEvent(i,"focusout",function(i){n.GlobalEventHandler.OnFocusOut(t,i)},!1),n.Utility.AttachEvent(i,"focus",function(i){n.GlobalEventHandler.OnEditFieldFocus(t,i)},!1),n.Utility.AttachEvent(i,"activate",function(i){n.GlobalEventHandler.OnActivate(t,i)},!1),n.Utility.AttachEvent(i,"deactivate",function(i){n.GlobalEventHandler.OnDeActivate(t,i)},!1)},f.prototype._getDefaultSize=function(){return this.GetMultiLine()?{Width:f.DefaultMultiLineWidth,Height:f.DefaultMultiLineHeight}:u.prototype._getDefaultSize.call(this)},f.prototype.Create=function(){this._render.Render()},f.prototype.IsNeedFishEyeButton=function(){return n.Utility.IsIE10OrLater&&!this._multiLine&&this.PasswordMode&&this.IsCSSAllowFishEyeButton()},f.prototype.IsCSSAllowFishEyeButton=function(){for(var r,t,n,i=0;ithis.FishEyeButton.offsetWidth||t.offsetY<0||t.offsetY>this.FishEyeButton.offsetHeight)&&(this.FishEyeButtonHover=!1),this.UpdateFishEyeButtonAppearanceState(),this.FishEyeButton.releaseCapture&&this.FishEyeButton.releaseCapture(),this._uIUpdate.SetText(this._uIProcess.GetPasswordText(this.Text,this._passwordChar,this._multiLine))},f.prototype.OnFishEyeButtonMouseOver=function(n){this.FishEyeButtonHover=!0,this.UpdateFishEyeButtonAppearanceState()},f.prototype.OnFishEyeButtonMouseOut=function(t){n.Utility.PreventDefault(t),this.FishEyeButtonHover=!1,this.UpdateFishEyeButtonAppearanceState()},f.prototype.ShowFishEyeButton=function(){var t=this;if(this.IsNeedFishEyeButton()&&this.IsCSSAllowFishEyeButton()){if(this.FishEyeButton==null){this.FishEyeButton=n.Utility.CreateFishEyeButton(this.GetInputElement(),this.GetInputElement()==this.GetBorderContainer());if(this.FishEyeButton==null)return;n.Utility.AttachEvent(this.FishEyeButton,"mousedown",function(n){t.OnFishEyeButtonDown(n)}),n.Utility.AttachEvent(this.FishEyeButton,"mouseup",function(n){t.OnFishEyeButtonUp(n)}),n.Utility.AttachEvent(this.FishEyeButton,"mouseover",function(n){t.OnFishEyeButtonMouseOver(n)}),n.Utility.AttachEvent(this.FishEyeButton,"mouseout",function(n){t.FishEyeButtonPressed&&t.OnFishEyeButtonUp(n),t.OnFishEyeButtonMouseOut(n)}),this._oldSetText=this._uIUpdate.SetText,this._uIUpdate.SetText=function(n){t.OnFishEyeSetText(n)}}this.HideClearButton(),this.GetInputElement().parentElement.contains(this.FishEyeButton)||this.GetInputElement().parentElement.appendChild(this.FishEyeButton),this.UpdateFishEyeButtonPosition(),this.UpdateFishEyeButtonAppearanceState()}},f.prototype.UpdateFishEyeButtonPosition=function(){var t=this.GetInputElement(),u=this.FishEyeButton,r=t.currentStyle||window.getComputedStyle(t,null),f=parseInt(r.width,10)+parseInt(r.paddingLeft,10)+parseInt(r.paddingRight,10),i=parseInt(r.height,10),l=parseInt(r.paddingLeft,10),a=parseInt(r.paddingRight,10),e;if(f-i+l+a0&&(this._hasPasswordOnFocus=!0),i||t!=null&&t.length>0?(this.ShouldShowFishEyeButton=!1,this.HideFishEyeButton(!0),this.HideClearButton()):(this.ShouldShowFishEyeButton=!0,this.HideClearButton())}else n.Utility.IsIE10OrLater&&!this.IsCSSAllowFishEyeButton()&&this.HideClearButton()},f.prototype.ProcessFishEyeButtonOnLostFocus=function(n){this.HideFishEyeButton(n),this.PasswordMode&&this._ClearUndo()},f.prototype.HandleClearButton=function(t){var i=this,u,r;n.Utility.IsIE10OrLater&&this.FocusedWhenMouseDown&&this.MouseDownOnClearButton&&(t.srcElement!=this.GetInputElement()||this._multiLine||(u=document.activeElement==t.srcElement,r=n.Utility.IsMouseDownOnClearButton(t),this.MouseUpHasValue&&u&&r&&!this.PasswordMode&&setTimeout(function(){var n=i.Text,t=i._oldText;i.Clear(),i._oldText=t,i._lastText=n,i.DropDownEditData.LastText=n},0)))},f.prototype.SetDropDownVisible=function(n){u.prototype.SetDropDownVisible.call(this,n),this._IsValueNull()||(this._directSetTextWithPassword(this.Text),this.DealEllipsis(this._multiLine,this._ellipsis,this._ellipsisString,this.GetInputElement())),this.ProcessFishEyeButtonOnLostFocus(!0),this._maxLineCount!==0&&this.InternalSetText(this.GetText()),this._ClearUndo()},f.prototype.GetAcceptsReturn=function(){return this._acceptReturn},f.prototype.SetAcceptsReturn=function(t){t=n.Utility.CheckBool(t),this._acceptReturn=t},f.prototype.GetAcceptsTab=function(){return this._acceptTab},f.prototype.SetAcceptsTab=function(t){t=n.Utility.CheckBool(t),this._acceptTab=t},f.prototype.GetAcceptsCrlf=function(){return this._acceptsCrLf},f.prototype.SetAcceptsCrlf=function(t){t=n.Utility.CheckEnum(n.CrLfMode,t),this._acceptsCrLf=t},f.prototype.GetAutoConvert=function(){return this._autoConvert},f.prototype.SetAutoConvert=function(t){t=n.Utility.CheckBool(t),this._autoConvert=t,this._uIProcess.ResetFilter(),this.GetDropDownEditor()._uIProcess.ResetFilter()},f.prototype._onBorderWidthChanged=function(n,t){u.prototype._onBorderWidthChanged.call(this,n,t),this._render._layout()},f.prototype._onControlEffectChanged=function(n,t){u.prototype._onControlEffectChanged.call(this,n,t),this._render._updateControlStatus(),this._updateDropDownEditStatus()},f.prototype._onBackColorChanged=function(n,t){u.prototype._onBackColorChanged.call(this,n,t),this._render._updateBorder()},f.prototype.GetCountWrappedLine=function(){return this._countWrappedLine},f.prototype.SetCountWrappedLine=function(i){i=n.Utility.CheckBool(i),this._countWrappedLine=i,this.InternalSetText(this.GetText()),this._ellipsis!==t.None&&this.DealEllipsis(this._multiLine,this._ellipsis,this._ellipsisString,this.GetInputElement())},f.prototype.GetDroppedDown=function(){return this.GetDropDownEditor()!=null?this.GetDropDownEditor()._isShown:!1},f.prototype.SetDroppedDown=function(t){return t=n.Utility.CheckBool(t),this._droppedDown=t,this.GetDropDownEditor()._isShown==t||t!=!0&&t!=!1?this:(t?this.Drop():this.GetDropDownEditor().Close(!0,!1,!1),this)},f.prototype.GetDropDownEditor=function(){return this._dropDownObj||(this._dropDownObj=new n.DropDownEditControl(this),this.InitDropDownObj()),this._dropDownObj},f.prototype.GetDropDownObj=function(){return this.GetDropDownEditor()},f.prototype.GetEditMode=function(){return this._editMode},f.prototype.SetEditMode=function(t){var i=t,r;i=n.Utility.CheckEnum(n.EditMode,i),this._overwrite=i===n.EditMode.Insert||i===n.EditMode.FixedInsert?!1:!0,i!==this._editMode&&(r=!1,this._isinsertGroup(i)&&this._isOverwriteGroup(this._editMode)?r=!0:this._isinsertGroup(this._editMode)&&this._isOverwriteGroup(i)&&(r=!0),this._isOverwriteGroup(i)&&(this._uIProcess.isOverWrite=!0),this._editMode=i,this._editModeInternal=i,r&&this._uIProcess.FireEvent(this,this._specialClientEvents.EditStatusChanged,null,"EditStatusChanged"))},f.prototype._setEditModeInternal=function(t){t=n.Utility.CheckEnum(n.EditMode,t),this._overwrite=t===n.EditMode.Insert||t===n.EditMode.FixedInsert?!1:!0,t!==this._editModeInternal&&(this._editModeInternal=t)},f.prototype.GetEllipsis=function(){return this._ellipsis},f.prototype.SetEllipsis=function(i){var r=i;r=n.Utility.CheckEnum(t,r),this._ellipsis=r,this._IsValueNull()||(this._directSetTextWithPassword(this.Text),this.DealEllipsis(this._multiLine,this._ellipsis,this._ellipsisString,this.GetInputElement()))},f.prototype.GetEllipsisString=function(){return this._ellipsisString},f.prototype.SetEllipsisString=function(t){t=n.Utility.CheckString(t),this._ellipsisString=t,this.DealEllipsis(this._multiLine,this._ellipsis,this._ellipsisString,this.GetInputElement())},f.prototype._onEnabledChanged=function(n,t){u.prototype._onEnabledChanged.call(this,n,t),this._enableAutoComplete=this._isFromServer?this._showHistory&&this._autoCompleteType!="Disabled"&&!this._readOnly&&t:this._showHistory&&!this._readOnly&&t},f.prototype.GetExitOnLastChar=function(){return this._exitOnLastChar},f.prototype.SetExitOnLastChar=function(t){t=n.Utility.CheckBool(t),this._exitOnLastChar=t},f.prototype._onFontSizeChanged=function(n,i){u.prototype._onFontSizeChanged.call(this,n,i),this._maxLineCount!==0&&this.InternalSetText(this.GetText()),this._ellipsis!==t.None&&this.DealEllipsis(this._multiLine,this._ellipsis,this._ellipsisString,this.GetInputElement())},f.prototype.GetFormat=function(){return this._format},f.prototype.SetFormat=function(i){i=n.Utility.CheckString(i),this._format=i,this._uIProcess.ResetFilter(),this.GetDropDownEditor()._uIProcess.ResetFilter();var r=this.InternalSetText(this.GetText(),undefined,undefined,!0);this.DropDownEditData.Text=r,this._ellipsis!==t.None&&this.DealEllipsis(this._multiLine,this._ellipsis,this._ellipsisString,this.GetInputElement()),this._ClearUndo()},f.prototype.GetHighlightText=function(){return this._highlightText},f.prototype.SetHighlightText=function(t){t=n.Utility.CheckBool(t),this._highlightText=t},f.prototype.GetHistoryList=function(){return this._historyList},f.prototype.SetHistoryList=function(n){var t,i;if(n===null)return;t=arguments[0]instanceof Array?arguments[0]:Array.prototype.slice.call(arguments);if(t.length===0||t.length===1&&t[0]==="")return;for(this._isFromServer=!1,this._historyList=[],i=0;i0&&(r+="\r\n"),r+=this._lines[t];else for(t=0;t0},f.prototype.SetPasswordChar=function(i){if(i!==""){i=n.Utility.CheckChar(i);if(this._passwordChar===this.SystemPasswordChar()&&this.GetUseSystemPasswordChar()){this._lastPassWordChar=i;return}this._lastPassWordChar=this._passwordChar,this._passwordChar=i,this.PasswordMode=!0,this.InternalSetText(this.GetText()),this._tempIMEMode=this.GetImeMode(),this.SetImeMode(n.ImeMode.Disabled)}else{this._useSystemPasswordChar===!1&&(this.PasswordMode=!1,this.SetText(this._uIUpdate.GetHideText()),this._tempIMEMode!==""&&this.SetImeMode(this._tempIMEMode));if(this._passwordChar===this.SystemPasswordChar()&&!this.GetUseSystemPasswordChar()&&this._lastPassWordChar!==""){this._passwordChar=n.Utility.CheckChar(this._lastPassWordChar),this.PasswordMode=!0,this.InternalSetText(this.GetText()),this._tempIMEMode=this.GetImeMode(),this.SetImeMode(n.ImeMode.Disabled),this._ellipsis!==t.None&&this.DealEllipsis(this._multiLine,this._ellipsis,this._ellipsisString,this.GetInputElement());return}this._passwordChar=i}this._switchPasswordChar=!0,this._ellipsis!==t.None&&this.DealEllipsis(this._multiLine,this._ellipsis,this._ellipsisString,this.GetInputElement())},f.prototype.GetReadingImeStringOutputMode=function(){return this._readingImeStringOutput.OutputMode},f.prototype.SetReadingImeStringOutputMode=function(t){t=n.Utility.CheckEnum(r,t),this._readingImeStringOutput.OutputMode=t},f.prototype.GetReadingImeStringKanaMode=function(){return this._readingImeStringOutput.KanaMode},f.prototype.SetReadingImeStringKanaMode=function(t){t=n.Utility.CheckEnum(i,t),this._readingImeStringOutput.KanaMode=t},f.prototype.GetReadingImeStringOutputTargetControl=function(){return this._readingImeStringOutput.TargetControl},f.prototype.SetReadingImeStringOutputTargetControl=function(t){var i=t;t=n.Utility.GetNakedDomElement(t);if(t===this._readingImeStringOutput.TargetControl)return;this._readingImeStringOutput.TargetControl=t!==null?t.id:i},f.prototype.SetReadOnly=function(n){return u.prototype.SetReadOnly.call(this,n),this._enableAutoComplete=this._isFromServer?this._showHistory&&this._autoCompleteType!="Disabled"&&!this._readOnly&&n:this._showHistory&&!this._readOnly&&n,this},f.prototype.GetScrollBarMode=function(){return this._scrollBarMode},f.prototype.SetScrollBarMode=function(t){t=n.Utility.CheckEnum(n.ScrollBarMode,t),this._scrollBarMode=t,this._CheckScrollBar(this.GetScrollBars(),t),this._ClearUndo()},f.prototype.GetScrollBars=function(){return this._scrollBars},f.prototype.SetScrollBars=function(t){var i=this;t=n.Utility.CheckEnum(n.ScrollBars,t),this._scrollBars=t,this._CheckScrollBar(t,this.GetScrollBarMode()),this._tempWidth=this.GetInputElement().style.width,this.GetInputElement().style.width=parseInt(this.GetInputElement().style.width,10)-5+"px",this._tempScrollBarsTimeTicket&&(window.clearTimeout(this._tempScrollBarsTimeTicket),this._tempScrollBarsTimeTicket=null),this._tempScrollBarsTimeTicket=setTimeout(function(){i.GetInputElement().style.width=i._tempWidth},10),this._ClearUndo()},f.prototype.GetSelectionStart=function(){return Math.min(this.SelectionStart,this.SelectionEnd)},f.prototype.SetSelectionStart=function(t){var u,i,r;t=n.Utility.CheckInt(t);if(t<0)throw"ArgumentOutOfRangeException";return t==null?this:(u=t.toString(),i=parseInt(u,10),n.Utility.FilterText("0123456789",u)==u&&(i>this.GetText().GetLength()?(this.SelectionStart=this.GetText().GetLength(),this.SelectionEnd=this.GetText().GetLength(),this._multiLine||(this.DropDownEditData.SelectionStart=this.DropDownEditData.Text.GetLength(),this.DropDownEditData.SelectionEnd=this.DropDownEditData.Text.GetLength())):(r=this.GetSelectionLength(),this.SelectionStart=i,this._multiLine||(this.DropDownEditData.SelectionStart=this.GetMultiPosition(this.DropDownEditData.Text,i)),+i+r>this.GetText().GetLength()?(this.SelectionEnd=this.GetText().GetLength(),this._multiLine||(this.DropDownEditData.SelectionEnd=this.DropDownEditData.Text.GetLength())):(this.SelectionEnd=+i+r,this._multiLine||(this.DropDownEditData.SelectionEnd=this.GetMultiPosition(this.DropDownEditData.Text,i+r))))),this)},f.prototype.GetSelectedText=function(){var i="",r=Math.min(this.SelectionStart,this.SelectionEnd),n=Math.max(this.SelectionStart,this.SelectionEnd),u=n-r,t;return u!=0&&(t=this._IsUseWatermarkText(!0),i=t.IsUseWatermarkText?t.WatermarkText.Substring(r,n):this.GetText().Substring(r,n)),i},f.prototype.SetSelectedText=function(i){var r,u,f;i=n.Utility.CheckString(i),this._oldText=this.GetText();var e=this.SelectionStart,o=this.SelectionEnd,s=this.GetText();return this._multiLine||(this.DropDownEditData.OldText=this.DropDownEditData.Text,e=this.DropDownEditData.SelectionStart,o=this.DropDownEditData.SelectionEnd,s=this.DropDownEditData.Text),r=this._uIProcess.Paste(e,o,s,this._exitOnLastChar,this._acceptTab,this._acceptReturn,this._maxLength,this._lengthAsByte,this._maxLineCount,this._countWrappedLine,this._multiLine,i,!0),r==null,r.Text!=null&&(this.DirectSetText(r.Text),this._multiLine||(this.DropDownEditData.Text=r.Text)),u=this._IsUseWatermarkText(!0),r.SelectionStart!=null&&(this.SelectionStart=r.SelectionStart,this._multiLine||(this.DropDownEditData.SelectionStart=r.SelectionStart,u.IsUseWatermarkText||(this.SelectionStart=this.GetSingleCurPosition(this.DropDownEditData.Text,r.SelectionStart)))),r.SelectionEnd!=null&&(this.SelectionEnd=r.SelectionEnd,this._multiLine||(this.DropDownEditData.SelectionEnd=r.SelectionEnd,u.IsUseWatermarkText||(this.SelectionEnd=this.GetSingleCurPosition(this.DropDownEditData.Text,r.SelectionEnd)))),f=this._oldText,this._oldText=this.GetText(),this._lastText=this._oldText,this.DropDownEditData.OldText=this.DropDownEditData.Text,this.DropDownEditData.LastText=this.DropDownEditData.OldText,this.SetLastClientValues(),this.GetText()!=f&&this._uIProcess.FireEvent(this,this._specialClientEvents.TextChanged,null,"TextChanged"),this._ellipsis!==t.None&&this.DealEllipsis(this._multiLine,this._ellipsis,this._ellipsisString,this.GetInputElement()),this},f.prototype.GetSelectionLength=function(){return Math.abs(this.SelectionEnd-this.SelectionStart)},f.prototype.SetSelectionLength=function(t){var r,i;t=n.Utility.CheckInt(t);if(t<0)throw"ArgumentOutOfRangeException";return t==null,r=t.toString(),n.Utility.FilterText("0123456789",r)==r&&(i=this.GetSelectionStart(),this.SelectionStart=i,i+t>this.GetText().GetLength()?(this.SelectionEnd=this.GetText().GetLength(),this._multiLine||(this.DropDownEditData.SelectionEnd=this.DropDownEditData.Text.GetLength())):(this.SelectionEnd=i+t,this._multiLine||(this.DropDownEditData.SelectionEnd=this.GetMultiPosition(this.DropDownEditData.Text,i+t)))),this},f.prototype.GetShowHistory=function(){return this._showHistory},f.prototype.SetShowHistory=function(t){t=n.Utility.CheckBool(t),this._showHistory=t,this._enableAutoComplete=this._isFromServer?this._showHistory&&this._autoCompleteType!="Disabled"&&!this._readOnly&&this.GetEnabled():this._showHistory&&!this._readOnly&&this.GetEnabled()},f.prototype.GetText=function(){return this.Text},f.prototype.GetValue=function(){return this.Text},f.prototype.GetDisplayText=function(){var r=this.GetText(),n,t,i;return this.PasswordMode?(n=this._uIUpdate.GetHideText(),t=n.LastIndexOf(":true"),i=t==-1?n:n.Substring(0,t)):r},f.prototype.GetDisplayPasswordText=function(n){var t=n;return this.PasswordMode&&(t=this._uIProcess.GetPasswordText(n,this._passwordChar,this._multiLine)),t},f.prototype.GetDisplayText2=function(n){var i,r,u,t;return this.PasswordMode?(i=this._uIUpdate.GetHideText(),r=i.LastIndexOf(":true"),u=r==-1?i:i.Substring(0,r)):(n==null&&(n=!0),t=n?this._uIUpdate.GetText():this.GetText(),this._isTextEllipsis&&!this.DragEdit&&(t=this.GetText()),t)},f.prototype.SetText=function(i){var u=this,r;return i==null&&(i=""),i=n.Utility.CheckString(i),this._oldText=this.GetText(),this._switchPasswordChar=!1,this.InternalSetText(i,!1,undefined,!0),this.GetText()!=this._oldText&&(this._oldText=this.GetText(),this._uIUpdate.SetHideText(this.GetText())),this._lastText=this.GetText(),r=this._lastText.GetLength(),this.SelectionStart=r,this.SelectionEnd=r,this._buffText=this._lastText,this.DropDownEditData.Text=this.GetText(),this.DropDownEditData.LastText=this.DropDownEditData.Text,this.DropDownEditData.SelectionStart=r,this.DropDownEditData.SelectionEnd=r,this.DropDownEditData.BuffText=this.DropDownEditData.Text,this.SetLastClientValues(),this._ellipsis!==t.None&&(n.Utility.IPad?setTimeout(function(){u.DealEllipsis(u._multiLine,u._ellipsis,u._ellipsisString,u.GetInputElement())},0):this.DealEllipsis(this._multiLine,this._ellipsis,this._ellipsisString,this.GetInputElement())),this._ClearUndo(),this},f.prototype.GetTextHAlign=function(){return this._uIUpdate.GetTextHAlign()},f.prototype.SetTextHAlign=function(t){t=n.Utility.CheckEnum(n.HorizontalAlignment,t),t!=this.GetTextHAlign()&&this._uIUpdate.SetTextHAlign(t)},f.prototype.GetUseClipboard=function(){if(this._contextMenu.IsShow()||this._touchToolBar.IsShow())if(!n.Utility.IsIE||n.Utility.IsEdge)return!1;return this._useClipboard},f.prototype.SetUseClipboard=function(t){t=n.Utility.CheckBool(t),this._useClipboard=t},f.prototype.GetUseSystemPasswordChar=function(){return this._useSystemPasswordChar},f.prototype.SetUseSystemPasswordChar=function(t){t=n.Utility.CheckBool(t);if(t===this._useSystemPasswordChar)return;this._useSystemPasswordChar=t,t===!0?(this.PasswordMode=!0,this.SetPasswordChar(this.SystemPasswordChar())):this.SetPasswordChar("")},f.prototype.GetWordWrap=function(){return this._wordWrap},f.prototype.SetWordWrap=function(t){var r=this,i;t=n.Utility.CheckBool(t),this._wordWrap=t,this.GetInputElement().style.wordWrap=t===!1?"normal":"break-word",this.GetMultiLine()&&(this.GetInputElement().style.whiteSpace=t?n.Utility.IsIE11OrLater||n.Utility.chrome||n.Utility.safari?"pre-wrap":"pre":"pre"),i=this.GetInputElement().style.width,this.GetInputElement().style.width=parseInt(this.GetInputElement().style.width,10)-5+"px",this._tempWordWrapTimeTicket&&(window.clearTimeout(this._tempWordWrapTimeTicket),this._tempWordWrapTimeTicket=null),this._tempWordWrapTimeTicket=setTimeout(function(){r.GetInputElement().style.width=i},10),this._CheckScrollBar(this.GetScrollBars(),this.GetScrollBarMode())},f.prototype._onWidthChanged=function(n,i){u.prototype._onWidthChanged.call(this,n,i),this._render._layout(),this.UpdateFishEyeButtonStatus(),this._maxLineCount!==0&&this.InternalSetText(this.GetText()),this._ellipsis!==t.None&&this.DealEllipsis(this._multiLine,this._ellipsis,this._ellipsisString,this.GetInputElement()),this._ClearUndo()},f.prototype._onHeightChanged=function(n,t){u.prototype._onHeightChanged.call(this,n,t),this._render._layout(),this.UpdateFishEyeButtonStatus()},f.prototype.Drop=function(){if(this.GetDroppedDown())this.GetDropDownEditor().Close(!0,!0);else if(n.Utility.IsIE9OrLater){this.GetDropDownEnabled()&&this.SetInnerFocus();var t=this;t.DropReal()}else this.DropReal();return this},f.prototype.Clear=function(){return this.SetText(""),this},f.prototype.OnDropDownClose=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.DropDownClose=t},f.prototype.OnDropDownOpen=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.DropDownOpen=t},f.prototype.OnEditStatusChanged=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.EditStatusChanged=t},f.prototype.OnInvalidInput=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.InvalidInput=t},f.prototype.OnKeyExit=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.KeyExit=t},f.prototype.OnTextChanged=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.TextChanged=t},f.prototype.OnReadingStringOutput=function(t){t=n.Utility.CheckFunction(t),this._specialClientEvents.ReadingStringOutput=t},f.prototype.Undo=function(){var i=this.GetText(),u=this._buffText,f=this._lastText,r=this.LastSelectionStart,t=this.LastSelectionEnd,n;this._multiLine||(i=this.DropDownEditData.Text,u=this.DropDownEditData.BuffText,f=this.DropDownEditData.LastText,r=this.DropDownEditData.LastSelectionStart,t=this.DropDownEditData.LastSelectionEnd),n=this._uIProcess.Undo(i,u,f,r,t);if(n==null)return!1;n.Text!=null&&(n.DelInclude?(this._buffText=this.Text,this._isUndoAfterDel=!0,this._multiLine||(this.DropDownEditData.BuffText=this.DropDownEditData.Text)):(this._lastText=this.Text,this._multiLine||(this.DropDownEditData.LastText=this.DropDownEditData.Text)),this.InternalSetText(n.Text,!0)),n.SelectionStart!=null&&(this.LastSelectionStart=this.SelectionStart,this.SelectionStart=n.SelectionStart,this._multiLine||(this.DropDownEditData.LastSelectionStart=this.DropDownEditData.SelectionStart,this.DropDownEditData.SelectionStart=this.SelectionStart,this.SelectionStart=this.GetSingleCurPosition(n.Text,n.SelectionStart))),n.SelectionEnd!=null&&(this.LastSelectionEnd=this.SelectionEnd,this.SelectionEnd=n.SelectionEnd,this._multiLine||(this.DropDownEditData.LastSelectionEnd=this.DropDownEditData.SelectionEnd,this.DropDownEditData.SelectionEnd=this.SelectionEnd,this.SelectionEnd=this.GetSingleCurPosition(n.Text,n.SelectionEnd))),n.SetSelection==!0&&this.SetSelection(this.SelectionStart,this.SelectionEnd),this.CheckPropertyChange(this.GetText())},f.prototype.Cut=function(){var t=this.SelectionStart,r=this.SelectionEnd,i=this.GetText(),n;this._multiLine||(t=this.DropDownEditData.SelectionStart,r=this.DropDownEditData.SelectionEnd,i=this.DropDownEditData.Text),n=this._uIProcess.Cut(i,t,r);if(n==null)return!1;n.SelectionStart!=null&&(this.SelectionStart=n.SelectionStart,this._multiLine||(this.DropDownEditData.SelectionStart=this.SelectionStart,this.SelectionStart=this.GetSingleCurPosition(n.Text,n.SelectionStart))),n.SelectionEnd!=null&&(this.SelectionEnd=n.SelectionEnd,this._multiLine||(this.DropDownEditData.SelectionEnd=this.SelectionEnd,this.SelectionEnd=this.GetSingleCurPosition(n.Text,n.SelectionEnd))),n.DelInclude&&(this._isUndoAfterDel=!0,this._buffText=this.GetText(),this._multiLine||(this.DropDownEditData.BuffText=this.DropDownEditData.Text)),n.Text!=null&&(this.DirectSetText(n.Text),this._multiLine||(this.DropDownEditData.Text=n.Text)),n.SetSelection==!0&&this.SetSelection(this.SelectionStart,this.SelectionEnd),n.EventInfo!=null&&this._uIProcess.FireEvent(this,n.EventInfo.Name,n.EventInfo.Args,n.EventInfo.Type),this.CheckPropertyChange(this.GetText())},f.prototype.Copy=function(){this.PasswordMode||this._uIProcess.Copy(this.GetText(),this.SelectionStart,this.SelectionEnd)},f.prototype.Delete=function(){var n;if(this.GetReadOnly())return;var t=this.SelectionStart,r=this.SelectionEnd,i=this.GetText();this._multiLine||(t=this.DropDownEditData.SelectionStart,r=this.DropDownEditData.SelectionEnd,i=this.DropDownEditData.Text),n=this._uIProcess.Delete(this._multiLine,i,t,r);if(n==null)return!1;n.DelInclude&&(this._buffText=this.Text,this._isUndoAfterDel=!0,this._multiLine||(this.DropDownEditData.BuffText=this.DropDownEditData.Text)),n.SelectionStart!=null&&(this.SelectionStart=n.SelectionStart,this._multiLine||(this.DropDownEditData.SelectionStart=this.SelectionStart,this.SelectionStart=this.GetSingleCurPosition(n.Text,n.SelectionStart))),n.SelectionEnd!=null&&(this.SelectionEnd=n.SelectionEnd,this._multiLine||(this.DropDownEditData.SelectionEnd=this.SelectionEnd,this.SelectionEnd=this.GetSingleCurPosition(n.Text,n.SelectionEnd))),n.Text!=null&&(this.DirectSetText(n.Text),this._multiLine||(this.DropDownEditData.Text=n.Text)),n.SetSelection==!0&&this.SetSelection(this.SelectionStart,this.SelectionEnd),this.CheckPropertyChange(this.GetText())},f.prototype.Paste=function(n){var u=this.SelectionStart,r=this.SelectionEnd,f=this.GetText(),t,i;this._multiLine||(u=this.DropDownEditData.SelectionStart,r=this.DropDownEditData.SelectionEnd,f=this.DropDownEditData.Text),t=this._uIProcess.Paste(u,r,f,this._exitOnLastChar,this._acceptTab,this._acceptReturn,this._maxLength,this._lengthAsByte,this._maxLineCount,this._countWrappedLine,this._multiLine,n,!1);if(t==null)return!1;t.SelectionStart!=null&&(this.SelectionStart=t.SelectionStart,this._multiLine||(this.DropDownEditData.SelectionStart=this.SelectionStart,this.SelectionStart=this.GetSingleCurPosition(t.Text,t.SelectionStart))),t.SelectionEnd!=null&&(this.SelectionEnd=t.SelectionEnd,this._multiLine||(this.DropDownEditData.SelectionEnd=this.SelectionEnd,this.SelectionEnd=this.GetSingleCurPosition(t.Text,t.SelectionEnd))),t.Text!=null&&(this.DirectSetText(t.Text),this._multiLine||(this.DropDownEditData.Text=t.Text)),t.SetSelection==!0&&this.SetSelection(this.SelectionStart,this.SelectionEnd);if(t.EventInfo!=null)for(i=0;i=n.GetLength())return n.GetLength();i=t;while(ir){if(n>=r+u)return t.GetLength()-i.GetLength()+n}else return n;return e=t.GetLength()-i.GetLength()+u,f=Math.floor((n-r)*e/u)+r,f},f.prototype.DealEllipsis=function(i,r,u,f){var s,y,a;this._isTextEllipsis=!1;if(i||r==t.None||this._IsValueNull())return;this._directSetTextWithPassword(this.Text);var l=r,d=0,b=0,k=0,v=0,e=f.value,o=f.value,h="",c="",w=0,p=!0;f.value=e;if(n.Utility.GetTextBoxScrollWidth(f)>f.clientWidth){this._isTextEllipsis=!0,f.value=u,s=u,n.Utility.GetTextBoxScrollWidth(f)>f.clientWidth?(s="",e=u,o=u):l==t.EllipsisPath&&(y=o.LastIndexOf("\\"),y!=-1&&(f.value=s+o.substr(y),n.Utility.GetTextBoxScrollWidth(f)>f.clientWidth||(s=f.value,e=o.Substring(0,y),l=t.EllipsisEnd))),f.value=e+s;do d=f.value.GetLength(),b=Math.ceil(n.Utility.GetTextBoxScrollWidth(f)),k=n.Utility.GetTextBoxScrollWidth(f)-f.clientWidth,v=Math.ceil(k/b),l==t.EllipsisEnd?(f.value=e.Substring(0,e.GetLength()-v)+s,e=e.Substring(0,e.GetLength()-v)):l==t.EllipsisPath&&(w=Math.ceil((e.GetLength()-v)/2),h=e.substr(0,w),c=e.substr(w+v),f.value=h+s+c,e=h+c);while(n.Utility.GetTextBoxScrollWidth(f)>f.clientWidth);a=e.GetLength();do l==t.EllipsisEnd?(f.value=o.Substring(0,a+1)+s,a=a+1):l==t.EllipsisPath&&(p?(c=o.substr(o.GetLength()-c.GetLength()-1),p=!1):(h=o.substr(0,h.GetLength()+1),p=!0),f.value=h+s+c);while(n.Utility.GetTextBoxScrollWidth(f)==f.clientWidth);l==t.EllipsisEnd?(f.value=o.Substring(0,a-1)+s,this._textHeadLength=a-1):l==t.EllipsisPath&&(p?h=o.substr(0,h.GetLength()-1):c=o.substr(o.GetLength()-c.GetLength()+1),f.value=h+s+c,this._textHeadLength=h.GetLength())}},f.prototype.ImeInput=function(t,i,r){var f,s,u,h,l,e;f=t!="DirectInput"||i?t=="LoseFocusInput"&&this._uIUpdate.GetText()!=this.GetText()?this._uIUpdate.GetText():n.Utility.IsIE8?this._uIUpdate.GetText():this.GetText():this._uIUpdate.GetText();if(f==this.Text)return r!=null&&n.Utility.PreventDefault(r),this._imeMode=!1,!1;if(n.Utility.IsIE&&this._hasValidatedImeInput)return this.InternalSetText(f,!0),!1;s=this.Text,n.Utility.IsPad()&&this.Text==""&&this._waterMarkNullString!=""&&(s=this._waterMarkNullString,this._waterMarkNullString="");if(s!=""){var a=Math.min(this.SelectionStart,this.SelectionEnd),c=Math.max(this.SelectionStart,this.SelectionEnd),o=s;n.Utility.IsIE||this.Text==""||(o=this.GetDisplayPasswordText(this.Text)),cthis._maxHistoryCount){for(u="",r=0;r0){for(s=0;s0){for(t=0;t")!=-1)i[t]=i[t].replace(">",">");if(i[t]==n)break}if(t1){for(r=t;rthis._maxHistoryCount?this._maxHistoryCount:i.length,e=0;e0&&(i=this.DropDownListValidate(i)),i}catch(s){}return null}else{i=this._historyList,i=i.sort();if(i!=null)try{u=i.length>this._maxHistoryCount?this._maxHistoryCount:i.length,t!==undefined&&t==="focus"&&(u=i.length);if(u!=i.length){for(f=[],r=0;r0&&(i=this.DropDownListValidate(i)),i}catch(s){}return null}},f.prototype.ResetLocation=function(){try{if(this.GetDroppedDown()){var n=this._getDropDownPos(this.GetDropDownEditor()._getRealCSSWidth(),this.GetDropDownEditor()._getRealCSSHeight(),this.GetDropDownEditor().Align);this.GetDropDownEditor().ResetLocation(n.Left,n.Top)}}catch(t){}},f.prototype.GetCurrentValuesForAjax=function(){var t,r,i,f,u;return this.GetDropDownEditor()==null?(t=this.SelectionStart+n.Utility.Sep4+this.SelectionEnd+n.Utility.Sep4+this.GetSelectedText()+n.Utility.Sep4,t+=this._multiLine?this._uIUpdate.GetHideText()+n.Utility.Sep4:this.DropDownEditData.Text+n.Utility.Sep4,r=0,i=0,t+=r+n.Utility.Sep4+i+n.Utility.Sep4+this.DropDownEditData.Text.Substring(Math.min(r,i),Math.max(r,i))+n.Utility.Sep4+!1+n.Utility.Sep4+this._getEditModeInternal()+n.Utility.Sep4,t+=-1+n.Utility.Sep4+-1+n.Utility.Sep4+this._contextMenu.IsShow()+n.Utility.Sep4+this._isTextEllipsis+n.Utility.Sep4+this._uIUpdate.GetText(),t+=n.Utility.Sep4+!1):(t=this.SelectionStart+n.Utility.Sep4+this.SelectionEnd+n.Utility.Sep4+this.GetSelectedText()+n.Utility.Sep4,t+=this._multiLine?this._uIUpdate.GetHideText()+n.Utility.Sep4:this.DropDownEditData.Text+n.Utility.Sep4,t+=this.GetDropDownEditor().SelectionStart+n.Utility.Sep4+this.GetDropDownEditor().SelectionEnd+n.Utility.Sep4+this.GetDropDownEditor().GetSelectedText()+n.Utility.Sep4+this.GetDropDownEditor()._isShown+n.Utility.Sep4+this._getEditModeInternal()+n.Utility.Sep4,f=-1,u=-1,this.GetDropDownEditor()._isSizeChanged&&(f=this.GetDropDownEditor()._getRealCSSWidth(),u=this.GetDropDownEditor()._getRealCSSHeight()),t+=f+n.Utility.Sep4+u+n.Utility.Sep4+this._contextMenu.IsShow()+n.Utility.Sep4+this._isTextEllipsis+n.Utility.Sep4+this._uIUpdate.GetText())},f.prototype.ResetData=function(n){this.SetText(n.ResetData)},f.prototype.ReadingImeOperation=function(){var e,r,i;n.Utility.IsIE||n.Utility.chrome&&n.Utility.ChromeVersion>=53||(this._cachedReadingStringOutputEventInfo=null);if(this._rubyText=="")return;this._specialClientEvents.ReadingStringOutput&&(e={},e.ReadingString=this._rubyText,r={},r.Name=this._specialClientEvents.ReadingStringOutput,r.Args=e,this._readingStringForEvent=this._rubyText,n.Utility.IsIE||n.Utility.chrome&&n.Utility.ChromeVersion>=53?this._uIProcess.FireEvent(this,r.Name,r.Args,"ReadingStringOutput"):this._cachedReadingStringOutputEventInfo=r),i=document.getElementById(this._readingImeStringOutput.TargetControl);if(i!=null){var o=n.Utility.GetInputElement(i,!0),t=o.control,u=!1,f;if(t==null){i.tagName.toLowerCase()=="span"&&(f=i.innerHTML,f.replace(/<.+?>/gim,"")==f&&(t=i,u=!0));if(!u)return}switch(this._readingImeStringOutput.OutputMode){case"append":o.IsIMControl?t.SetText(t.GetText()+this._rubyText):u?t.innerHTML=f+this._rubyText:t.value=t.value+this._rubyText;break;case"replace":o.IsIMControl?t.SetText(this._rubyText):u?t.innerHTML=this._rubyText:t.value=this._rubyText;break}this._prevval="",this._rubyText=""}},f.prototype.ReadingImeKeyUpProcess=function(t,i,r){var s=this._uIUpdate.GetText(),c=s,l,o,h,u,e;for(this.SelectionEnd=0;u--)if(o.substring(0,u)==this._prevval.substring(0,u)){h=o.substring(u);break}this._prevval=o,s!=this.Text||t==13||r.altKey?t==32||t==229||t>=112&&t<=123||t==37||t==39||t==38||t==40||t==27||t==28||t==29||t==8||(e=f.ConvertReadingIMEString2(h,this.GetReadingImeStringKanaMode()),n.Utility.IsIE&&(this._imeMode?((t==192||t==219||t==221)&&h.length==1&&e.length==2&&this._rubyText.charAt(this._rubyText.length-1)==e.charAt(0)&&(e=e.charAt(1)),this._rubyText+=e):n.Utility.IsIE8&&this.ReadingImeOperation())):(this._prevval="",this._rubyText="")},f.prototype.IsValidReadingString=function(n){if(n===undefined||n===null||n.length===0)return!1;for(var t=0;t=112&&i<=123,v=v||i==n.Key.BackSpace&&!n.Utility.IsIE,v||(this.ImeInput("ReInput",!0,t),this._imeSelectTimes=0,this._imeMode=!1)),i==229&&this._isJapanConvertKeyPress&&(this._isJapanConvertKeyPress=!1);r={},u.Shift&&(i|=65536),u.Ctrl&&(i|=131072);if(u.Alt){if(this._accessKey!=""&&this._accessKey!==undefined&&this._accessKey.toLowerCase()==String.fromCharCode(i).toLowerCase())return this.SelectionStart=0,this.SelectionEnd=this.Text.GetLength(),this._multiLine||(this.DropDownEditData.SelectionStart=0,this.DropDownEditData.SelectionEnd=this.DropDownEditData.Text.GetLength()),r.System=!0,r;i|=262144}o="",y=null,i==n.Key.Return&&this._multiLine&&this._acceptReturn||(c=this._getShortcutObj(),c!=null&&c.GetBlockKeyMessage()&&(tt=c._data.GetKeyActionsByEvent(this,t),o=tt.KeyAction,y=tt.ClientFunction,c._uiProcess.ProcessTriggerAll(this,t))),y!=null&&(n.Utility.FireEvent(this,y,{},""),o===null&&n.Utility.PreventDefault(t)),u.Alt&&i===n.Key.Down&&(o=n.KeyActions.DropDown),a=!1;if(this._keyActionList!=null)for(f=0;f57)&&(i<96||i>105)?i==n.Key.Space?this._imeSelect==!1&&(this._imeSelectTimes==1?this._imeSelect=!0:a.ToHalfWidth(u)!=String.fromCharCode(i)?this._imeSelectTimes++:this._hasValidatedImeInput&&(this._uIProcess.inputJap=!0,n.Utility.IsIE&&(this._hasValidatedImeInput=!1),this.ImeInput("DirectInput",undefined,t),this._imeSelectTimes=0)):i<65||i>90?i!=n.Key.Space&&i!=n.Key.Multiply&&i!=n.Key.Add&&i!=n.Key.Subtract&&i!=n.Key.Decimal&&i!=n.Key.Divide&&i!=219&&i!=220&&i!=221&&i!=222&&(i<186||i>192)&&i!=226?i==n.Key.Up||i==n.Key.Down?this._imeSelect==!1&&this._imeSelectTimes==1&&(this._imeSelect=!0):i==n.Key.BackSpace||i==n.Key.Delete?this._imeSelectTimes=0:i==n.Key.Escape?this._imeSelectTimes=0:i==244?this._isJapanConvertKeyPress=!0:n.Utility.IsIE||i!=243?n.Utility.IsIE&&i==229&&(this._hasValidatedImeInput=!1):(this.ImeInput("ReInput",!0,t),this._imeSelectTimes=0,this._imeMode=!1):(this._imeSelectTimes<1||this.ImeInput("ReInput",undefined,t),this._imeSelectTimes=0,n.Utility.IsIE&&(this._hasValidatedImeInput=!1)):(this._imeSelectTimes=0,this._hasValidatedImeInput=!1):(i<96||(i=i-48),u=a.ToHalfWidth(u),u==String.fromCharCode(i)||this._imeSelect?u==String.fromCharCode(i)&&this._imeSelectTimes<1?this._hasValidatedImeInput=!1:this._imeSelect||(this.ImeInput("ReInput",undefined,t),this._hasValidatedImeInput=!1,this._imeMode=!0):this._hasValidatedImeInput=!1,this._imeSelectTimes=0)),i==242&&this.ImeInput("ReInput",!0,t),this.ReadingImeKeyUpProcess(i,a,t);if(this._uIProcess.keyupResponse==!0){this._uIProcess.keyupResponse=!1;var f=this._uIProcess.KeyUp(this.GetInputElement(),this._multiLine,this.SelectionStart,this.SelectionEnd,this.GetDisplayText2()),p=this.SelectionStart,o=this.SelectionEnd,s=!1,y=!1;this._multiLine||(p=this.DropDownEditData.SelectionStart,o=this.DropDownEditData.SelectionEnd),f.SelectionStart!=null&&this.SelectionStart!=f.SelectionStart&&(s=!0,this.SelectionStart=f.SelectionStart,this._multiLine||(this.DropDownEditData.SelectionStart=this.GetMultiPosition(this.DropDownEditData.Text,this.SelectionStart))),f.SelectionEnd!=null&&this.SelectionEnd!=f.SelectionEnd&&(this.SelectionEnd=f.SelectionEnd,y=!0,this._multiLine||(this.DropDownEditData.SelectionEnd=this.GetMultiPosition(this.DropDownEditData.Text,this.SelectionEnd)));var b=this._uIUpdate.GetText(),e=this._multiLine?this.Text:this.GetSingleText(this.Text),l=e.GetLength()-b.GetLength(),r;this._multiLine?this.PasswordMode?l!=0&&(r=this.Text,s&&y?e=r.Substring(0,this.SelectionStart)+r.Substring(o,r.GetLength()):s||(o=this.SelectionStart+l,e=r.Substring(0,p)+r.Substring(o,r.GetLength()))):e=this.GetDisplayText2():(l!=0&&(r=this.DropDownEditData.Text,s&&y?this.DropDownEditData.Text=r.Substring(0,this.DropDownEditData.SelectionStart)+r.Substring(o,r.GetLength()):s||(o=this.GetMultiPosition(r,this.SelectionStart+l),this.DropDownEditData.Text=r.Substring(0,p)+r.Substring(o,r.GetLength()))),e=this.GetSingleText(this.DropDownEditData.Text)),f.SystemEdit==!0&&(this.Text!==e&&(this.Text=e,n.Utility.IsIE&&(v="",v=n.Utility.IsIE8?this.GetDisplayPasswordText(this.GetDisplayText2()):this.GetDisplayPasswordText(this.GetText()),this._uIUpdate.SetText(v),this.SetSelection(this.SelectionStart,this.SelectionEnd))),this._uIUpdate.SetHideText(e)),f.Text!=null&&this.InternalSetText(f.Text,!0),n.Utility.chrome&&(s||y)&&(f.SetSelection=!0),f.SetSelection==!0&&this.SetSelection(this.SelectionStart,this.SelectionEnd)}this._multiLine||(this.DropDownEditData.Text=this.GetText()),i==n.Key.Return&&this._multiLine&&this._acceptReturn||(h=this._getShortcutObj(),h!=null&&(h.GetBlockKeyMessage()||(h._uiProcess.ProcessGcTextBoxAction(this,t),h._uiProcess.ProcessTriggerAll(this,t))))},f.prototype.TextInput=function(){this.CheckPropertyChange(this.GetDisplayText2())},f.prototype._restoreBorder=function(){var t=this.GetBorderContainer().style;t.borderColor="rgb(169,169,169)",n.Control.GetEnableChromeThemeOutline()||(t.outline="0px"),this._removeBorderStatus(n.ControlStatus.Focused)},f.prototype.PropertyChange=function(t){var i,f,e,r,u;t!=null&&(!n.Utility.IsIE11OrLater&&t.propertyName==="value"||n.Utility.IsIE11OrLater&&t.type==="textinput")&&(n.Utility.IsIE10OrLater&&this.UpdateFishEyeButtonStatus(),this.CheckPropertyChange(this.GetDisplayText2()));if(this.DragEdit){if(t!=null)if(this._needPropertyChange!==!0)if(!n.Utility.IsIE11OrLater&&t.propertyName!=="value"||n.Utility.IsIE11OrLater&&t.type!=="textinput")return!1;this.DragEdit=!1,this._multiLine||this.Text!=this.GetDisplayText2()&&(this.DropDownEditData.OldText=this.DropDownEditData.Text,this.DropDownEditData.Text=this.DropDownEditData.Text.Substring(0,this.DropDownEditData.SelectionStart)+this.DropDownEditData.Text.Substring(this.DropDownEditData.SelectionEnd,this.DropDownEditData.Text.GetLength()),this.DropDownEditData.LastText=this.DropDownEditData.OldText,this.DropDownEditData.SelectionEnd=this.DropDownEditData.SelectionStart),this._oldText=this.Text,this.Text=this.GetDisplayText2(),this._uIUpdate.SetHideText(this.GetDisplayText2()),this._systemChange=!0,this._lastText=this._oldText,this.SetSelectionLength(0)}else if(this.DropEdit){if(t!=null)if(!n.Utility.IsIE11OrLater&&t.propertyName!=="value"||n.Utility.IsIE11OrLater&&t.type!=="textinput")return!1;this.DropEdit=!1,this._focusType=n.FocusType.DragDrop,this.SelectionStart=n.Utility.GetSelectionStartPosition(this.GetInputElement()),this.SelectionEnd=this.SelectionStart+this._uIProcess._getSelectionTextLength(this._multiLine),i=this._uIUpdate.GetText(),this._multiLine?this.PasswordMode&&(u=this.SelectionEnd-this.DropText.GetLength(),i=this.Text.Substring(0,u)+this.DropText+this.Text.Substring(u,this.Text.GetLength())):(e=this.GetSingleText(this.DropDownEditData.Text),r=i.GetLength()-e.GetLength(),f=this.PasswordMode?this.DropText:i.Substring(this.SelectionEnd-r,this.SelectionEnd),r!=0&&(this.DropDownEditData.OldText=this.DropDownEditData.Text,this.DropDownEditData.SelectionStart=this.GetMultiPosition(this.DropDownEditData.Text,this.SelectionEnd-r),this.DropDownEditData.Text=this.DropDownEditData.Text.Substring(0,this.DropDownEditData.SelectionStart)+f+this.DropDownEditData.Text.Substring(this.DropDownEditData.SelectionStart,this.DropDownEditData.Text.GetLength()),this.DropDownEditData.LastText=this.DropDownEditData.OldText,this.DropDownEditData.SelectionEnd=this.DropDownEditData.SelectionStart+r),this.PasswordMode&&(i=this.GetSingleText(this.DropDownEditData.Text))),this._oldText=this.Text,this.Text=i,this._uIUpdate.SetHideText(i),this._systemChange=!0,this._lastText=this._oldText}else this._multiLine||this._isTextEllipsis||this.PasswordMode||this._uIUpdate.SetHideText(this.GetDisplayText2());return!1},f.prototype.MouseDown=function(t){var r,u,i;this._isMouseDownWhenSelectMultiText=!1;if(n.Utility.IsTouchMouseDown==!0&&this._focused)if((this._getInnerShowTouchToolBarValue()&n.TouchToolBarDisplayOptions.TapSelection)!=0&&this._touchToolBar!=null)if(n.Utility.IsClickInSelection(t)){n.Utility.PreventDefault(t);return}r=n.Utility.GetMouseButton(t),this.FocusedWhenMouseDown=document.activeElement==t.target,this.MouseDownOnClearButton=n.Utility.IsMouseDownOnClearButton(t),n.Utility.IsIE||(this.IsActive=!0,this._imeMode&&r==n.MouseButton.Left&&(this._isImplementImeInput=!0)),this._mouseButton=r,this._beforeDragSelectionStart=this.SelectionStart,this._beforeDragSelectionEnd=this.SelectionEnd;if(this._mouseButton==n.MouseButton.Right)this._focusType!=n.FocusType.ClientEvent&&(this._focusType=n.FocusType.Click),this._contextMenu.IsShow()&&this._contextMenu.Close(),this._touchToolBar.IsShow()&&this._touchToolBar.Close();else{this._isLeftMouseButtonPressed=!0,this._focusType!=n.FocusType.ClientEvent&&(this._focusType=n.FocusType.Click),this._contextMenu.IsShow()&&this._contextMenu.Close(),this._touchToolBar.IsShow()&&this._touchToolBar.Close();try{u=this._uIProcess._getSelectionTextLength(this._multiLine),u!=0&&(this._isMouseDownWhenSelectMultiText=!0,n.Utility.IsIE&&!n.Utility.IsEdge&&n.Utility.ClearSelection(this.GetInputElement()))}catch(f){}}i=this._uIProcess.MouseDown(this.GetInputElement(),r);if(i==null)return;i.SelectionStart!=null&&(this.SelectionStart=i.SelectionStart),i.SelectionEnd!=null&&(this.SelectionEnd=i.SelectionEnd)},f.prototype.MouseUp=function(t){var u=this,l,o,s,h,f,e,i,r,v,a;if(this._isMouseDownWhenSelectMultiText){this._isMouseDownWhenSelectMultiText=!1;try{l=this._uIProcess._getSelectionTextLength(this._multiLine);if(l!=0){o={};for(s in t)o[s]=t[s];h=0,n.Utility.IsEdge&&this._highlightText&&(h=200),setTimeout(function(){var t=u.GetInputElement();u.SelectionStart=n.Utility.GetSelectionStartPosition(t),u.SelectionEnd=n.Utility.GetSelectionEndPosition(t),u.MouseUp(o)},h);return}}catch(w){}}f=null,n.Utility.IsIE&&this._imeMode&&this.ReadingImeOperation(),e=this.GetText(),n.Utility.IsIE8&&(e=this._uIUpdate.GetText());if(n.Utility.IsIE&&(this._imeMode||this.Text!=e))this._imeMode?(this.ImeInput("ClickInput",undefined,t),this._imeSelectTimes=0):n.Utility.IsIE8&&this.InternalSetText(this.Text,!0);else if(!n.Utility.IsIE&&(this._imeMode||this.GetDisplayPasswordText(this._convertTextToCrlfText())!=this._uIUpdate.GetText())){if(!this._isImplementImeInput)return;this.ImeInput("ClickInput",undefined,t),this._imeSelectTimes=0,this.GetDisplayPasswordText(this.Text)!=this._uIUpdate.GetText()&&(this._isImplementImeInput=!1,i=this.Text,this._multiLine?(i=i.replace(/\r/g,"\\r"),i=i.replace(/\n/g,"\\n")):(i=i.replace(/\r\n/g,""),i=i.replace(/\r/g,""),i=i.replace(/\n/g,"")),window.setTimeout(function(){u.InternalSetText(i,!0)},0),this.Select())}else{this._isLeftMouseButtonPressed=!1,this._lastStart=this.SelectionStart,this._lastEnd=this.SelectionEnd;var y=this.SelectionStart,p=this.SelectionEnd,e=this.GetText(),c=null;f!=null&&f.Ctrl!=null&&(c=f.Ctrl),r=this._uIProcess.MouseUp(this.GetInputElement(),y,p,this._mouseButton,this._multiLine,e,c,this._highlightText,t);if(r==null)return;r.SelectionStart!=null&&(this.SelectionStart=r.SelectionStart,this._multiLine||(this.DropDownEditData.SelectionStart=this.GetMultiPosition(this.DropDownEditData.Text,this.SelectionStart))),r.SelectionEnd!=null&&(this.SelectionEnd=r.SelectionEnd,this._multiLine||(this.DropDownEditData.SelectionEnd=this.GetMultiPosition(this.DropDownEditData.Text,this.SelectionEnd))),r.SetSelection==!0&&(this._beforeDragSelectionStart===this.SelectionStart||this._beforeDragSelectionStart===this.SelectionEnd?(v=this.SelectionStart,a=this.SelectionEnd,this.SetSelection(this._beforeDragSelectionStart,this._beforeDragSelectionStart===this.SelectionStart?this.SelectionEnd:this.SelectionStart),this.SelectionStart=v,this.SelectionEnd=a):this.SetSelection(this.SelectionStart,this.SelectionEnd))}this._mouseButton=n.MouseButton.Left,this._mouseUpPointerType==undefined&&(this.MouseUpHasValue=t.srcElement.value.length>0),this.HandleClearButton(t)},f.prototype.ProcessSelectionInMouseUp=function(){},f.prototype.MouseWheel=function(n){},f.prototype.ShouldCancelMouseWheelDefaultBehavior=function(){return!1},f.prototype.MouseOut=function(){if(!this._focused)return;if(this._isMouseDownWhenSelectMultiText!=!0)return;if(this._mouseUpPointerType!==4&&this._mouseUpPointerType!=undefined&&this._mouseUpPointerType!=="mouse")return;var r=Math.min(this._beforeDragSelectionStart,this._beforeDragSelectionEnd),i=Math.max(this._beforeDragSelectionStart,this._beforeDragSelectionEnd),t=this.GetText().Substring(r,i);t==""||n.Utility.chrome||(this.SetSelection(this._beforeDragSelectionStart,this._beforeDragSelectionEnd),n.Utility.DragDrop(this.GetInputElement())),this._isMouseDownWhenSelectMultiText=!1},f.prototype.DoubleClick=function(){this.PasswordMode||this._multiLine||!this._enableAutoComplete||this._readOnly||this._autoComplete.ShowDropdown();var n=this._uIProcess.DoubleClick(this.GetInputElement(),this.SelectionStart,this.GetText());return n.SelectionStart!=null&&(this.SelectionStart=n.SelectionStart,this._multiLine||(this.DropDownEditData.SelectionStart=this.GetMultiPosition(this.DropDownEditData.Text,this.SelectionStart))),n.SelectionEnd!=null&&(this.SelectionEnd=n.SelectionEnd,this._multiLine||(this.DropDownEditData.SelectionEnd=this.GetMultiPosition(this.DropDownEditData.Text,this.SelectionEnd))),n.SetSelection==!0&&this.SetSelection(this.SelectionStart,this.SelectionEnd),!0},f.prototype._canDragDrop=function(t){return!n.Utility.IsIE&&this.GetReadOnly()?!1:this._dragStartElementID!=null&&this._dragStartElementID===this._getId()?(this._dragStartElementID=null,t==null&&(t=window.event),t!=null&&n.Utility.PreventDefault(t),!1):!0},f.prototype.DragStart=function(){this._dragStartElementID=this._getId(),this.PasswordMode?event.dataTransfer.effectAllowed="none":this.DragEdit=!0},f.prototype.DragEnd=function(t){t!=null&&t.dataTransfer!=null&&t.dataTransfer.dropEffect==="move"&&this._dragStartElementID!==null&&(n.Utility.IsIE9||n.Utility.IsIE11||n.Utility.chrome)&&(this.Delete(),this._uIUpdate.SetHideText(this._uIUpdate.GetText())),this.DragEdit=!0,this._dragStartElementID=""},f.prototype.DragEnter=function(){var n,t;this._isTextEllipsis&&(n=this.GetText(),this._directSetTextWithPassword(n),this.Text=n,t=this._GetRealForeColor(this._focused,!0),this._uIUpdate.SetForeColor(t))},f.prototype.DragLeave=function(){this.DealEllipsis(this._multiLine,this._ellipsis,this._ellipsisString,this.GetInputElement())},f.prototype.MouseMove=function(t){if(this._toolTip!=null){var r=n.Utility.GetElementPosition(this.GetInputElement()),i=this._uIUpdate.GetRealSize(),e=n.Utility.GetMousePosition(i.Width,i.Height,t),f=e.left,u=e.top;if(f>r.Left&&fr.Top&&uparseInt(i.style.width,10)&&(n.Utility.IsIE8OrLater&&(u+=";width:"+n.Utility.GetTextBoxScrollWidth(i)+"px"),o=n.Utility.GetElementPosition(this.GetInputElement()),this.ColorScheme===undefined&&(this.ColorScheme=this._getControlEffect()),this._toolTip===null&&(this._toolTip=new n.ToolTip),h=this._toolTip.Tip.id+"_innerText",this._toolTip.SynFont(this.GetInputElement()),this._toolTip.SetColorScheme(this.GetRealControlEffect()),this._toolTip.Show(f,o.Left,o.Top),this._mouseMove=!1,this._toolTip.SetMouseDownHandler(function(n){setTimeout(function(){c.SetFocus()},0)})),i.style.width="0px"},f.prototype._updateDropDownEditStatus=function(){this._getControlEffect()===n.ControlEffect.JQueryUI?(this.GetDropDownEditor()._getContainer().className="ui-widget-content ui-corner-all",this.GetDropDownEditor().GetForeColor()===""&&(this.GetDropDownEditor().GetInputElement().style.color="inherit")):(this.GetDropDownEditor()._getContainer().className="",this.GetDropDownEditor().GetForeColor()===""&&(this.GetDropDownEditor().GetInputElement().style.color="#000000"))},f.prototype.DropDownBtnMouseDown=function(t,i){var e=this,f,r,u;if(n.Utility.LoadComplete==!1)return;this._contextMenu.IsShow()&&this._contextMenu.Close(),this._touchToolBar.IsShow()&&this._touchToolBar.Close();if(t!=n.MouseButton.Left&&t!=null){this._mouseButton=t;return}this.GetDropDownEditor()._isShown?(this.GetDropDownEditor().Close(!0,!0),n.Utility.IsIE||(this.IsActive=!0,this.GetDropDownEditor().LoseFocus(i))):this.GetDropDownEnabled()&&(this._isCausedByClickingDropDownBt=!0,n.Utility.IsPad()||this.SetInnerFocus(),this._isFocusToDropDownEdit=!0,f=this._imeMode,n.Utility.IsIE?this._imeMode?(this.ImeInput("LoseFocusInput",undefined,i),this._imeSelectTimes=0):this.Text!=this.GetText()&&this.InternalSetText(this.GetText(),!0):this._imeMode&&this.ImeInput("ReInput",!0,i),!this._multiLine&&this._isTextEllipsis&&this._directSetTextWithPassword(this.DropDownEditData.Text),r=this.GetDropDownEditor(),u=this._getDropDownPos(r._getRealCSSWidth(),r._getRealCSSHeight(),r.GetAlign()),r.VAlign=u.valign,this._multiLine?r.Show(this.Text,this.SelectionStart,this.SelectionEnd,this._getEditModeInternal(),this._overwrite,u.Left,u.Top,this._getInnerTouchDropDownScale()):r.Show(this.DropDownEditData.Text,this.DropDownEditData.SelectionStart,this.DropDownEditData.SelectionEnd,this._getEditModeInternal(),this._overwrite,u.Left,u.Top,this._getInnerTouchDropDownScale()),n.Utility.IsIE&&f&&this._uIUpdate.SetText(this.Text),n.Utility.IsIE&&!n.Utility.IsEdge||n.Utility.IsPad()||(setTimeout(function(){e.GetDropDownEditor().SetFocus()},0),this.IsActive=!1)),this._focusType=n.FocusType.DropDown},f.prototype._isinsertGroup=function(t){return t==n.EditMode.Insert||t==n.EditMode.FixedInsert},f.prototype._isOverwriteGroup=function(t){return t==n.EditMode.Overwrite||t==n.EditMode.FixedOverwrite},f.prototype.InnerKeyPress=function(t,i,r){var h=t,e,o,s,u,f;this._imeMode||this._isPasting?e=this.Text:(e=this._uIUpdate.GetText(),e!=""&&(e=this.GetText())),this._isPasting=!1,o=this.SelectionStart,s=this.SelectionEnd,this._multiLine||(o=this.DropDownEditData.SelectionStart,s=this.DropDownEditData.SelectionEnd),u=this._uIProcess.KeyPress(o,s,h,e,this._maxLength,this._lengthAsByte,this._exitOnLastChar,this._overwrite,this._multiLine,this._maxLineCount,this._countWrappedLine),u.Text!=null&&(u.DelInclude&&(this._buffText=this.GetText(),this._multiLine||(this.DropDownEditData.BuffText=this.DropDownEditData.Text)),this.DirectSetText(u.Text,i),this._multiLine||(this.DropDownEditData.Text=u.Text)),u.SelectionStart!=null&&(this.SelectionStart=u.SelectionStart,this._multiLine||(this.DropDownEditData.SelectionStart=this.SelectionStart,this.SelectionStart=this.GetSingleCurPosition(u.Text,u.SelectionStart))),u.SelectionEnd!=null&&(this.SelectionEnd=u.SelectionEnd,this._multiLine||(this.DropDownEditData.SelectionEnd=this.SelectionEnd,this.SelectionEnd=this.GetSingleCurPosition(u.Text,u.SelectionEnd))),u.SetSelection!=!0||i||r||this.SetSelection(this.SelectionStart,this.SelectionEnd);if(u.EventInfo!=null)for(f=0;f0)},f.prototype.CompositionStart=function(n){u.prototype.CompositionStart.call(this,n),this._lastCompositionText="",this._lastCompositionOffset=0,this._convertedOnLastUpdate=!1,this._cachedReadingString="",this._readingString="",this._compositionUpdateFired=!1},f.prototype.CompositionUpdate=function(n){var i,t;u.prototype.CompositionUpdate.call(this,n),this._compositionUpdateFired=!0;if(n.data===undefined||n.data.length===0)return;i=this.GetInputElement().selectionStart-n.data.length,i>this._lastCompositionOffset?this._convertedOnLastUpdate||(t=this._lastCompositionText.substring(0,i-this._lastCompositionOffset),this._cachedReadingString+=this.IsValidReadingString(t)?t:this._readingString,this._readingString="",this._convertedOnLastUpdate=!0):this._convertedOnLastUpdate&&(this._convertedOnLastUpdate=!1);if(!this.IsValidReadingString(n.data))return;this._readingString=n.data},f.prototype.CompositionEnd=function(t){var r,i;if(n.Utility.IsIE||n.Utility.chrome&&n.Utility.ChromeVersion>=53){this._imeMode=!0,this._hasValidatedImeInput=!1;try{this.ImeInput("DirectInput",undefined,t)}finally{r=this._GetRealForeColor(this._focused,!0),this._uIUpdate.SetForeColor(r),this._imeMode=!1}}this._compositionUpdateFired||this.CompositionUpdate(t),this._convertedOnLastUpdate=!1,i=this._cachedReadingString+this._readingString,this._cachedReadingString="",this._readingString="";if(t.data.length===0||i.length===0)return;this.UpdateReadingIME(i)},f.prototype._ShowContextMenuInternal=function(n,t){this._autoComplete.HideDropdown(),u.prototype._ShowContextMenuInternal.call(this,n,t),this.SetLastClientValues()},f.prototype._BeginShowContextMenuInternal=function(n){var t=this._uIProcess.ShowContextMenu(this.GetInputElement(),this._multiLine);this._isLeftMouseButtonPressed&&this._multiLine||(t.SelectionStart!=null&&(this.SelectionStart=t.SelectionStart),t.SelectionEnd!=null&&(this.SelectionEnd=t.SelectionEnd))},f.prototype._GetContextMenuPasswordmode=function(){return this.PasswordMode},f.prototype.PerformDropDown=function(){if(!this.GetEnabled()||!this.GetDropDownEnabled())return;if(!this.GetVisible())return;if(this._getControlContainer().offsetWidth===0&&this._getControlContainer().offsetHeight===0)return;this._droppedDown?this.CloseDropDown():this.ShowDropDown()},f.prototype.DropDownBtnMouseUp=function(){if(n.Utility.LoadComplete==!1)return;n.Utility.CurrentActiveControlId=this._getId(),this.ResetLocation(),this._isCausedByClickingDropDownBt=!1;if(!this.GetDropDownEditor()._isShown){var t=!1;(n.Utility.IsIE&&n.Utility.IsActiveElement(this._getId()).IsActive||!n.Utility.IsIE&&this.IsActive)&&(t=!0),t&&(n.Utility.IsOnFocus=!0)}},f.prototype.ShowDropDown=function(){var n,t;this._contextMenu.IsShow()&&this._contextMenu.Close(),this._touchToolBar.IsShow()&&this._touchToolBar.Close(),n=this.GetDropDownEditor(),n==null||this._droppedDown||(t=this._getDropDownPos(n._getRealCSSWidth(),n._getRealCSSHeight(),n.GetAlign()),n.Left=t.Left,n.Top=t.Top,n.VAlign=t.valign,n.Show(this.Text,this.SelectionStart,this.SelectionEnd,this._getEditModeInternal(),this._overwrite,t.Left,t.Top,this._getInnerTouchDropDownScale()))},f.prototype.CloseDropDown=function(){this._droppedDown=!1,this.GetDropDownEditor().Close();var t=this._uIProcess.FireEvent(this,this._specialClientEvents.DropDownClose,null,"DropDownClose");n.Utility.FireEvent(this,this._specialClientEvents.InnerDropDownClose,null),t!=null&&(this._focusType=t)},f.prototype.SelectStart=function(n){if(this._imeMode)return!1;if(this._isLeftMouseButtonPressed){var t=this._uIProcess.SelectStart(this.GetInputElement(),n,this._multiLine);t.SelectionStart!=null&&(this.SelectionStart=t.SelectionStart,this._multiLine||(this.DropDownEditData.SelectionStart=this.GetMultiPosition(this.DropDownEditData.Text,t.SelectionStart))),t.SelectionEnd!=null&&(this.SelectionEnd=t.SelectionEnd,this._multiLine||(this.DropDownEditData.SelectionEnd=this.GetMultiPosition(this.DropDownEditData.Text,t.SelectionEnd)))}},f.prototype.DragDrop=function(t,i){var o=this,e,f,s,u;if(!this._canDragDrop(i))return!1;if(!n.Utility.IsIE&&this._readOnly)return!1;n.Utility.safari||this.SetInnerFocus();var h=n.Utility.GetSelectionStartPosition(this.GetInputElement()),v=h,r=this._uIProcess.DragDrop(t,this._exitOnLastChar,h,v,this._maxLength,this._lengthAsByte,this._maxLineCount,this._countWrappedLine,this._multiLine,this.GetDisplayText2());if(r==null)return;r.DropText!=null&&(this.PasswordMode?(s=this._uIProcess.GetPasswordText(r.DropText,this._passwordChar,this._multiLine),n.Utility.IsIE?(event.dataTransfer.setData("Text",s),s!=event.dataTransfer.getData("Text")&&(e=this.GetText(),f=e+r.DropText,this.InternalSetText(f,!0),n.Utility.PreventDefault(event),n.Utility.IsEdge&&n.Utility.PreventDefault(i))):(e=this.GetText(),f=e+r.DropText,this.InternalSetText(f,!0,!0)),this.DropText=r.DropText):n.Utility.IsIE?(event.dataTransfer.setData("Text",r.DropText),r.DropText!=event.dataTransfer.getData("Text")?(e=this.GetText(),f=e+r.DropText,this.InternalSetText(f,!0),n.Utility.PreventDefault(event),n.Utility.IsEdge&&n.Utility.PreventDefault(i)):setTimeout(function(){var n=o.GetText();o.InternalSetText(n,!0)},0)):(e=this.GetText(),f=e+r.DropText,this.InternalSetText(f,!0,!0)),this.DropEdit=!0);if(r.EventInfo!=null)for(u=0;u0&&(ut.SelectionEnd=e-1),ut.SetSelection=!0);break;case 65576:y?(this.ForwardSelection="Right",ut.System=!0,this.keyupResponse=!0):(e=48&&t<=57||t>=65&&t<=90||t>=96&&t<=105||t==229||t==0||t==231)return this.keypressResponse=!0,ut==null&&(ut={}),ut.System=!0,ut.inputChar=!0,ut;if(t==n.Key.Space||t==n.Key.Multiply||t==n.Key.Add||t==n.Key.Subtract||t==n.Key.Decimal||t==n.Key.Divide||t==219||t==220||t==221||t==222||t>=186&&t<=192||t==226||t==231)return this.keypressResponse=!0,ut.System=!0,ut;if(!n.Utility.IsIE&&(t==61||t==59))return this.keypressResponse=!0,ut.System=!0,ut;rt.shiftKey&&(et=t-65536);if(et>=48&&et<=57||et>=65&&et<=90||et>=96&&et<=105||et==229)return this.keypressResponse=!0,ut.System=!0,ut;at=(t==173||t==64||t==160||t==65594||t==58||t==65709||t==65600||t==65696)&&n.Utility.firefox;if(et==n.Key.Space||et==n.Key.Multiply||et==n.Key.Add||et==n.Key.Subtract||et==n.Key.Decimal||et==n.Key.Divide||et==219||et==220||et==221||et==222||et>=186&&et<=192||et==226||et==231||at)return this.keypressResponse=!0,ut.System=!0,ut;if(!n.Utility.IsIE&&(et==61||et==59))return this.keypressResponse=!0,ut.System=!0,ut}return ut},i.prototype.KeyPress=function(n,t,i,r,u,f,e,o,s,h,c){var et,p,k,d,tt,w,ot,nt,g,ut,v;if(this.keypressResponse==!0){this.keypressResponse=!1,this.isInputValid=!0;var a={},ct={},y="\r\n",l="";if(i=="\t")l=i;else if(i=="\r"||i=="\n")if(s)l=y;else return a.SystemEdit=!0,a;else i.GetLength()==1?l=this.Filter.Check(i):(v=this.Filter.CheckText(i),l=v.CheckedText,this.isInputValid=v.IsInputValid);if(n==t){if(u!=0){p=u-this.GetLength(r,f);if(l==y)pthis.GetLength(r,f)?this.MaxLengthCheck(l,p,f):"";else if(o){var st=r.Substring(0,n),rt=r.Substring(n,r.GetLength()),g=rt.IndexOf(y);g!=-1&&(st+=rt.Substring(g,rt.GetLength())),p=u-this.GetLength(st,f),l=this.MaxLengthCheck(l,p,f)}}}else et=r.Substring(Math.min(n,t),Math.max(n,t)),u!=0&&(p=u-this.GetLength(r,f)+this.GetLength(et,f),l==y?pr.GetLength()||r.Substring(n,n+y.GetLength())!=y){if(u!=0&&f){var b=l.GetLength(),it=r.Substring(n,n+b),ft=this.GetLength(it,f),ht=this.GetLength(l,f);while(ht>ft&&b<=r.GetLength())b=b+1,it=r.Substring(n,n+b),ft=this.GetLength(it,f);nt=r.Substring(n,n+b)}else nt=r.Substring(n,n+l.GetLength());g=nt.IndexOf(y),w=g!=-1?r.Substring(0,n)+l+r.Substring(n+g,r.GetLength()):r.Substring(0,n)+l+r.Substring(n+nt.GetLength(),r.GetLength())}else w=r.Substring(0,n)+l+r.Substring(n,r.GetLength())}else n>t&&(ot=n,n=t,t=ot),n!=t&&(a.DelInclude=!0,this.IsDelInclude=!0),l!=""&&(w=r.Substring(0,n)+l+r.Substring(t,r.GetLength()));return a.Text=w,a.SetSelection=!0,(this.isInputValid!=!1||this._owner._imeMode)&&(a.SelectionStart=n+l.GetLength(),a.SelectionEnd=a.SelectionStart),a.EventInfo=[],this.isInputValid||(this.isInputValid=!0,v={},this._owner._specialClientEvents.InvalidInput&&(v.Name=this._owner._specialClientEvents.InvalidInput,v.Args="",v.Type="InvalidInput"),a.EventInfo[0]=v),a.Text!=null&&e&&u!=0&&(ut=this.GetLength(a.Text.Substring(0,a.SelectionStart),f),ut==u&&l!=""&&(v=this.MoveControl(this._getInputElementId(),!0,!1,"CharInput"),v!=null&&(a.EventInfo[1]=v.EventInfo,a.FocusType=v.FocusType,a.FocusExit=!0,a.SetSelection=!1))),a}else return!1},i.prototype.KeyUp=function(t,i,r,u,f){var e={},o;return this.IsKeyDown=!1,e.SelectionStart=n.Utility.GetSelectionStartPosition(t),e.SelectionEnd=e.SelectionStart+this._getSelectionTextLength(i),this.systemEdit==!0&&(this.systemEdit=!1,e.SystemEdit=!0),(this.ctrlDelete||this.ctrlBackspace)&&(this.ctrlDelete?(o=e.SelectionStart,this.ctrlDelete=!1):this.ctrlBackspace&&(o=u,this.ctrlBackspace=!1),e.Text=f.Substring(0,r)+f.Substring(o,f.GetLength()),e.SelectionStart=e.SelectionEnd=r,e.SetSelection=!0),e},i.prototype.MouseDown=function(n,t){this.focusing=!1;return{}},i.prototype._getSelectionTextLength=function(t){var i=this._owner.GetInputElement();return t?n.Utility.GetSelectionText(i).replace(/\r\n/g,"\n").replace(/\n/g,"\r\n").GetLength():n.Utility.GetSelectionText(i).GetLength()},i.prototype.MouseUp=function(t,i,r,u,f,e,o,s,h){var c={},l,a;if(this.focusing){this.focusing=!1;if(s)return c}return u==n.MouseButton.Left&&(this.isDblClick&&!n.Utility.GrapeCityTimeout?(this.isDblClick=!1,this.isTriClick=!0,f?(a=n.Utility.GetSelectionStartPosition(t),l=this.GetLineEnds(a,e),l.start!=null&&(c.SelectionStart=l.start),l.end!=null&&(c.SelectionEnd=l.end)):(c.SelectionStart=0,c.SelectionEnd=e.GetLength())):n.Utility.GetSelectionText(this._owner.GetInputElement())==""&&f?n.Utility.GetSelectionText(this._owner.GetInputElement())==""?(c.SelectionStart=n.Utility.GetSelectionStartPosition(t),c.SelectionEnd=c.SelectionStart+this._getSelectionTextLength(f)):(c.SelectionStart=n.Utility.GetSelectionStartPosition(t),document.selection&&h.y=i&&nr&&(e=i,i=r,r=e),f=t.Substring(i,r),u=!0,this._owner instanceof n.GcTextBox&&(this._gcTextBoxOwner.GetMultiLine()===!1&&(f=n.BaseUIProcess.UpdateCrLfString(f,this._gcTextBoxOwner.GetAcceptsCrlf())),u=this._gcTextBoxOwner.GetUseClipboard()),this._owner instanceof n.DropDownEditControl&&(u=this._owner._control.GetUseClipboard()),n.Utility.SetCopy(f,u))},i.prototype.Paste=function(t,i,r,u,f,e,o,s,h,c,l,a,v){var y,rt,b,it,p,ft,et,d,k,g,tt,ut,nt,w;return this.isInputValid=!0,y={},rt=this._owner instanceof n.GcTextBox?this._gcTextBoxOwner._useClipboard:!0,n.Utility.IsIE&&!n.Utility.IsEdge||(rt=!1),b=a==null?n.Utility.GetPasteData(rt):a,!v&&this._owner instanceof n.GcTextBox&&this._gcTextBoxOwner.GetMultiLine()===!1&&(b=n.BaseUIProcess.UpdateCrLfString(b,this._gcTextBoxOwner.GetAcceptsCrlf())),b=b.replace(/\r\n/g,"\n"),b=b.replace(/\n/g,"\r\n"),b==null?y:(this.FireClientEvent("OnBeforePaste"),it=this.FormatCheck(b,f,e),p=it,o!=0&&(et=this.GetLength(r.Substring(Math.min(t,i),Math.max(t,i)),s),ft=o-this.GetLength(r,s)+et,p=this.MaxLengthCheck(it,ft,s)),h!=0&&l&&(h=w&&u!=0&&t&&l!=""&&(c=this.MoveControl(this._gcTextBoxOwner.GetInputElement().id,!0),this._owner._specialClientEvents.KeyExit&&(c.Name=this._owner._specialClientEvents.KeyExit,c.Args={},c.Args.Key=9,c.Type="KeyExit"),v.EventInfo[1]=c),v},i.prototype.Focus=function(t,i,r,u,f,e){var o,s;return this.focusing=!0,o={},o.Text=this._gcTextBoxOwner._GetRealShownText(r,!0),t==n.FocusType.Left?(o.SelectionStart=0,o.SelectionEnd=0):t==n.FocusType.Right&&(o.SelectionStart=r.GetLength(),o.SelectionEnd=r.GetLength()),f?e||(o.SelectionStart=0,o.SelectionEnd=r.GetLength()):(t==n.FocusType.Click||t==n.FocusType.DragDrop)&&(s=this._owner._IsUseWatermarkText(!1),s.IsUseWatermarkText?(o.SelectionStart=0,o.SelectionEnd=0):(o.SelectionStart=n.Utility.GetSelectionStartPosition(i),o.SelectionEnd=o.SelectionStart+this._getSelectionTextLength(u)),o.SetSelection=!0),(t!=n.FocusType.Click||f)&&(o.SetSelection=!0),o},i.prototype.LoseFocus=function(n,t,i){return{}},i.prototype.MaxLengthCheck=function(n,t,i){var r="",e=0,u,o,f;if(n=="\r\n")t<2||(r=n);else if(i)for(u=0;ut)break;else r+=n.Substring(u,u+1)}else r=n.GetLength()>t?n.Substring(0,t):n;return f=r.GetLength(),f!=0&&r.Substring(f-1,f)=="\r"&&(r=r.Substring(0,f-1)),r!=n&&(this.isInputValid=!1),r},i.prototype.MaxLineCheck=function(n,t,i,r,u){var h="",c=n+i+t,e=this.GetLinesCount(c,u),f,o,s,l;if(e>r){f=0,o=i.GetLength();do{s=Math.floor((f+o)/2),l=i.Substring(0,s),c=n+l+t,e=this.GetLinesCount(c,u);if(e>r)o=s;else if(ef+1)f=s;else if(e==r&&o==f+1)break}while(fi.clientHeight+2)i.rows++;return i.scrollTop=0,u=i.rows,i.rows>1&&(i.rows=1),u}}},i.prototype.FormatCheck=function(t,i,r){this._owner instanceof n.GcTextBox&&!this._gcTextBoxOwner.GetMultiLine()&&t&&(typeof t!="string"&&(t=t.toString()),t=t.replace(/[\r\n]/g,""));var u=this.Filter.CheckText(t),f=u.CheckedText;return this.isInputValid=u.IsInputValid,f},i.prototype.ListValidateCheck=function(n){var i=this.Filter.autoConvert,t;return this.Filter.autoConvert=!1,t=this.Filter.CheckText(n),this.Filter.autoConvert=i,t.IsInputValid},i.prototype.GetLength=function(n,t){var r=0,i,u;if(t)for(i=0;i1)throw"Exception.TextFilter.Format.DuplicatedChar";}else r!=0&&(t=t+u)}return r==1&&(t="^"+t),t},i.prototype.ParseIncludeFormat=function(n){if(n==null||n.GetLength()==0){this.allowTypes=t.All,this.includeNormalChar="",this.includeFormat="";return}this.allowTypes=0,this.includeNormalChar="";for(var i=0;i1)return!1;if((i&t.DBCS_ShiftJIS)==(t.DBCS_ShiftJIS|0)&&this.IsShiftJIS(n))return!0;if(this.charExInstance.IsFullWidth(n)){if((i&t.DBCS)!=(t.DBCS|0))return!1;(i&t.DBCS_All)==(t.DBCS_All|0)&&n!="\u3000"?u=!0:(i&t.DBCS_LowerAlphabet)==(t.DBCS_LowerAlphabet|0)&&this.IsLower(n)?u=!0:(i&t.DBCS_UpperAlphabet)==(t.DBCS_UpperAlphabet|0)&&this.IsUpper(n)?u=!0:(i&t.DBCS_Number)==(t.DBCS_Number|0)&&this.IsNumber(n)?u=!0:(i&t.DBCS_Binary)==(t.DBCS_Binary|0)&&this.IsBinary(n)?u=!0:(i&t.DBCS_Hexadecimal)==(t.DBCS_Hexadecimal|0)&&this.IsHex(n)?u=!0:(i&t.DBCS_Symbol)==(t.DBCS_Symbol|0)&&this.IsSymbol(n)?u=!0:(i&t.DBCS_NumberSymbol)==(t.DBCS_NumberSymbol|0)&&this.IsNumberSymbol(n)?u=!0:(i&t.DBCS_Katakana)==(t.DBCS_Katakana|0)&&this.IsKatakana(n)?(f=this.IsHiragana(n),u=f?this.include?!0:(i&t.DBCS_Hiragana)==(t.DBCS_Hiragana|0):!0):(i&t.DBCS_Hiragana)==(t.DBCS_Hiragana|0)&&this.IsHiragana(n)?(f=this.IsKatakana(n),u=f?this.include?!0:(i&t.DBCS_Katakana)==(t.DBCS_Katakana|0):!0):(i&t.DBCS_JISX0208)==(t.DBCS_JISX0208|0)&&this.IsJISX0208(n)?u=!0:(i&t.Upper_DBCS_Katakana)==(t.Upper_DBCS_Katakana|0)&&this.IsKatakana(n)&&this.IsUpperKana(n)?u=!0:(i&t.Upper_DBCS_Hiragana)==(t.Upper_DBCS_Hiragana|0)&&this.IsHiragana(n)&&this.IsUpperKana(n)?u=!0:(i&t.DBCS_Space)==(t.DBCS_Space|0)&&this.IsFormatSpace(n)?u=!0:(i&t.FourBytes)==(t.FourBytes|0)&&this.IsFourBytes(n)?u=!0:(i&t.TwoBytes)!=(t.TwoBytes|0)||this.IsFourBytes(n)||n=="\u3000"||(u=!0)}else{if((i&t.SBCS)!=t.SBCS)return!1;(i&t.SBCS_All)==t.SBCS_All&&n!=" "?u=!0:(i&t.SBCS_LowerAlphabet)==t.SBCS_LowerAlphabet&&this.IsLower(n)?u=!0:(i&t.SBCS_UpperAlphabet)==t.SBCS_UpperAlphabet&&this.IsUpper(n)?u=!0:(i&t.SBCS_Number)==t.SBCS_Number&&this.IsNumber(n)?u=!0:(i&t.SBCS_Binary)==t.SBCS_Binary&&this.IsBinary(n)?u=!0:(i&t.SBCS_Hexadecimal)==t.SBCS_Hexadecimal&&this.IsHex(n)?u=!0:(i&t.SBCS_Symbol)==t.SBCS_Symbol&&this.IsSymbol(n)?u=!0:(i&t.SBCS_NumberSymbol)==t.SBCS_NumberSymbol&&this.IsNumberSymbol(n)?u=!0:(i&t.SBCS_Katakana)==t.SBCS_Katakana&&this.IsKatakana(n)?u=!0:(i&t.Upper_SBCS_Katakana)==t.Upper_SBCS_Katakana&&this.IsKatakana(n)&&this.IsUpperKana(n)?u=!0:(i&t.SBCS_Space)==t.SBCS_Space&&this.IsFormatSpace(n)&&(u=!0)}return u},i.prototype.IsIncludeValid=function(n){return this.IsValidProcess(n,this.allowTypes,this.includeNormalChar)},i.prototype.IsExcludeValid=function(n){return this.IsValidProcess(n,this.excludeTypes,this.excludeNormalChar)},i.prototype.IsValid=function(n){if(this.excludeFormat!=""){if(this.IsExcludeValid(n))return!1;else if(this.includeFormat!="")return this.IsIncludeValid(n)}else if(this.includeFormat!="")return this.IsIncludeValid(n);return!0},i.prototype.IsFormatSpace=function(n){return n==" "||n=="\u3000"?!0:!1},i.prototype.IsFourBytes=function(t){var u=n.CharProcess.CharEx,r=t.Substring(0,1),i;if(r.length===2)for(i=0;i0){u=this.IsValid(v);if(u)return v}}if(this.charExInstance.IsAlphabet(e)){f=this.charExInstance.IsLower(e)?e.toUpperCase():e.toLowerCase(),u=this.IsValid(f);if(u)return f;e=this.charExInstance.IsFullWidth(e)?this.charExInstance.ToHalfWidth(e):this.charExInstance.ToFullWidth(e).text,u=this.IsValid(e);if(u)return e;return f=this.charExInstance.IsFullWidth(f)?this.charExInstance.ToHalfWidth(f):this.charExInstance.ToFullWidth(f).text,u=this.IsValid(f),u?f:""}if(this.charExInstance.IsHiragana(e)){if(this.charExInstance.IsLowerKana(e)){o=this.charExInstance.ToUpperKana(e),u=this.IsValid(o);if(u)return o}else if(this.charExInstance.HasLowerKana(e)){s=this.charExInstance.ToLowerKana(e),u=this.IsValid(s);if(u)return s}f=this.charExInstance.ToKatakana(e),u=this.IsValid(f);if(u)return f;if(this.charExInstance.IsLowerKana(f)){o=this.charExInstance.ToUpperKana(f),u=this.IsValid(o);if(u)return o}else if(this.charExInstance.HasLowerKana(f)){s=this.charExInstance.ToLowerKana(f),u=this.IsValid(s);if(u)return s}c=this.charExInstance.ToHalfWidthEx(f),u=this.IsValid(c);if(u)return c;if(this.charExInstance.IsLowerKana(c)){c=this.charExInstance.ToUpperKana(c),u=this.IsValid(c);if(u)return c}else if(this.charExInstance.HasLowerKana(c)){c=this.charExInstance.ToLowerKana(c),u=this.IsValid(c);if(u)return c}return""}if(this.charExInstance.IsKatakana(e)){if(this.charExInstance.IsLowerKana(e)){o=this.charExInstance.ToUpperKana(e),u=this.IsValid(o);if(u)return o}else if(this.charExInstance.HasLowerKana(e)){s=this.charExInstance.ToLowerKana(e),u=this.IsValid(s);if(u)return s}a=!1,f=e;if(this.charExInstance.IsFullWidth(e)){h=this.charExInstance.ToHalfWidthEx(e);if(h.GetLength()>0){u=this.IsValid(h);if(u)return h}if(this.charExInstance.IsLowerKana(h)){h=this.charExInstance.ToUpperKana(h),u=this.IsValid(h);if(u)return h}else if(this.charExInstance.HasLowerKana(h)){h=this.charExInstance.ToLowerKana(h),u=this.IsValid(h);if(u)return h}}else{if(r==null){f=this.charExInstance.ToFullWidth(e).text;if(!this.charExInstance.IsKatakana(f))return"";u=this.IsValid(f);if(u)return f}else{r+1