!function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","./grid.base"],e):e(jQuery)}(function(y){"use strict";y.jgrid.extend({editCell:function(c,f,u,g){return this.each(function(){var e,i,l,t,r,o=this,d=y(this).jqGrid("getStyleUI",o.p.styleUI+".common","highlight",!0),s=y(this).jqGrid("getStyleUI",o.p.styleUI+".common","hover",!0),a=y(this).jqGrid("getStyleUI",o.p.styleUI+".celledit","inputClass",!0);if(o.grid&&!0===o.p.cellEdit){if(f=parseInt(f,10),o.p.selrow=o.rows[c].id,o.p.knv||y(o).jqGrid("GridNav"),0"+i,d.bClose,{styleUI:t.p.styleUI,top:c.top+30,left:c.left,onClose:function(){t.p.restoreCellonFail||y("#"+b+"_"+p,s).focus()}}),t.p.restoreCellonFail&&y(t).jqGrid("restoreCell",b,m)}},y.jgrid.ajaxOptions,t.p.ajaxCellOptions||{}))}else try{y.jgrid.info_dialog(o.errcap,o.nourl,d.bClose,{styleUI:t.p.styleUI}),t.p.restoreCellonFail&&y(t).jqGrid("restoreCell",b,m)}catch(e){}"clientArray"===t.p.cellsubmit&&(y(a).empty(),y(t).jqGrid("setCell",t.p.savedRow[r].rowId,m,u,!1,!1,!0),a=y("td",s).eq(m),y(a).addClass("dirty-cell"),y(s).addClass("edited"),y(t).triggerHandler("jqGridAfterSaveCell",[t.p.savedRow[r].rowId,n,f,b,m]),y.jgrid.isFunction(t.p.afterSaveCell)&&t.p.afterSaveCell.call(t,t.p.savedRow[r].rowId,n,f,b,m),t.p.savedRow.splice(0,1))}else try{y.jgrid.isFunction(t.p.validationCell)?t.p.validationCell.call(t,y("#"+b+"_"+p,s),g[1],b,m):(window.setTimeout(function(){y.jgrid.info_dialog(o.errcap,f+" "+g[1],d.bClose,{styleUI:t.p.styleUI,top:c.top+30,left:c.left,onClose:function(){t.p.restoreCellonFail||y("#"+b+"_"+p,s).focus()}})},50),t.p.restoreCellonFail&&y(t).jqGrid("restoreCell",b,m))}catch(e){alert(g[1])}}else y(t).jqGrid("restoreCell",b,m)}window.setTimeout(function(){y("#"+y.jgrid.jqID(t.p.knv)).attr("tabindex","-1").focus()},0)}})},restoreCell:function(r,o){return this.each(function(){var e=this,i=1<=e.p.savedRow.length?0:null;if(e.grid&&!0===e.p.cellEdit){if(null!==i){var l=y(e).jqGrid("getGridRowById",e.p.savedRow[i].rowId),t=y("td",l).eq(o);if(y.jgrid.isFunction(y.fn.datepicker))try{y("input.hasDatepicker",t).datepicker("hide")}catch(e){}y(t).empty().attr("tabindex","-1"),y(e).jqGrid("setCell",e.p.savedRow[0].rowId,o,e.p.savedRow[i].v,!1,!1,!0),y(e).triggerHandler("jqGridAfterRestoreCell",[e.p.savedRow[i].rowId,e.p.savedRow[i].v,r,o]),y.jgrid.isFunction(e.p.afterRestoreCell)&&e.p.afterRestoreCell.call(e,e.p.savedRow[i].rowId,e.p.savedRow[i].v,r,o),e.p.savedRow.splice(0,1)}window.setTimeout(function(){y("#"+e.p.knv).attr("tabindex","-1").focus()},0)}})},nextCell:function(t,r,o){var d;return this.each(function(){var e,i=this,l=!1;if(i.grid&&!0===i.p.cellEdit){for(e=r+1;e=r+parseInt(o,10)?y(s.grid.bDiv)[0].scrollLeft=y(s.grid.bDiv)[0].scrollLeft+s.rows[e].cells[i].clientWidth:l"),y(e).insertBefore(s.grid.cDiv),y("#"+s.p.knv).focus().keydown(function(e){switch(l=e.keyCode,"rtl"===s.p.direction&&(37===l?l=39:39===l&&(l=37)),l){case 38:0