text: /*!
   * ui-grid - v4.7.1 - 2019-02-06
   * Copyright (c) 2019 ; License: MIT 
   */
  
  
  !function(){"use strict";var r=angular.module("ui.grid.rowEdit",["ui.grid","ui.grid.edit","ui.grid.cellNav"]);r.constant("uiGridRowEditConstants",{}),r.service("uiGridRowEditService",["$interval","$q","uiGridConstants","uiGridRowEditConstants","gridUtil",function(t,r,i,e,s){var d={initializeGrid:function(i,e){e.rowEdit={};var r={events:{rowEdit:{saveRow:function(r){}}},methods:{rowEdit:{setSavePromise:function(r,i){d.setSavePromise(e,r,i)},getDirtyRows:function(){return e.rowEdit.dirtyRows?e.rowEdit.dirtyRows:[]},getErrorRows:function(){return e.rowEdit.errorRows?e.rowEdit.errorRows:[]},flushDirtyRows:function(){return d.flushDirtyRows(e)},setRowsDirty:function(r){d.setRowsDirty(e,r)},setRowsClean:function(r){d.setRowsClean(e,r)}}}};e.api.registerEventsFromObject(r.events),e.api.registerMethodsFromObject(r.methods),e.api.core.on.renderingComplete(i,function(r){e.api.edit.on.afterCellEdit(i,d.endEditCell),e.api.edit.on.beginCellEdit(i,d.beginEditCell),e.api.edit.on.cancelCellEdit(i,d.cancelEditCell),e.api.cellNav&&e.api.cellNav.on.navigate(i,d.navigate)})},defaultGridOptions:function(r){},saveRow:function(i,e){var t=this;return function(){if(e.isSaving=!0,e.rowEditSavePromise)return e.rowEditSavePromise;var r=i.api.rowEdit.raise.saveRow(e.entity);return e.rowEditSavePromise?e.rowEditSavePromise.then(t.processSuccessPromise(i,e),t.processErrorPromise(i,e)):s.logError("A promise was not returned when saveRow event was raised, either nobody is listening to event, or event handler did not return a promise"),r}},setSavePromise:function(r,i,e){r.getRow(i).rowEditSavePromise=e},processSuccessPromise:function(r,i){var e=this;return function(){delete i.isSaving,delete i.isDirty,delete i.isError,delete i.rowEditSaveTimer,delete i.rowEditSavePromise,e.removeRow(r.rowEdit.errorRows,i),e.removeRow(r.rowEdit.dirtyRows,i)}},processErrorPromise:function(r,i){return function(){delete i.isSaving,delete i.rowEditSaveTimer,delete i.rowEditSavePromise,i.isError=!0,r.rowEdit.errorRows||(r.rowEdit.errorRows=[]),d.isRowPresent(r.rowEdit.errorRows,i)||r.rowEdit.errorRows.push(i)}},removeRow:function(e,t){null!=e&&e.forEach(function(r,i){r.uid===t.uid&&e.splice(i,1)})},isRowPresent:function(r,e){var t=!1;return r.forEach(function(r,i){r.uid===e.uid&&(t=!0)}),t},flushDirtyRows:function(i){var e=[];return i.api.rowEdit.getDirtyRows().forEach(function(r){d.cancelTimer(i,r),d.saveRow(i,r)(),e.push(r.rowEditSavePromise)}),r.all(e)},endEditCell:function(r,i,e,t){var o=this.grid,n=o.getRow(r);n?(e!==t||n.isDirty)&&(o.rowEdit.dirtyRows||(o.rowEdit.dirtyRows=[]),n.isDirty||(n.isDirty=!0,o.rowEdit.dirtyRows.push(n)),delete n.isError,d.considerSetTimer(o,n)):s.logError("Unable to find rowEntity in grid data, dirty flag cannot be set")},beginEditCell:function(r,i){var e=this.grid,t=e.getRow(r);t?d.cancelTimer(e,t):s.logError("Unable to find rowEntity in grid data, timer cannot be cancelled")},cancelEditCell:function(r,i){var e=this.grid,t=e.getRow(r);t?d.considerSetTimer(e,t):s.logError("Unable to find rowEntity in grid data, timer cannot be set")},navigate:function(r,i){var e=this.grid;r.row.rowEditSaveTimer&&d.cancelTimer(e,r.row),i&&i.row&&i.row!==r.row&&d.considerSetTimer(e,i.row)},considerSetTimer:function(r,i){if(d.cancelTimer(r,i),i.isDirty&&!i.isSaving&&-1!==r.options.rowEditWaitInterval){var e=r.options.rowEditWaitInterval?r.options.rowEditWaitInterval:2e3;i.rowEditSaveTimer=t(d.saveRow(r,i),e,1)}},cancelTimer:function(r,i){i.rowEditSaveTimer&&!i.isSaving&&(t.cancel(i.rowEditSaveTimer),delete i.rowEditSaveTimer)},setRowsDirty:function(e,r){var t;r.forEach(function(r,i){(t=e.getRow(r))?(e.rowEdit.dirtyRows||(e.rowEdit.dirtyRows=[]),t.isDirty||(t.isDirty=!0,e.rowEdit.dirtyRows.push(t)),delete t.isError,d.considerSetTimer(e,t)):s.logError("requested row not found in rowEdit.setRowsDirty, row was: "+r)})},setRowsClean:function(e,r){var t;r.forEach(function(r,i){(t=e.getRow(r))?(delete t.isDirty,d.removeRow(e.rowEdit.dirtyRows,t),d.cancelTimer(e,t),delete t.isError,d.removeRow(e.rowEdit.errorRows,t)):s.logError("requested row not found in rowEdit.setRowsClean, row was: "+r)})}};return d}]),r.directive("uiGridRowEdit",["gridUtil","uiGridRowEditService","uiGridEditConstants",function(r,o,i){return{replace:!0,priority:0,require:"^uiGrid",scope:!1,compile:function(){return{pre:function(r,i,e,t){o.initializeGrid(r,t.grid)},post:function(r,i,e,t){}}}}}]),r.directive("uiGridViewport",["$compile","uiGridConstants","gridUtil","$parse",function(r,i,e,t){return{priority:-200,scope:!1,compile:function(r,i){var e=angular.element(r.children().children()[0]),t=e.attr("ng-class"),o="";return o=t?t.slice(0,-1)+", 'ui-grid-row-dirty': row.isDirty, 'ui-grid-row-saving': row.isSaving, 'ui-grid-row-error': row.isError}":"{'ui-grid-row-dirty': row.isDirty, 'ui-grid-row-saving': row.isSaving, 'ui-grid-row-error': row.isError}",e.attr("ng-class",o),{pre:function(r,i,e,t){},post:function(r,i,e,t){}}}}}])}();