@magic-xpa/angular 4.801.0-dev481.237 → 4.801.0-dev481.241
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/magic-xpa-angular.umd.js +1 -1
- package/bundles/magic-xpa-angular.umd.js.map +1 -1
- package/bundles/magic-xpa-angular.umd.min.js +1 -1
- package/bundles/magic-xpa-angular.umd.min.js.map +1 -1
- package/esm2015/src/ui/router-container.magic.component.js +2 -2
- package/fesm2015/magic-xpa-angular.js +1 -1
- package/fesm2015/magic-xpa-angular.js.map +1 -1
- package/package.json +3 -3
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
13
13
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
14
14
|
PERFORMANCE OF THIS SOFTWARE.
|
|
15
|
-
***************************************************************************** */var v=function(e,t){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},v(e,t)};function C(e,t){function n(){this.constructor=e}v(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function b(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function S(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function I(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function R(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function E(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function M(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(w(arguments[t]));return e}var k,T=function(){function e(){this.properties=new Map,this.classesMap=new Map,this.stylesMap=new Map,this.userProperties=new Map,this.customValidators=new Map}return e.prototype.setClass=function(e,t){var n,r;this.classesMap.has(e)&&(this.removedClass=this.classesMap.get(e)),this.classesMap.set(e,t);var o="";try{for(var i=E(this.classesMap),a=i.next();!a.done;a=i.next()){o+=a.value+" "}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}this.classes=o},e.prototype.setStyle=function(e,t){this.stylesMap.set(e,t)},e}(),O=function(){function e(){this.values=new Map,this.ControlsProperties=new Map,this.isCreated=!1,this.isEditing=!1}return Object.defineProperty(e.prototype,"Values",{get:function(){return this.values},enumerable:!1,configurable:!0}),e.prototype.getControlMetadata=function(e){return this.ControlsProperties.has(e)||this.ControlsProperties.set(e,new T),this.ControlsProperties.get(e)},e.prototype.update=function(e){var t=e.ControlsMetaData;for(var n in t){this.ControlsProperties.has(n)||this.ControlsProperties.set(n,new T);var r=this.ControlsProperties.get(n);for(var o in e.ControlsMetaData[n].Properties)r[o]=e.ControlsMetaData[n].Properties[o];r.controlType=e.ControlsMetaData[n].Type}for(var n in e.ControlsValues)this.setValue(n,e.ControlsValues[n])},e.prototype.setValue=function(e,t){this.values.set(e,t)},e.prototype.getProperty=function(e,t){return this.ControlsProperties.has(e)&&this.ControlsProperties.get(e).properties.has(t)?this.ControlsProperties.get(e).properties.get(t):""},e.prototype.getValue=function(e){return this.values.get(e)},e}(),P=function(){function e(){this.data=new Map,this.list=[],this.recordsBeforeCurrentView=0,this.isEmptyDataView=!1,this.sizeUpdated=!1}return e.prototype.getRow=function(e){return this.list[e+this.recordsBeforeCurrentView]},e.prototype.markRowAsCreated=function(e){e<this.list.length&&(this.addRow(e),this.data.get(e).isCreated=!0)},e.prototype.markRowAsNotCreated=function(e){e<this.list.length&&(this.data.get(e).isCreated=!1)},e.prototype.isRowCreated=function(e){return e<this.list.length&&(!(!this.data.has(e)||t.isNullOrUndefined(this.data.get(e)))&&this.data.get(e).isCreated)},e.prototype.startRowEditing=function(e){e<this.list.length&&this.data.has(e)&&(this.data.get(e).isEditing=!0)},e.prototype.stopRowEditing=function(e){e<this.list.length&&this.data.has(e)&&(this.data.get(e).isEditing=!1)},e.prototype.isRowInRowEditing=function(e){return+e<this.list.length&&(!(!this.data.has(+e)||t.isNullOrUndefined(this.data.get(+e)))&&this.data.get(+e).isEditing)},e.prototype.update=function(e){var t,n;for(var r in e.fullRefresh&&e.rows.length!=this.list.length&&(this.data=new Map,this.list=new Array),e.rows){this.data.has(+r)&&null!==this.data.get(+r)||this.data.set(+r,new O);var o=this.data.get(+r);o.update(e.rows[r]),o.rowId=r}try{for(var i=E(this.data),a=i.next();!a.done;a=i.next()){var s=w(a.value,2),c=s[0],l=s[1];this.list[c]=l}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.updateSize=function(e){if(this.list.length!=e){if(e<this.list.length)for(var t=e;t<this.list.length;t++)this.data.delete(t);this.list.length=e,this.sizeUpdated=!0}},e.prototype.clearFirstTableRecord=function(e){if(this.list.length>=1)for(var t in e)"1"==e[t]&&this.list[0].ControlsProperties.has(t)&&(this.list[0].ControlsProperties.get(t).properties=new Map)},e.prototype.addRow=function(e){0===e&&this.data.has(e)&&!t.isNullOrUndefined(this.data.get(e))||(this.data.set(e,new O),this.data.get(e).rowId=""+e,this.list[e]=this.data.get(e))},e.prototype.createFirst=function(){this.addRow(0)},e.prototype.fromJson=function(e){var t=JSON.parse(e);this.update(t)},e.prototype.setGuiTopIndex=function(e){this.guiTopIndex=e},e.prototype.getGuiTopIndex=function(){return this.guiTopIndex},e}();(k=e.HtmlClasses||(e.HtmlClasses={})).Color="color",k.font="font",k.FocusColor="focuscolor",k.HintColor="hintcolor";var x=function(){function e(){this.magicBridge=c.MagicBridge,this.isStub=!1,this.isLoggedIn=!1,this.refreshDom=new s.Subject,this.interactiveCommands=new s.Subject}return e.prototype.startMagicEngine=function(e){var t=this;this.magicBridge.registerExecuteCommandsCallback((function(e){var n,r;if(!t.isStub)try{var o=e;try{for(var i=E(o),a=i.next();!a.done;a=i.next()){var s=a.value;t.refreshDom.next(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}catch(e){console.dir(e),console.log("magic engine not found"),console.log("moving to stub mode"),t.isStub=!0}})),this.magicBridge.registerInteractiveCallback((function(e){t.isStub||t.interactiveCommands.next(e)})),this.magicBridge.Initialize(e)},e.prototype.terminateMagic=function(){return I(this,void 0,void 0,(function(){return R(this,(function(e){switch(e.label){case 0:return[4,this.magicBridge.TerminateMagic()];case 1:return e.sent(),[2]}}))}))},e.prototype.insertEvent=function(e){this.isStub||this.magicBridge.insertEvent(e)},e.prototype.GetRangedValue=function(e,t,n){return this.magicBridge.GetRangedValue(e,t,n)},e.prototype.GetControlPictureMask=function(e,t){return this.magicBridge.GetControlPictureMask(e,t)},e.prototype.GetFormattedValue=function(e,t,n){return this.magicBridge.GetFormattedValue(e,t,n)},e.prototype.ValidateControlValue=function(e,t,n){return this.magicBridge.ValidateControlValue(e,t,n)},e.prototype.GetFldRanges=function(e,t){return this.magicBridge.GetFldRanges(e,t)},e.prototype.saveData=function(e){},e.prototype.getIsLoggedIn=function(){return this.isLoggedIn},e.prototype.setIsLoggedIn=function(e){this.isLoggedIn=e},e.prototype.TransCacheExists=function(){return this.magicBridge.TransCacheExists()},e.prototype.TerminateContextUsingFetchAPI=function(){this.magicBridge.TerminateContextUsingFetchAPI()},e}();x.ɵfac=function(e){return new(e||x)},x.ɵprov=n.ɵɵdefineInjectable({token:x,factory:x.ɵfac}),n.ɵsetClassMetadata(x,[{type:n.Injectable}],null,null);var D=function(){function e(){this.components=new Map,this.dialogs=new Map,this.lazyLoadModulesMap=null}return e.prototype.getData=function(e,t){var n=null,r=this.components.has(e);return!r&&t&&console.log("Error: Component: "+e+" does not exist in components map"),r&&(n=this.components.get(e)),n},e.prototype.getComponent=function(e,t){void 0===t&&(t=!0);var n=this.getData(e,t);return n?n.component:null},e.prototype.addComponents=function(e,t){for(var n in e){var r={moduleRef:t,component:e[n]};this.components.set(n,r)}},e.prototype.getModuleRef=function(e){var t=this.getData(e,!1);return t?t.moduleRef:null},e.prototype.getLazyLoadModuleData=function(e){return null!=this.lazyLoadModulesMap&&this.lazyLoadModulesMap.hasOwnProperty(e)?this.lazyLoadModulesMap[e]:null},e}(),_=function(){function e(){}return e.magicValueGetStyle=function(n,r){var o="";if(!t.isNullOrUndefined(r)){var i=e.StylesMap.get(n);i.constructor===Map?o=i.get(r):i.constructor===String&&(o=d.NString.Format(i.toString(),r))}return o},e}();_.StylesMap=new Map([[u.MagicProperties.LineDivider,new Map([[!0,"solid"],[!1,"hidden"]])],[u.MagicProperties.ImageFile,"url('{0}')"],[u.MagicProperties.Wallpaper,"url('{0}')"]]),_.MagicPropertyToHtmlAttributeMap=new Map([[u.MagicProperties.LineDivider,"border-bottom-style"],[u.MagicProperties.ImageFile,"background-image"],[u.MagicProperties.Wallpaper,"background-image"]]);var A=function(){function e(e){this.magic=e,this.count=0,this.commands=new d.List,this.subscription=null}return e.prototype.startCollecting=function(){var e=this;this.count++,u.Logger.Instance.WriteDevToLog("CommandsCollectorMagicService.startCollecting() --- "+this.count),null===this.subscription&&(this.subscription=this.magic.refreshDom.subscribe((function(t){e.commands.push(t)})))},e.prototype.stopCollecting=function(){this.count--,u.Logger.Instance.WriteDevToLog("CommandsCollectorMagicService.stopCollecting() --- "+this.count),0===this.count&&(this.subscription.unsubscribe(),this.subscription=null)},e.prototype.GetCommands=function(e){var t=this,n=this.commands.filter((function(t){return t.TaskTag===e}));return n.forEach((function(e){t.commands.Remove(e)})),n},e}();A.ɵfac=function(e){return new(e||A)(n.ɵɵinject(x))},A.ɵprov=n.ɵɵdefineInjectable({token:A,factory:A.ɵfac}),n.ɵsetClassMetadata(A,[{type:n.Injectable}],(function(){return[{type:x}]}),null);var j=function(){},F=function(){function e(){this.pendingRouteCommands=[]}return e.prototype.AddRouteCommand=function(e){this.pendingRouteCommands.push(e)},e.prototype.ExecuteNextCommand=function(){var e=this.pendingRouteCommands.shift();t.isNullOrUndefined(e)||e.callerMgSubformServiceRef.ExecuteRouteCommand(e)},e}();F.ɵfac=function(e){return new(e||F)},F.ɵprov=n.ɵɵdefineInjectable({token:F,factory:F.ɵfac}),n.ɵsetClassMetadata(F,[{type:n.Injectable}],null,null);var N=function(){function e(e,t,n,r,o,i,a,s,c){this.task=e,this.activatedRoute=t,this.componentList=n,this.pendingCommandsCollector=r,this.router=o,this.routerCommandsMagicService=i,this.componentListMagicService=a,this.loader=s,this.injector=c,this.subformsDict={},this.routesDict={},this.currentRouteDefinition=null}return e.prototype.mgGetComp=function(e){if(e in this.subformsDict){var t=this.subformsDict[e].formName;if(t)return this.componentList.getComponent(t)}return null},e.prototype.mgGetParameters=function(e){return e in this.subformsDict?this.subformsDict[e].parameters:""},e.prototype.deleteSubformComp=function(e,t){Object.keys(this.subformsDict).indexOf(e)>=0&&this.subformsDict[e].formName===t&&(this.subformsDict[e]={},this.task.refreshView())},e.prototype.addSubformComp=function(n,r,o,i,a,s,c){var l=this;this.pendingCommandsCollector.startCollecting();var u=!1;if(t.isNullOrUndefined(a)){Object.keys(this.subformsDict).indexOf(n)>=0&&this.subformsDict[n].formName===r&&(this.subformsDict[n]={},this.task.refreshView());var p=this.componentListMagicService.getModuleRef(r);if(null==p){var m=this.componentListMagicService.getLazyLoadModuleData(r);null!=m&&this.loader.load(m.modulePath+"#"+m.moduleName).then((function(e){p=e.create(l.injector),l.subformsDict[n]={formName:r,parameters:{taskIdParam:o,taskDescription:i}},l.task.refreshView()}))}else this.subformsDict[n]={formName:r,parameters:{taskIdParam:o,taskDescription:i}},u=!0}else{c&&(n="primary");var f=new d.List;f.push(a),null!==s&&(f=f.concat(s));var h={callerMgSubformServiceRef:this,routerOutletName:n,formName:r,parameters:{taskIdParam:o,taskDescription:i},routeParams:f};null===e.currentCallerMgSubformServiceRef?this.ExecuteRouteCommand(h):this.routerCommandsMagicService.AddRouteCommand(h)}u&&this.task.refreshView()},e.prototype.ExecuteRouteCommand=function(t){var n,r=t.callerMgSubformServiceRef,o=e.getRelativeRoute(r.activatedRoute);if(r.routesDict[t.routerOutletName]===t.routeParams[0])r.router.navigate([{outlets:(n={},n[t.routerOutletName]=null,n)}],{relativeTo:o}).then((function(n){e.currentCallerMgSubformServiceRef=r,r.currentRouteDefinition={formName:t.formName,parameters:t.parameters},r.PerformRouterNavigate(t.routerOutletName,t.routeParams)}));else if(e.currentCallerMgSubformServiceRef=r,r.currentRouteDefinition={formName:t.formName,parameters:t.parameters},e.routerContainers.length>0){var i=e.routerContainers[0];e.routerContainers.shift(),i.initializeComponent()}else r.PerformRouterNavigate(t.routerOutletName,t.routeParams)},e.prototype.PerformRouterNavigate=function(t,n){var r,o=e.getRelativeRoute(this.activatedRoute);this.router.navigate([{outlets:(r={},r[t]=n,r)}],{relativeTo:o}).then((function(t){if(null!==t&&!t){var n=e.currentCallerMgSubformServiceRef;n.currentRouteDefinition=null,e.currentCallerMgSubformServiceRef=null,n.pendingCommandsCollector.stopCollecting(),n.routerCommandsMagicService.ExecuteNextCommand()}}))},e.prototype.init=function(){var e=this,t=this.pendingCommandsCollector.GetCommands(this.task.taskId);t.length>0&&(t.forEach((function(t){e.task.executeCommand(t)})),this.task.refreshView()),this.pendingCommandsCollector.stopCollecting()},e.prototype.refreshView=function(){this.task.refreshView()},e.getRelativeRoute=function(e){var t=e;return null!==t.snapshot.routeConfig&&""===t.snapshot.routeConfig.path&&((t=t.parent).snapshot.routeConfig.loadChildren||console.log("getRelativeRoute(): both path and currentActiveRoute.snapshot.routeConfig.loadChildren are empty.")),t},e}();N.currentCallerMgSubformServiceRef=null,N.routerContainers=new Array,N.ɵfac=function(e){return new(e||N)(n.ɵɵinject(se),n.ɵɵinject(o.ActivatedRoute),n.ɵɵinject(D),n.ɵɵinject(A),n.ɵɵinject(o.Router),n.ɵɵinject(F),n.ɵɵinject(D),n.ɵɵinject(n.NgModuleFactoryLoader),n.ɵɵinject(n.Injector))},N.ɵprov=n.ɵɵdefineInjectable({token:N,factory:N.ɵfac}),n.ɵsetClassMetadata(N,[{type:n.Injectable}],(function(){return[{type:se},{type:o.ActivatedRoute},{type:D},{type:A},{type:o.Router},{type:F},{type:D},{type:n.NgModuleFactoryLoader},{type:n.Injector}]}),null);var V=function(){function e(e,t,n,r,o,i,a,s,c){this.activatedRoute=e,this.router=t,this.magic=n,this.containerTaskService=r,this.componentFactoryResolver=o,this.viewContainerRef=i,this.componentList=a,this.pendingCommandsCollector=s,this.routerCommandsMagicService=c,this.componentRef=null,this.parentMgSubformService=null}return Object.defineProperty(e,"LastRoute",{get:function(){return e.lastRoute},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this.activatedRoute.outlet;var t=N.currentCallerMgSubformServiceRef,n=N.getRelativeRoute(this.activatedRoute);e.lastRoute=this.router.url,null==t||null===t.currentRouteDefinition?(this.insertRouteEvent(n),N.routerContainers.push(this)):this.initializeComponent()},e.prototype.insertRouteEvent=function(e){var t=c.getGuiEventObj("RouterNavigate",null,0);t.RouterPath=e.snapshot.routeConfig.path,"primary"!==e.snapshot.outlet&&(t.RouterOutletName=e.snapshot.outlet);var n=e.routeConfig.path;if(n.length>0){var r=n,o=u.StrUtil.tokenize(r,"/:");t.RouterPath=o[0],t.RouterParams=new d.List;for(var i=1;i<o.length;i++)t.RouterParams.push(this.activatedRoute.snapshot.params[o[i]])}this.containerTaskService.insertEvent(t)},e.prototype.initializeComponent=function(){var e=this,t=N.currentCallerMgSubformServiceRef;if(null!==t.currentRouteDefinition){var n=this.componentList.getComponent(t.currentRouteDefinition.formName),r=this.componentFactoryResolver.resolveComponentFactory(n);this.componentRef=this.viewContainerRef.createComponent(r),Object.assign(this.componentRef.instance,t.currentRouteDefinition.parameters);var o=N.getRelativeRoute(this.activatedRoute),i=u.StrUtil.tokenize(o.snapshot.routeConfig.path,"/:");t.routesDict[o.snapshot.outlet]=i[0],this.parentMgSubformService=t,t.currentRouteDefinition=null,N.currentCallerMgSubformServiceRef=null;var a=!0;o.paramMap.subscribe((function(t){a||e.insertRouteEvent(o),a=!1})),this.parentMgSubformService.refreshView(),this.routerCommandsMagicService.ExecuteNextCommand()}},e.prototype.ngOnDestroy=function(){if(null!=this.componentRef){this.componentRef.instance.task.close();var t=N.getRelativeRoute(this.activatedRoute);this.parentMgSubformService.routesDict[t.outlet]="",e.lastRoute=this.router.url}},e}();V.lastRoute="/",V.ɵfac=function(e){return new(e||V)(n.ɵɵdirectiveInject(o.ActivatedRoute),n.ɵɵdirectiveInject(o.Router),n.ɵɵdirectiveInject(x),n.ɵɵdirectiveInject(se),n.ɵɵdirectiveInject(n.ComponentFactoryResolver),n.ɵɵdirectiveInject(n.ViewContainerRef),n.ɵɵdirectiveInject(D),n.ɵɵdirectiveInject(A),n.ɵɵdirectiveInject(F))},V.ɵcmp=n.ɵɵdefineComponent({type:V,selectors:[["magic-route-outlet"]],decls:0,vars:0,template:function(e,t){},encapsulation:2}),n.ɵsetClassMetadata(V,[{type:n.Component,args:[{selector:"magic-route-outlet",template:"\n "}]}],(function(){return[{type:o.ActivatedRoute},{type:o.Router},{type:x},{type:se},{type:n.ComponentFactoryResolver},{type:n.ViewContainerRef},{type:D},{type:A},{type:F}]}),null);var L=function(){function e(){}return e.prototype.Run=function(){try{switch(this.command._commandType){case l.InteractiveCommandType.GET_VALUE:this.onValue();break;case l.InteractiveCommandType.GET_ROWS_IN_PAGE:this.onGetRowsInPage();break;case l.InteractiveCommandType.GET_MAX_ROWS_IN_PAGINATED_TABLE:this.onGetMaxRowsInPaginatedTable();break;case l.InteractiveCommandType.MESSAGE_BOX:this.OnMessageBox();break;case l.InteractiveCommandType.GET_TOP_INDEX:this.OnGetTopIndex();break;case l.InteractiveCommandType.GET_IS_ROW_EDITING:this.OnGetIsRowEditing();break;case l.InteractiveCommandType.SET_TITLE:this.OnSetTitle();break;case l.InteractiveCommandType.REFRESH_PAGE:this.OnRefreshPage();break;case l.InteractiveCommandType.GET_LAST_ROUTE:this.OnGetLastRoute()}}catch(e){throw e}},e.executeInteractiveCommand=function(t,n,r){var o=new e;o.task=t,o.command=n,o.overlayService=r,o.Run()},e.prototype.onValue=function(){var e,n=this.task.getGuiRowId(+this.command._line,this.task.isTableControl(this.command.controlName)||this.command._obj2.IsTableChild),r=this.task.getFormControl(n.toString(),this.command.controlName);t.isNullOrUndefined(r)?this.task.isTableControl(this.command.controlName)&&(e=this.task.getValue(this.command.controlName,n.toString())):e=r.value,e=this.task.ConvertValToNative(this.command.controlName,n,e),this.command._mgValue.obj=e},e.prototype.onGetRowsInPage=function(){this.command._intVal1=this.task.tableService.getPageSize(),0==this.task.oldPageSize&&(this.task.oldPageSize=this.command._intVal1)},e.prototype.onGetMaxRowsInPaginatedTable=function(){this.command._intVal1=this.task.tableService.getMaxRowsInTable()},e.prototype.OnMessageBox=function(){this.overlayService.openConfirmationBox(this.command._mgValue.title,this.command._mgValue.str,this.command._mgValue.style)},e.prototype.OnSetTitle=function(){this.task.setTitle(this.command._mgValue.title)},e.prototype.OnRefreshPage=function(){var e=this.command._boolVal,t=this.command._obj1;e?window.location.replace(t):window.location.reload()},e.prototype.OnGetTopIndex=function(){this.command._intVal1=this.task.tableService.getTableTopIndex()},e.prototype.OnGetIsRowEditing=function(){var e=this.command._intVal1,n=this.task.getGuiRowId(e,!0);this.command._boolVal&&(t.isNullOrUndefined(n)||t.isNullOrUndefined(this.task.Records.list[n]))?this.command._boolVal=!1:this.command._boolVal=this.task.Records.list[n].isEditing},e.prototype.OnGetLastRoute=function(){this.command.resultString=V.LastRoute},e}();e.BaseMagicOverlayContainer=function(){},b([n.Input(),S("design:type",Object)],e.BaseMagicOverlayContainer.prototype,"ModalComp",void 0),b([n.Input(),S("design:type",Object)],e.BaseMagicOverlayContainer.prototype,"ModalCompParameters",void 0),b([n.Output(),S("design:type",Object)],e.BaseMagicOverlayContainer.prototype,"onClose",void 0),e.BaseMagicOverlayContainer=b([n.Input(),n.Output()],e.BaseMagicOverlayContainer);var G=function(){function e(){this.onClose=new n.EventEmitter}return e.prototype.OnClose=function(e){this.onClose.emit(e)},e}();G.ɵfac=function(e){return new(e||G)},G.ɵcmp=n.ɵɵdefineComponent({type:G,selectors:[["mg-base-alert"]],inputs:{title:"title",message:"message"},outputs:{onClose:"onClose"},decls:0,vars:0,template:function(e,t){},styles:[""]}),n.ɵsetClassMetadata(G,[{type:n.Component,args:[{selector:"mg-base-alert",template:"",styles:[""]}]}],null,{title:[{type:n.Input}],message:[{type:n.Input}],onClose:[{type:n.Output}]});var B=function(){function e(){this.onClose=new n.EventEmitter}return e.prototype.OnClose=function(){this.onClose.emit()},e}();B.ɵfac=function(e){return new(e||B)},B.ɵcmp=n.ɵɵdefineComponent({type:B,selectors:[["mg-base-alert"]],inputs:{title:"title",message:"message"},outputs:{onClose:"onClose"},decls:0,vars:0,template:function(e,t){},styles:[""]}),n.ɵsetClassMetadata(B,[{type:n.Component,args:[{selector:"mg-base-alert",template:"",styles:[""]}]}],null,{title:[{type:n.Input}],message:[{type:n.Input}],onClose:[{type:n.Output}]});var U=function(){function e(e){this.hostElement=e}return e.prototype.ngAfterViewInit=function(){this.hostElement.nativeElement.focus()},e}();U.ɵfac=function(e){return new(e||U)(n.ɵɵdirectiveInject(n.ElementRef))},U.ɵdir=n.ɵɵdefineDirective({type:U,selectors:[["","magicFocus",""]]}),n.ɵsetClassMetadata(U,[{type:n.Directive,args:[{selector:"[magicFocus]"}]}],(function(){return[{type:n.ElementRef}]}),null);var H=function(e,n){this.vcRef=e,this.resolver=n,this.vcRef._hostView.find((function(e){return null!=e&&!t.isNullOrUndefined(e.setViewContainerRef)})).setViewContainerRef(e)};H.ɵfac=function(e){return new(e||H)(n.ɵɵdirectiveInject(n.ViewContainerRef),n.ɵɵdirectiveInject(n.ComponentFactoryResolver))},H.ɵdir=n.ɵɵdefineDirective({type:H,selectors:[["","magicViewContainerRef",""]]}),n.ɵsetClassMetadata(H,[{type:n.Directive,args:[{selector:"[magicViewContainerRef]"}]}],(function(){return[{type:n.ViewContainerRef},{type:n.ComponentFactoryResolver}]}),null);var W=["overlayContainerWrapper"],z=function(){function e(e,t,r,o,i){this.componentListMagicService=e,this.loader=t,this.injector=r,this.componentFactoryResolver=o,this.changeDetectorRef=i,this.Component=null,this.Parameters={},this.onClose=new n.EventEmitter}return e.prototype.ngOnInit=function(){var e=this,t=this.componentListMagicService.getModuleRef(this.Parameters.MagicFormName);if(null==t){var n=this.componentListMagicService.getLazyLoadModuleData(this.Parameters.MagicFormName);null!=n?this.loader.load(n.modulePath+"#"+n.moduleName).then((function(n){t=n.create(e.injector),e.loadComponent(t)})):this.loadComponent(null)}else this.loadComponent(t)},e.prototype.loadComponent=function(n){var r,o=this;this.Parameters.ModalComp=this.componentListMagicService.getComponent(this.Parameters.MagicFormName,!t.isNullOrUndefined(this.Parameters.MagicFormName)),r=null!=n?n.componentFactoryResolver.resolveComponentFactory(this.Component):this.componentFactoryResolver.resolveComponentFactory(this.Component);var i=this.overlayContentViewContainerRef.createComponent(r),a=e.allowedBaseComps.get(this.OverlayTypeParam);if(i.instance instanceof a.comp)Object.assign(i.instance,this.Parameters),i.instance.onClose.subscribe((function(e){o.onClose.emit(e)}));else{var s="Provided window container should subclass of : "+a.error+"window will not work properly.";alert(s)}},e.prototype.setViewContainerRef=function(e){this.overlayContentViewContainerRef=e},e.prototype.GetRootElement=function(){return this.overlayContainerWrapperElementRef.nativeElement},e.prototype.DetectChanges=function(){this.changeDetectorRef.detectChanges()},e}();z.allowedBaseComps=new Map([[l.OverlayType.Overlay,{comp:e.BaseMagicOverlayContainer,error:"BaseMagicOverlayContainer . Overlay "}],[l.OverlayType.Alert,{comp:B,error:"BaseMagicAlertComponent. Alert "}],[l.OverlayType.ConfirmationBox,{comp:G,error:"BaseMagicConfirmComponent. Confirmation "}]]),z.ɵfac=function(e){return new(e||z)(n.ɵɵdirectiveInject(D),n.ɵɵdirectiveInject(n.NgModuleFactoryLoader),n.ɵɵdirectiveInject(n.Injector),n.ɵɵdirectiveInject(n.ComponentFactoryResolver),n.ɵɵdirectiveInject(n.ChangeDetectorRef))},z.ɵcmp=n.ɵɵdefineComponent({type:z,selectors:[["app-magic-overlay-container-wrapper"]],viewQuery:function(e,t){var r;(1&e&&n.ɵɵstaticViewQuery(W,!0),2&e)&&(n.ɵɵqueryRefresh(r=n.ɵɵloadQuery())&&(t.overlayContainerWrapperElementRef=r.first))},inputs:{Component:"Component",Parameters:"Parameters",OverlayTypeParam:"OverlayTypeParam"},outputs:{onClose:"onClose"},decls:7,vars:0,consts:[["tabIndex","0","magicFocus","",1,"overlay-container-wrapper-background",2,"width","0px","height","0px"],[1,"overlay-container-wrapper-background"],["overlayContainerWrapper",""],["magicViewContainerRef",""],["overlayContent",""],["tabIndex","0",1,"overlay-container-wrapper-background",2,"width","0px","height","0px"]],template:function(e,t){1&e&&(n.ɵɵelementStart(0,"div"),n.ɵɵelement(1,"div",0),n.ɵɵelementStart(2,"div",1,2),n.ɵɵelement(4,"div",3,4),n.ɵɵelementEnd(),n.ɵɵelement(6,"div",5),n.ɵɵelementEnd())},directives:[U,H],styles:[".overlay-container-wrapper-background[_ngcontent-%COMP%] {\n \n position: fixed;\n top: 0;\n z-index: 999;\n right: 0;\n bottom: 0;\n left: 0;\n }"]}),n.ɵsetClassMetadata(z,[{type:n.Component,args:[{selector:"app-magic-overlay-container-wrapper",template:'\n <div>\n <div class="overlay-container-wrapper-background" tabIndex="0" style="width: 0px; height: 0px;" magicFocus></div>\n <div class="overlay-container-wrapper-background" #overlayContainerWrapper>\n <div #overlayContent magicViewContainerRef>\n </div>\n </div>\n <div class="overlay-container-wrapper-background" tabIndex="0" style="width: 0px; height: 0px;" ></div>\n </div>\n ',styles:["\n .overlay-container-wrapper-background {\n /* modal background fixed across whole screen */\n position: fixed;\n top: 0;\n z-index: 999;\n right: 0;\n bottom: 0;\n left: 0;\n }\n "]}]}],(function(){return[{type:D},{type:n.NgModuleFactoryLoader},{type:n.Injector},{type:n.ComponentFactoryResolver},{type:n.ChangeDetectorRef}]}),{Component:[{type:n.Input}],Parameters:[{type:n.Input}],OverlayTypeParam:[{type:n.Input}],onClose:[{type:n.Output}],overlayContainerWrapperElementRef:[{type:n.ViewChild,args:["overlayContainerWrapper",{static:!0}]}]});var Y=function(){function e(){}return e.isConfirmBox=function(e){var t=15&e;return t===l.Styles.MSGBOX_BUTTON_OK_CANCEL||t===l.Styles.MSGBOX_BUTTON_ABORT_RETRY_IGNORE||t===l.Styles.MSGBOX_BUTTON_YES_NO_CANCEL||t===l.Styles.MSGBOX_BUTTON_YES_NO||t===l.Styles.MSGBOX_BUTTON_RETRY_CANCEL},e.convertToExcpectedResultBox=function(e,t){var n=15&e,r=l.Styles.MSGBOX_RESULT_OK;return n===l.Styles.MSGBOX_BUTTON_OK?r=l.Styles.MSGBOX_RESULT_OK:n===l.Styles.MSGBOX_BUTTON_OK_CANCEL?r=t?l.Styles.MSGBOX_RESULT_OK:l.Styles.MSGBOX_RESULT_CANCEL:n===l.Styles.MSGBOX_BUTTON_ABORT_RETRY_IGNORE?r=t?l.Styles.MSGBOX_RESULT_ABORT:l.Styles.MSGBOX_RESULT_RETRY:n===l.Styles.MSGBOX_BUTTON_YES_NO_CANCEL||n===l.Styles.MSGBOX_BUTTON_YES_NO?r=t?l.Styles.MSGBOX_RESULT_YES:l.Styles.MSGBOX_RESULT_NO:n===l.Styles.MSGBOX_BUTTON_RETRY_CANCEL&&(r=t?l.Styles.MSGBOX_RESULT_RETRY:l.Styles.MSGBOX_RESULT_CANCEL),r},e.showConfirmationBox=function(e,t,n){var r=!1,o=(l.Styles.MSGBOX_RESULT_OK,e+"\n\n"+t);return this.isConfirmBox(n)?r=confirm(o):(alert(o),r=!0),r},e}(),X=["modalheader"],K=["modalForeground"];function q(e,t){if(1&e){var r=n.ɵɵgetCurrentView();n.ɵɵelementStart(0,"button",8),n.ɵɵlistener("click",(function(){return n.ɵɵrestoreView(r),n.ɵɵnextContext().OnClose()})),n.ɵɵtext(1,"X"),n.ɵɵelementEnd()}}function $(e,t){if(1&e){var r=n.ɵɵgetCurrentView();n.ɵɵelementStart(0,"div",9,10),n.ɵɵtext(2),n.ɵɵelementStart(3,"button",11),n.ɵɵlistener("click",(function(){return n.ɵɵrestoreView(r),n.ɵɵnextContext().OnClose()})),n.ɵɵtext(4,"X"),n.ɵɵelementEnd(),n.ɵɵelementEnd()}if(2&e){var o=n.ɵɵnextContext();n.ɵɵadvance(2),n.ɵɵtextInterpolate1(" ",o.getText()," ")}}var Q=function(e){function r(t,r){var o=e.call(this)||this;return o.injector=t,o.componentFactoryResolver=r,o.ModalComp=null,o.ModalCompParameters={},o.onClose=new n.EventEmitter,o.componentRef=null,o}return C(r,e),r.prototype.ngOnInit=function(){var e=this.componentFactoryResolver.resolveComponentFactory(this.ModalComp);this.componentRef=this.modalbodyViewContainerRef.createComponent(e),Object.assign(this.componentRef.instance,this.ModalCompParameters)},r.prototype.setViewContainerRef=function(e){this.modalbodyViewContainerRef=e},r.prototype.getText=function(){return null!==this.componentRef?this.componentRef.instance.FormName():""},r.prototype.getStyle=function(){var e={};if(null!=this.componentRef){var t=this.componentRef.instance;e.width=t.Width(),e.height=t.Height(),t.IsCenteredToWindow()?e.margin="auto":(e["margin-left"]=t.X()+"px",e["margin-top"]=t.Y()+"px")}return e},r.prototype.getClientAreaStyles=function(){var e={};if(null!=this.componentRef){this.componentRef.instance;var n=this.getShowTitleBar()&&!t.isNullOrUndefined(this.headerElementRef)?this.headerElementRef.nativeElement.offsetHeight+1:0;if(!t.isNullOrUndefined(this.foregroundElementRef)){var r=this.foregroundElementRef.nativeElement.offsetHeight;e.height=r-n+"px";var o=this.foregroundElementRef.nativeElement.offsetWidth;e.width=o+"px"}e.overflow="auto"}return e},r.prototype.getShowTitleBar=function(){if(null!=this.componentRef)return this.componentRef.instance.ShowTitleBar()},r.prototype.OnClose=function(){this.onClose.emit()},r.prototype.OnBackgroundClick=function(){this.componentRef.instance.ShouldCloseOnBackgroundClick()&&this.OnClose()},r}(e.BaseMagicOverlayContainer);Q.ɵfac=function(e){return new(e||Q)(n.ɵɵdirectiveInject(n.Injector),n.ɵɵdirectiveInject(n.ComponentFactoryResolver))},Q.ɵcmp=n.ɵɵdefineComponent({type:Q,selectors:[["app-magic-overlay-container"]],viewQuery:function(e,t){var r;(1&e&&(n.ɵɵviewQuery(X,!0),n.ɵɵviewQuery(K,!0)),2&e)&&(n.ɵɵqueryRefresh(r=n.ɵɵloadQuery())&&(t.headerElementRef=r.first),n.ɵɵqueryRefresh(r=n.ɵɵloadQuery())&&(t.foregroundElementRef=r.first))},inputs:{ModalComp:"ModalComp",ModalCompParameters:"ModalCompParameters"},outputs:{onClose:"onClose"},features:[n.ɵɵInheritDefinitionFeature],decls:9,vars:4,consts:[[1,"modal-background",3,"click"],["tabindex","-1","style","float:right; border: none; background-color: transparent; outline: none; color: white",3,"click",4,"ngIf"],[1,"modal-foreground",3,"ngStyle"],["modalForeground",""],["class","modal-header",4,"ngIf"],[3,"ngStyle"],["magicViewContainerRef",""],["modalbody",""],["tabindex","-1",2,"float","right","border","none","background-color","transparent","outline","none","color","white",3,"click"],[1,"modal-header"],["modalheader",""],["tabindex","-1",2,"float","right",3,"click"]],template:function(e,t){1&e&&(n.ɵɵelementStart(0,"div"),n.ɵɵelementStart(1,"div",0),n.ɵɵlistener("click",(function(){return t.OnBackgroundClick()})),n.ɵɵtemplate(2,q,2,0,"button",1),n.ɵɵelementEnd(),n.ɵɵelementStart(3,"div",2,3),n.ɵɵtemplate(5,$,5,1,"div",4),n.ɵɵelementStart(6,"div",5),n.ɵɵelement(7,"div",6,7),n.ɵɵelementEnd(),n.ɵɵelementEnd(),n.ɵɵelementEnd()),2&e&&(n.ɵɵadvance(2),n.ɵɵproperty("ngIf",!t.getShowTitleBar()),n.ɵɵadvance(1),n.ɵɵproperty("ngStyle",t.getStyle()),n.ɵɵadvance(2),n.ɵɵproperty("ngIf",t.getShowTitleBar()),n.ɵɵadvance(1),n.ɵɵproperty("ngStyle",t.getClientAreaStyles()))},directives:[r.NgIf,r.NgStyle,H],styles:[".modal-foreground[_ngcontent-%COMP%]{background-color:#fff}.modal-background[_ngcontent-%COMP%], .modal-foreground[_ngcontent-%COMP%]{bottom:0;left:0;position:fixed;right:0;top:0}.modal-background[_ngcontent-%COMP%]{background-color:#000;opacity:.75}.modal-header[_ngcontent-%COMP%]{background-color:beige;border-bottom:2px solid red}"]}),n.ɵsetClassMetadata(Q,[{type:n.Component,args:[{selector:"app-magic-overlay-container",template:'\n <div>\n <div class="modal-background" (click)="OnBackgroundClick()">\n <button (click)="OnClose()" tabindex="-1" style="float:right; border: none; background-color: transparent; outline: none; color: white" *ngIf="!getShowTitleBar()">X</button>\n </div>\n <div #modalForeground class="modal-foreground" [ngStyle]="getStyle()">\n <div #modalheader class="modal-header" *ngIf="getShowTitleBar()">\n {{getText()}}\n <button (click)="OnClose()" style="float:right" tabindex="-1">X</button>\n </div>\n <div [ngStyle]="getClientAreaStyles()">\n <div #modalbody magicViewContainerRef>\n </div>\n </div>\n </div>\n </div>\n ',styleUrls:["./magic-overlay-container.css"]}]}],(function(){return[{type:n.Injector},{type:n.ComponentFactoryResolver}]}),{headerElementRef:[{type:n.ViewChild,args:["modalheader",{static:!1}]}],foregroundElementRef:[{type:n.ViewChild,args:["modalForeground",{static:!1}]}],ModalComp:[{type:n.Input}],ModalCompParameters:[{type:n.Input}],onClose:[{type:n.Output}]});var J=function(){function e(){}return e.prototype.getComponent=function(){return Q},e}();J.ɵfac=function(e){return new(e||J)},J.ɵprov=n.ɵɵdefineInjectable({token:J,factory:J.ɵfac}),n.ɵsetClassMetadata(J,[{type:n.Injectable}],null,null);var Z=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(B);Z.ɵfac=function(e){return ee(e||Z)},Z.ɵcmp=n.ɵɵdefineComponent({type:Z,selectors:[["sample-magic-alert-component"]],features:[n.ɵɵInheritDefinitionFeature],decls:8,vars:2,consts:[[1,"mg-message-background"],[3,"click"]],template:function(e,t){1&e&&(n.ɵɵelementStart(0,"div"),n.ɵɵelementStart(1,"div",0),n.ɵɵelementStart(2,"h2"),n.ɵɵtext(3),n.ɵɵelementEnd(),n.ɵɵelementStart(4,"p"),n.ɵɵtext(5),n.ɵɵelementEnd(),n.ɵɵelementStart(6,"button",1),n.ɵɵlistener("click",(function(){return t.OnClose()})),n.ɵɵtext(7,"OK"),n.ɵɵelementEnd(),n.ɵɵelementEnd(),n.ɵɵelementEnd()),2&e&&(n.ɵɵadvance(3),n.ɵɵtextInterpolate1(" ",t.title,""),n.ɵɵadvance(2),n.ɵɵtextInterpolate1("",t.message," "))},styles:[".mg-message-background[_ngcontent-%COMP%] {\n background-color: #F5F5F5;\n text-align: center;\n width: 40%;\n font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n padding: 17px;\n border-radius: 5px;\n text-align: center;\n margin-top: 10% ;\n margin-left: auto;\n margin-right: auto;\n border: 1px solid gray;\n }\n\n button[_ngcontent-%COMP%] {\n background-color: #8CD4F5;\n color: white;\n border: none;\n box-shadow: none;\n font-size: 17px;\n font-weight: 500;\n -webkit-border-radius: 4px;\n border-radius: 5px;\n padding: 10px 32px;\n margin: 26px 5px 0 5px;\n cursor: pointer;\n }"]});var ee=n.ɵɵgetInheritedFactory(Z);n.ɵsetClassMetadata(Z,[{type:n.Component,args:[{selector:"sample-magic-alert-component",template:'<div>\n <div class="mg-message-background">\n <h2> {{title}}</h2>\n <p>{{message}} </p>\n\n <button (click)="OnClose()">OK</button>\n </div>\n </div>',styles:["\n .mg-message-background {\n background-color: #F5F5F5;\n text-align: center;\n width: 40%;\n font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n padding: 17px;\n border-radius: 5px;\n text-align: center;\n margin-top: 10% ;\n margin-left: auto;\n margin-right: auto;\n border: 1px solid gray;\n }\n\n button {\n background-color: #8CD4F5;\n color: white;\n border: none;\n box-shadow: none;\n font-size: 17px;\n font-weight: 500;\n -webkit-border-radius: 4px;\n border-radius: 5px;\n padding: 10px 32px;\n margin: 26px 5px 0 5px;\n cursor: pointer;\n }\n "]}]}],null,null);var te=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(G);te.ɵfac=function(e){return ne(e||te)},te.ɵcmp=n.ɵɵdefineComponent({type:te,selectors:[["sample-magic-confirmation-box"]],features:[n.ɵɵInheritDefinitionFeature],decls:11,vars:2,consts:[[1,"mg-message-background"],[3,"click"],[1,"cancel",3,"click"]],template:function(e,t){1&e&&(n.ɵɵelementStart(0,"div"),n.ɵɵelementStart(1,"div",0),n.ɵɵelementStart(2,"h2"),n.ɵɵtext(3),n.ɵɵelementEnd(),n.ɵɵtext(4),n.ɵɵelement(5,"br"),n.ɵɵelement(6,"br"),n.ɵɵelementStart(7,"button",1),n.ɵɵlistener("click",(function(){return t.OnClose(!0)})),n.ɵɵtext(8,"OK"),n.ɵɵelementEnd(),n.ɵɵelementStart(9,"button",2),n.ɵɵlistener("click",(function(){return t.OnClose(!1)})),n.ɵɵtext(10,"Cancel"),n.ɵɵelementEnd(),n.ɵɵelementEnd(),n.ɵɵelementEnd()),2&e&&(n.ɵɵadvance(3),n.ɵɵtextInterpolate1(" ",t.title,""),n.ɵɵadvance(1),n.ɵɵtextInterpolate1(" ",t.message," "))},styles:[".mg-message-background[_ngcontent-%COMP%] {\n background-color: #F5F5F5;\n text-align: center;\n width: 40%;\n font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n padding: 17px;\n border-radius: 5px;\n text-align: center;\n margin-top: 10% ;\n margin-left: auto;\n margin-right: auto;\n border: 1px solid gray;\n }\n\n button[_ngcontent-%COMP%] {\n background-color: #8CD4F5;\n color: white;\n border: none;\n box-shadow: none;\n font-size: 17px;\n font-weight: 500;\n -webkit-border-radius: 4px;\n border-radius: 5px;\n padding: 10px 32px;\n margin: 26px 5px 0 5px;\n cursor: pointer;\n }\n \n button.cancel[_ngcontent-%COMP%] {\n background-color: #C1C1C1;\n }"]});var ne=n.ɵɵgetInheritedFactory(te);n.ɵsetClassMetadata(te,[{type:n.Component,args:[{selector:"sample-magic-confirmation-box",template:'<div>\n <div class="mg-message-background">\n <h2> {{title}}</h2>\n {{message}}\n <br>\n <br>\n\n <button (click)="OnClose(true)">OK</button>\n <button class="cancel" (click)="OnClose(false)">Cancel</button>\n </div>\n </div>',styles:["\n .mg-message-background {\n background-color: #F5F5F5;\n text-align: center;\n width: 40%;\n font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n padding: 17px;\n border-radius: 5px;\n text-align: center;\n margin-top: 10% ;\n margin-left: auto;\n margin-right: auto;\n border: 1px solid gray;\n }\n\n button {\n background-color: #8CD4F5;\n color: white;\n border: none;\n box-shadow: none;\n font-size: 17px;\n font-weight: 500;\n -webkit-border-radius: 4px;\n border-radius: 5px;\n padding: 10px 32px;\n margin: 26px 5px 0 5px;\n cursor: pointer;\n }\n \n button.cancel {\n background-color: #C1C1C1;\n }\n "]}]}],null,null);var re=function(){function e(){}return e.prototype.showDefaultConfirmations=function(){return!0},e.prototype.getAlertComponent=function(){return Z},e.prototype.getConfirmtionComponent=function(){return te},e}();re.ɵfac=function(e){return new(e||re)},re.ɵprov=n.ɵɵdefineInjectable({token:re,factory:re.ɵfac}),n.ɵsetClassMetadata(re,[{type:n.Injectable}],null,null);var oe=function(){function e(e,t,n,r,o){this.componentFactoryResolver=e,this.componentList=t,this.engineMagicService=n,this.overlayContainerMagicProvider=r,this.confirmationComponentsMagicProvider=o,this.overlayWindowFocusManager=null}return e.prototype.init=function(e,t){this.overlayWindowsContainerViewRef=e,this.overlayWindowFocusManager=new ie(t)},e.prototype.open=function(e,t,n){var r=this,o=null!=this.componentList.lazyLoadModulesMap&&this.componentList.lazyLoadModulesMap.hasOwnProperty(e)?null:this.componentList.getComponent(e),i={taskIdParam:t,taskDescription:n};this.createModalComponent({MagicFormName:e,ModalComp:o,ModalCompParameters:i},this.overlayContainerMagicProvider.getComponent(),l.OverlayType.Overlay).instance.onClose.subscribe((function(){var e=c.getGuiEventObj("close",null,0);e.TaskID=t,r.engineMagicService.insertEvent(e)}))},e.prototype.close=function(e){this.overlayWindowsContainerViewRef.remove(),this.overlayWindowFocusManager.popDialog();var t=c.getGuiEventObj("dispose",null,0);t.TaskID=e,this.engineMagicService.insertEvent(t)},e.prototype.openConfirmationBox=function(e,t,n){var r=this;if(this.confirmationComponentsMagicProvider.showDefaultConfirmations()){var o=Y.showConfirmationBox(e,t,n);this.finishConfirmation(n,o)}else{var i=Y.isConfirmBox(n)?this.confirmationComponentsMagicProvider.getConfirmtionComponent():this.confirmationComponentsMagicProvider.getAlertComponent(),a=Y.isConfirmBox(n)?l.OverlayType.ConfirmationBox:l.OverlayType.Alert;this.createModalComponent({title:e,message:t},i,a).instance.onClose.subscribe((function(e){r.overlayWindowsContainerViewRef.remove(),r.overlayWindowFocusManager.popDialog(),r.finishConfirmation(n,e)}))}},e.prototype.finishConfirmation=function(e,t){var n=c.getGuiEventObj("confirmationClosed",null,0);n.keyCode=Y.convertToExcpectedResultBox(e,t),this.engineMagicService.insertEvent(n)},e.prototype.createModalComponent=function(e,t,n){var r,o={Component:t,Parameters:e,OverlayTypeParam:n},i=this.componentFactoryResolver.resolveComponentFactory(z);return r=this.overlayWindowsContainerViewRef.createComponent(i),Object.assign(r.instance,o),this.overlayWindowFocusManager.pushDialog(r.instance.GetRootElement()),r.instance.DetectChanges(),r},e}();oe.ɵfac=function(e){return new(e||oe)(n.ɵɵinject(n.ComponentFactoryResolver),n.ɵɵinject(D),n.ɵɵinject(x),n.ɵɵinject(J),n.ɵɵinject(re))},oe.ɵprov=n.ɵɵdefineInjectable({token:oe,factory:oe.ɵfac}),n.ɵsetClassMetadata(oe,[{type:n.Injectable}],(function(){return[{type:n.ComponentFactoryResolver},{type:D},{type:x},{type:J},{type:re}]}),null);var ie=function(){function e(e){this.rootMagicElement=null,this.openDialogList=new Array(0),this.ignoreUtilFocusChanges=!1,this.lastFocus=null,this.focusListener=null,this.rootMagicElement=e}return e.prototype.pushDialog=function(e){0===this.openDialogList.length&&(this.focusListener=this.trapFocus.bind(this),document.addEventListener("focus",this.focusListener,!0)),this.openDialogList.push(new ae(e,document.activeElement instanceof HTMLElement?document.activeElement:null))},e.prototype.popDialog=function(){var e=this.openDialogList.pop();this.attemptFocus(e.FocusElementOnClose),0===this.openDialogList.length&&(document.removeEventListener("focus",this.focusListener,!0),this.focusListener=null)},e.prototype.trapFocus=function(e){if(!this.ignoreUtilFocusChanges&&this.openDialogList.length>0){var t=this.openDialogList[this.openDialogList.length-1].RootElement;t.contains(e.target)?this.lastFocus=e.target:(this.rootMagicElement.contains(e.target)&&(this.focusFirstDescendant(t),this.lastFocus==document.activeElement&&this.focusLastDescendant(t)),this.lastFocus=document.activeElement)}},e.prototype.focusFirstDescendant=function(e){for(var t=0;t<e.childNodes.length;t++){var n=e.childNodes[t];if(this.attemptFocus(n)||this.focusFirstDescendant(n))return!0}return!1},e.prototype.focusLastDescendant=function(e){for(var t=e.childNodes.length-1;t>=0;t--){var n=e.childNodes[t];if(this.attemptFocus(n)||this.focusLastDescendant(n))return!0}return!1},e.prototype.attemptFocus=function(e){if(!this.isFocusable(e))return!1;this.ignoreUtilFocusChanges=!0;try{e.focus()}catch(e){}return this.ignoreUtilFocusChanges=!1,document.activeElement===e},e.prototype.isFocusable=function(e){if(t.isNullOrUndefined(e))return!1;if(e.tabIndex>0||0===e.tabIndex&&null!==e.getAttribute("tabIndex"))return!0;if(e.tabIndex<0)return!1;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!=e.rel;case"INPUT":return"hidden"!=e.type&&"file"!=e.type;case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},e}(),ae=function(){function e(e,t){this.rootElement=e,this.focusElementOnClose=t}return Object.defineProperty(e.prototype,"RootElement",{get:function(){return this.rootElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"FocusElementOnClose",{get:function(){return this.focusElementOnClose},enumerable:!1,configurable:!0}),e}(),se=function(){function e(e,t){this.magic=e,this.overlayWindowService=t,this.Records=new P,this.formGroups=[],this.refreshDom=new s.Subject,this.detectChanges=new s.Subject,this.interactiveCommands=new s.Subject,this.OnSelectedRowChanged=new n.EventEmitter,this.customPropertiesSubject=new s.Subject,this.recordsCountChangeSubject=new s.Subject,this.oldPageSize=0,this.Records.setGuiTopIndex(0),this.mgInputDateFormat=null}return e.prototype.getIsLoggenIn=function(){return this.magic.getIsLoggedIn()},Object.defineProperty(e.prototype,"taskId",{get:function(){return this._taskId},set:function(e){this._taskId=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ScreenControlsData",{get:function(){return this.Records.list[0]},enumerable:!1,configurable:!0}),e.prototype.settemplate=function(e){this.template=e},e.prototype.buildScreenModeControls=function(){var e=new i.FormGroup({});for(var t in this.template)if("0"==this.template[t]){var n=new i.FormControl("");this.setStubValue(0,n,t),e.addControl(t,n)}this.ScreenModeControls=e},e.prototype.isTableControl=function(e){return"1"==this.template[e]},e.prototype.getMgInputDateFormat=function(){return this.mgInputDateFormat},e.prototype.getFormControl=function(e,n){var r,o=this.isTableControl(n)?this.formGroups[e]:this.ScreenModeControls;return t.isNullOrUndefined(o)||(o.get(n),r=o.controls[n]),r},e.prototype.setInputTextValue=function(e,n,r){this.setValue(e,n,this.ConvertValToNative(e,0,r));var o=this.getFormControl(n,e);t.isNullOrUndefined(r)||o.setValue(r)},e.prototype.buildTableRowControls=function(e){var t=new i.FormGroup({});for(var n in this.template)if("1"==this.template[n]){var r=new i.FormControl("");this.setStubValue(e,r,n),t.addControl(n,r)}this.formGroups[e]=t},e.prototype.updateRecordsBeforeCurrentView=function(e){this.Records.recordsBeforeCurrentView=e},e.prototype.setIncludesFirst=function(e){this.Records.includesFirst=e},e.prototype.setIncludesLast=function(e){this.Records.includesLast=e},e.prototype.markRowAsCreated=function(e){this.Records.markRowAsCreated(e)},e.prototype.markRowAsNotCreated=function(e){this.Records.markRowAsNotCreated(e)},e.prototype.startRowEditing=function(e){this.Records.startRowEditing(e)},e.prototype.stopRowEditing=function(e){this.Records.stopRowEditing(e)},e.prototype.isRowInRowEditing=function(e){return this.Records.isRowInRowEditing(e)},e.prototype.setIsEmptyDataView=function(e){this.Records.isEmptyDataView!==e&&(e&&this.recordsCountChangeSubject.next(0),this.Records.isEmptyDataView=e,this.tableService.refreshDataSource(),this.refreshView())},e.prototype.initTask=function(e,n){var r=this;this.Records.createFirst(),this.oldPageSize=0,this.IsStub()?this.loadData():(this.taskId=e,this.settemplate(n)),this.buildScreenModeControls(),t.isNullOrUndefined(this.subscribeRefreshDom)||this.subscribeRefreshDom.unsubscribe(),t.isNullOrUndefined(this.subscribeInteractiveCommands)||this.subscribeInteractiveCommands.unsubscribe(),this.subscribeRefreshDom=this.magic.refreshDom.pipe(p.filter((function(e){return e.TaskTag===r.taskId}))).subscribe((function(e){r.executeCommand(e)})),this.subscribeInteractiveCommands=this.magic.interactiveCommands.pipe(p.filter((function(e){return e.TaskTag===r.taskId}))).subscribe((function(e){r.executeInteractiveCommand(e)}))},e.prototype.refreshView=function(){this.detectChanges.next("")},e.prototype.insertEvent=function(e){e.TaskID=this.taskId,this.magic.insertEvent(e)},e.prototype.GetControlPictureMask=function(e){return this.magic.GetControlPictureMask(this.taskId,e)},e.prototype.ValidateControlValue=function(e,t){return this.magic.ValidateControlValue(this.taskId,e,t)},e.prototype.GetRangedValue=function(e,t){return this.magic.GetRangedValue(this.taskId,e,t)},e.prototype.GetFldRanges=function(e){return this.magic.GetFldRanges(this.taskId,e)},e.prototype.getProperty=function(e,n,r){if(t.isNullOrUndefined(r)&&(r="0"),this.IsStub())return this.getPropertyStub(this.Records.list[r],e,n);var o=this.Records.list[r];return t.isNullOrUndefined(o)?void 0:this.Records.list[r].getProperty(e,n)},e.prototype.getPropertyStub=function(e,t,n){return t in(e=e.ControlsProperties)&&n in e[t].properties?e[t].properties[n]:""},e.prototype.getStyleStub=function(e,t,n){return(e=e.ControlsProperties)[t].stylesMap.get(n)},e.prototype.getClasses=function(e,n){return t.isNullOrUndefined(n)&&(n="0"),this.Records.list[n].getControlMetadata(e).classes},e.prototype.getStyle=function(e,n,r){if(t.isNullOrUndefined(r)&&(r="0"),this.IsStub())return this.getStyleStub(this.Records.list[r],e,n);var o=this.Records.list[r].getControlMetadata(e).stylesMap.get(n);return _.magicValueGetStyle(n,o)},e.prototype.getValue=function(e,n){return t.isNullOrUndefined(n)&&(n="0"),this.Records.list.length>+n?this.Records.list[n].values[e]:""},e.prototype.getFormattedValue=function(e,t){return this.magic.GetFormattedValue(this.taskId,e,t)},e.prototype.setValue=function(e,t,n){return this.Records.list[t].setValue(e,n)},e.prototype.executeInteractiveCommand=function(e){L.executeInteractiveCommand(this,e,this.overlayWindowService),this.interactiveCommands.next(e)},e.prototype.handleSetProperty=function(e,n){var r=e.CtrlName,o=e.line||0,i=this.getGuiRowId(o,n);if(e.Operation===l.HtmlProperties.SelectedRow)e.obj1!==l.GuiConstants.NO_ROW_SELECTED&&(i=this.getGuiRowId(e.obj1,!0),this.Records.list[i].getControlMetadata(r).properties.set(e.Operation,e.line),this.tableService.selectRow(i.toString()),this.OnSelectedRowChanged.emit(i.toString()));else if(e.Operation===l.HtmlProperties.Enabled){var a=this.getFormControl(i.toString(),r);t.isNullOrUndefined(a)||(e.obj1?a.enable():a.disable()),this.Records.list[i].getControlMetadata(r).properties.set(e.Operation,e.obj1)}else this.Records.list[i].getControlMetadata(r).properties.set(e.Operation,e.obj1)},e.prototype.executeCommand=function(e){var n,r=e.line||0,o=0,i=e.CtrlName,a=this.isTableControl(i);switch(null!==e.obj&&(a=a||e.obj.IsTableChild),o=this.getGuiRowId(r,a),e.CommandType){case l.CommandType.SET_IS_LOGGED_IN:break;case l.CommandType.SET_TABLE_TOP_INDEX:this.tableService.setTableTopIndex(e.number);break;case l.CommandType.REFRESH_TASK:this.tableService.refreshDataSource(),this.refreshView();break;case l.CommandType.SET_TABLE_ITEMS_COUNT:t.isUndefined(e.number)||(this.tableService.updateTableSize(e.number),e.number>0&&this.Records.sizeUpdated&&!this.Records.isEmptyDataView&&(this.recordsCountChangeSubject.next(e.number),this.Records.sizeUpdated=!1));break;case l.CommandType.SET_RECORDS_BEFORE_CURRENT_VIEW:this.updateRecordsBeforeCurrentView(e.number);break;case l.CommandType.CREATE_TABLE_ROW:o=this.getGuiRowId(e.number,!0),this.buildTableRowControls(o),this.markRowAsCreated(o);break;case l.CommandType.SET_IS_ROW_EDITING:o=this.getGuiRowId(e.line,e.value),this.startRowEditing(o);break;case l.CommandType.SET_NOT_IS_ROW_EDITING:o=this.getGuiRowId(e.line,e.value),this.stopRowEditing(o);break;case l.CommandType.UNDO_CREATE_TABLE_ROW:this.markRowAsNotCreated(this.getGuiRowId(e.number,!0));break;case l.CommandType.SET_TABLE_INCLUDES_FIRST:this.setIncludesFirst(e.Bool1);break;case l.CommandType.SET_TABLE_INCLUDES_LAST:this.setIncludesLast(e.Bool1);break;case l.CommandType.SET_PROPERTY:this.handleSetProperty(e,a),e.Operation==l.HtmlProperties.ReadOnly&&this.refreshDom.next(e);break;case l.CommandType.PROP_SET_USER_PROPERTY:(n=this.Records.list[o].getControlMetadata(i)).userProperties.get(e.Operation)!==e.obj1&&(n.userProperties.set(e.Operation,e.obj1),this.customPropertiesSubject.next({propertyName:i+"~"+e.Operation,value:e.obj1,rowId:o}));break;case l.CommandType.PROP_SET_CUSTOM_VALIDATOR:n=this.Records.list[o].getControlMetadata(i);var s=this.getFormControl(o.toString(),i);null!=s&&(n.customValidators.set(e.Operation,e.obj1),null!=s.validator?s.setValidators([s.validator,this.customValidator(o.toString(),i)]):s.setValidators(this.customValidator(o.toString(),i)),s.updateValueAndValidity());break;case l.CommandType.SET_CLASS:(n=this.Records.list[o].getControlMetadata(i)).setClass(e.Operation,e.obj1);break;case l.CommandType.SET_STYLE:(n=this.Records.list[o].getControlMetadata(i)).setStyle(e.Operation,e.obj1);break;case l.CommandType.SET_ATTRIBUTE:(n=this.Records.list[0].getControlMetadata(i)).dataType=String.fromCharCode(e.number);break;case l.CommandType.SET_VALUE:this.Records.list[o].values[i]=e.value;var c=this.getFormControl(o.toString(),i);t.isNullOrUndefined(c)||c.setValue(this.ConvertValFromNative(i,e.line,e.value));break;case l.CommandType.CREATE_SUB_FORM:this.mgSubformService.addSubformComp(e.CtrlName,e.userDropFormat.toString(),e.str,e.fileName,e.contextID,e.params,e.Bool1);break;case l.CommandType.CLOSE_SUB_FORM:this.mgSubformService.deleteSubformComp(e.CtrlName,e.userDropFormat.toString());break;case l.CommandType.SET_EMPTY_DATAVIEW:this.setIsEmptyDataView(e.Bool1);break;case l.CommandType.SET_FOCUS:this.refreshDom.next(e)}},e.prototype.customValidator=function(e,t){var n=this;return function(r){var o,i,a,s;s=n.Records.list[e].getControlMetadata(t);try{for(var c=E(s.customValidators.keys()),l=c.next();!l.done;l=c.next()){var u=l.value;if(!s.customValidators.get(u).isValid())return(a={})[u]=!0,a}}catch(e){o={error:e}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}return null}},e.prototype.ConvertValToNative=function(e,t,n){switch(this.Records.list[0].getControlMetadata(e).dataType){case u.StorageAttribute.BOOLEAN:if("string"==typeof n){var r=this.GetFldRanges(e),o=r.indexOf(","),i=r.substr(0,o),a=r.substr(o+1);return!!d.NString.Equals(n,i,!0)||!d.NString.Equals(n,a,!0)&&n}return n;case u.StorageAttribute.TIME:if("string"==typeof n){var s=n.indexOf(":",0),c=+n.substr(0,s),l=+n.substr(s+1,2),p=0;n.length>5&&(s=n.indexOf(":",s+1))>=0&&(p=+n.substr(s+1,2)),n.indexOf("PM")>0&&(c+=12);var m=new Date;return m.setHours(c),m.setMinutes(l),m.setSeconds(p),m}return n;case u.StorageAttribute.NUMERIC:return null===n?0:n;default:return n}},e.prototype.ConvertValFromNative=function(e,t,n){switch(this.Records.list[0].getControlMetadata(e).dataType){case u.StorageAttribute.TIME:if(n instanceof Date){var r=new d.StringBuilder,o=n.getHours()>9?"{0}":"0{0}";return r.AppendFormat(o,n.getHours().toString()),r.Append(":"),o=n.getMinutes()>9?"{0}":"0{0}",r.AppendFormat(o,n.getMinutes().toString()),n.getSeconds()>0&&(r.Append(":"),o=n.getSeconds()>9?"{0}":"0{0}",r.AppendFormat(o,n.getSeconds().toString())),r.ToString()}return n;case u.StorageAttribute.BOOLEAN:var i;if(i=this.Records.list[0].getControlMetadata(e),"boolean"==typeof n&&i.rangeValidator){var a=this.GetFldRanges(e),s=a.indexOf(","),c=a.substr(0,s),l=a.substr(s+1);return n?c:l}return n;default:return n}},e.prototype.resize=function(e,t){var n=c.getGuiEventObj("resize","table",0);n.PageSize=e,n.Line=t,this.insertEvent(n)},e.prototype.onScrollDown=function(){if(!this.Records.includesLast){var e=c.getGuiEventObj("getRows","table",0);e.Line=this.formGroups.length,this.insertEvent(e)}},e.prototype.setTitle=function(e){this.mgTitleService.setTitle(e)},e.prototype.getGuiRowId=function(e,t){return t?e+this.Records.recordsBeforeCurrentView:0},e.prototype.getDvRowId=function(e){return e-this.Records.recordsBeforeCurrentView},e.prototype.dispose=function(){this.refreshDom.complete(),this.detectChanges.complete(),this.subscribeInteractiveCommands.unsubscribe(),this.subscribeRefreshDom.unsubscribe(),this.interactiveCommands.complete(),this.customPropertiesSubject.complete(),this.OnSelectedRowChanged.complete()},e.prototype.onComboboxSelectionChanged=function(e,n,r){var o=c.getGuiEventObj("selectionchanged",n,r);if("number"==typeof e)o.Value=e;else if(t.isNullOrUndefined(e.target))o.Value=e.value;else{for(var i=new Array(e.target.selectedOptions.length),a=0;a<e.target.selectedOptions.length;a++)i[a]=e.target.selectedOptions[a].index;o.Value=i.join(",")}this.insertEvent(o)},e.prototype.onListBoxSelectionChanged=function(e,n){for(var r,o=c.getGuiEventObj("selectionchanged",n,0),i=(r=t.isNullOrUndefined(e.target)?e.source.selectedOptions.selected:e.target.selectedOptions).length,a=new Array(i),s=0;s<i;s++)t.isNullOrUndefined(e.target)?a[s]=r[s].value:a[s]=r[s].index;o.Value=a,this.insertEvent(o)},e.prototype.onCheckChanged=function(e,t,n){void 0===n&&(n=0);var r=c.getGuiEventObj("selectionchanged",t,n);"boolean"==typeof e?r.Value=e:void 0===e.target?r.Value=e.checked:r.Value=e.target.checked,this.insertEvent(r)},e.prototype.mgOnTabSelectionChanged=function(e,t){var n=c.getGuiEventObj("selectionchanged",e,0);n.Value=t.toString(),this.insertEvent(n)},e.prototype.mgOnRadioSelectionChanged=function(e,t){var n=this.getFormControl("0",t),r=c.getGuiEventObj("selectionchanged",t,0);"string"!=typeof n.value?r.Value=n.value.index:r.Value=n.value,this.insertEvent(r)},e.prototype.close=function(){this.insertEvent(c.getGuiEventObj("close",null,0))},e.prototype.IsStub=function(){return this.magic.isStub},e.prototype.saveData=function(e){this.magic.saveData(e)},e.prototype.createData=function(){var e={records:this.Records,template:this.template},t="loadData():any {\n let stubData = "+JSON.stringify(e)+";\n this.loadStubData(stubData);}";console.log(t),this.saveData(t)},e.prototype.loadStubData=function(e){this.Records=e.records,this.settemplate(e.template),this.taskId="1";for(var t=0;t<this.Records.list.length;t++)this.buildTableRowControls(t)},e.prototype.loadData=function(){alert("Please, overwrite method loadData")},e.prototype.setStubValue=function(e,t,n){if(this.IsStub())try{var r=this.Records.list[e].values[n];t.setValue(r)}catch(e){}},e}();se.ɵfac=function(e){return new(e||se)(n.ɵɵinject(x),n.ɵɵinject(oe))},se.ɵprov=n.ɵɵdefineInjectable({token:se,factory:se.ɵfac}),n.ɵsetClassMetadata(se,[{type:n.Injectable}],(function(){return[{type:x},{type:oe}]}),null);var ce=function(){function e(e,t){this.componentList=e,this.task=t,this.shouldOpenFieldTextEditor=!0}return e.prototype.refreshDataSource=function(){},e.prototype.getPageSize=function(){return 10},e.prototype.getMaxRowsInTable=function(){return this.task.Records.list.length},e.prototype.selectRow=function(e){this.selectedItem=e},e.prototype.getSelectedRow=function(){return this.selectedItem},e.prototype.selectedRow=function(){return null},e.prototype.selectPage=function(e){},e.prototype.OpenDialogForControl=function(e){return"MAT-SELECT"!==e.tagName&&"MAT-CHECKBOX"!==e.tagName&&"INPUT"!==e.tagName&&"SELECT"!==e.tagName},e.prototype.getDialog=function(){return null},e.prototype.onScrollDown=function(){this.task.onScrollDown()},e.prototype.sortData=function(e){},e.prototype.mgOnPaginateChange=function(e){},e.prototype.mgOptionChanged=function(e){},e.prototype.updateTableSize=function(e){0===e&&(e=1,this.task.Records.clearFirstTableRecord(this.task.template)),this.task.formGroups.length=e,this.task.Records.updateSize(e),this.task.setIncludesFirst(!1)},e.prototype.setTableTopIndex=function(e){this.task.Records.includesFirst||e++,this.task.Records.setGuiTopIndex(e)},e.prototype.getTableTopIndex=function(){var e=this.task.Records.getGuiTopIndex();return this.task.Records.includesFirst||e--,e},e}();ce.ɵfac=function(e){return new(e||ce)(n.ɵɵinject(D),n.ɵɵinject(se))},ce.ɵprov=n.ɵɵdefineInjectable({token:ce,factory:ce.ɵfac}),n.ɵsetClassMetadata(ce,[{type:n.Injectable}],(function(){return[{type:D},{type:se}]}),null);var le=function(){function e(e){this.titleService=e}return e.prototype.setTitle=function(e){this.titleService.setTitle(e)},e}();le.ɵfac=function(e){return new(e||le)(n.ɵɵinject(m.Title))},le.ɵprov=n.ɵɵdefineInjectable({token:le,factory:le.ɵfac}),n.ɵsetClassMetadata(le,[{type:n.Injectable}],(function(){return[{type:m.Title}]}),null);var ue=function(){function e(e){this.task=e,this.Logger=null,this.Logger=u.Logger.Instance}return e.prototype.checkIsReadOnly=function(e){var t;return null===(t=this.task.Records.list[0].getControlMetadata(e)).properties.get(l.HtmlProperties.ReadOnly)||!0!==t.properties.get(l.HtmlProperties.ReadOnly)},e.prototype.getText=function(e,t){return this.task.getProperty(e,l.HtmlProperties.Text,t)},e.prototype.getTabpageText=function(e,t){var n=this.task.getProperty(e,l.HtmlProperties.ItemsList);return void 0!==n?n[t].displayValue:""},e.prototype.getImage=function(e,t){return this.task.getProperty(e,l.HtmlProperties.Image,t)},e.prototype.isImageExists=function(e,n){var r=this.task.getProperty(e,l.HtmlProperties.Image,n);return!t.isNullOrUndefined(r)},e.prototype.getClasses=function(e,t){return this.task.getClasses(e,t)},e.prototype.getStyle=function(e,t,n){return this.task.getStyle(e,t,n)},e.prototype.getVisible=function(e,t){return this.getProperty(e,l.HtmlProperties.Visible,t)?"visible":"hidden"},e.prototype.getNumericPicture=function(e){if(t.isNullOrUndefined(e))return null;var n=new l.PIC(e,u.StorageAttribute.NUMERIC,0),r={};(r.prefix="",n.getPosPref_().length>0&&n.getNegPref_().length>0)&&("-"+n.getPosPref_()==n.getNegPref_()&&(r.prefix=n.getPosPref_()));return n.getPosSuff_().length>0?r.suffix=n.getPosSuff_():r.suffix="",n.isNegative()?r.allowNegative=!0:r.allowNegative=!1,n.getDec()>=0&&(r.precision=n.getDec()),n.isLeft()&&(r.align="left"),r.decimal=l.GuiEnvironment.Environment.GetDecimal(),n.withComa()?r.thousands=l.GuiEnvironment.Environment.GetThousands():r.thousands="",n.getWholes()&&(r.wholes=n.getWholes()),r},e.prototype.getMustInput=function(e,t){return this.getProperty(e,l.HtmlProperties.MustInput,t)?"true":"false"},e.prototype.isDisabled=function(e,t){return!0!==this.getProperty(e,l.HtmlProperties.Enabled,t)||null},e.prototype.getProperty=function(e,t,n){return this.task.getProperty(e,t,n)},e.prototype.getTitle=function(e,t){return this.task.getProperty(e,l.HtmlProperties.Tooltip,t)},e.prototype.getZoomButtonTitle=function(e,t){return this.task.getProperty(e,l.HtmlProperties.ZoomButtonTooltip,t)},e.prototype.getSelectedValue=function(e,t){return this.task.getProperty(e,l.HtmlProperties.SelectedValue,t)},e.prototype.getPlaceholder=function(e,t){return this.task.getProperty(e,l.HtmlProperties.PlaceHolder,t)},e.prototype.getType=function(e,t){return this.task.getProperty(e,l.HtmlProperties.Password,t)?"password":"text"},e.prototype.getTabIndex=function(e,t){return this.task.getProperty(e,l.HtmlProperties.TabIndex,t)},e.prototype.getValue=function(e,t){return this.task.getValue(e,t)},e.prototype.getFormattedValue=function(e,t){var n=this.task.getValue(e,t);return n=this.task.getFormattedValue(e,n)},e.prototype.getPicture=function(e,n){if(t.isNullOrUndefined(e))return null;var r=this.task.GetControlPictureMask(e);return null!=r?r.getFormat().toString():null},e.prototype.getCustomProperty=function(e,t,n){if(-1==e.indexOf("~"))return this.getCustomProperty_1(e,t,n);var r=e.split("~")[0],o=e.split("~")[1];return this.getCustomProperty_1(r,o,t)},e.prototype.getCustomProperty_1=function(e,n,r){var o;t.isNullOrUndefined(r)&&(r="0");var i=this.task.Records.list[r];if(t.isNullOrUndefined(i));else{var a=i.getControlMetadata(e);a.userProperties.has(n)&&(o=a.userProperties.get(n))}return o},e.prototype.getItemListValues=function(e,t){return this.getProperty(e,l.HtmlProperties.ItemsList,t)},e.prototype.getFilteredList=function(e,n){t.isNullOrUndefined(n)&&(n="0");var r=this.getItemListValues(e,n),o=this.task.getFormControl(n,e).value;return null!==o&&""!==o&&r instanceof Array?(o=o.toLowerCase(),r.filter((function(e){return e.displayValue.toLowerCase().includes(o)}))):r},e.prototype.getDisplayValue=function(e,n){var r="",o=this.getProperty(e,l.HtmlProperties.ItemsList,n),i=this.task.getValue(e,n);return i>=0&&i<o.length&&!t.isNullOrUndefined(o[i])&&(r=o[i].displayValue),r},e.prototype.isOptionSelected=function(e,t){var n,r,o=this.task.getValue(t,"0");try{for(var i=E(o),a=i.next();!a.done;a=i.next()){if(a.value===e)return!0}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e.prototype.isTabPageSelected=function(e,t){return this.task.getProperty(e,l.HtmlProperties.SelectedValue)==t-1},e.prototype.isTabPageLayerSelected=function(e,t){return this.task.getProperty(e,l.HtmlProperties.SelectedLayer)==t-1},e.prototype.getTabSelectedIndex=function(e){return this.task.getProperty(e,l.HtmlProperties.SelectedValue)},e.prototype.ifRowCreated=function(e){if(null==e)return!1;var n="number"==typeof e?e.toString():e.rowId,r=this.getFormGroupByRow(n);return!t.isNullOrUndefined(r)},e.prototype.getFormGroupByRow=function(e){return this.task.formGroups[e]},e.prototype.isRowSelected=function(e,t){return this.task.getProperty(e,l.HtmlProperties.SelectedRow,"0")==t},e.prototype.isRowInRowEditing=function(e){var t;return t="number"==typeof e?e.toString():e.rowId,this.task.isRowInRowEditing(t)},e.prototype.isCurrentInRowEditing=function(){var e=this.task.tableService.getSelectedRow();return this.task.isRowInRowEditing(e)},e.prototype.guiTopIndex=function(){return this.task.tableService.getTableTopIndex()},e.prototype.getErrMsg=function(e,t){var n,r,o=this.task.getFormControl(t,e);if(o.hasError("required"))return"Control must be updated.";if(o.hasError("pattern"))return"Required pattern is : "+o.errors.pattern.requiredPattern;if(o.hasError("rangevalidator"))return o.errors.rangevalidator.errorMsg;if(o.hasError("maxlength"))return"Max length allowed is : "+o.errors.maxlength.requiredLength;if(o.hasError("max"))return"Max value alllowed is : "+o.errors.max.max;var i=this.task.Records.list[t].getControlMetadata(e);try{for(var a=E(i.customValidators.keys()),s=a.next();!s.done;s=a.next()){var c=s.value;if(o.hasError(c))return i.customValidators.get(c).getErrMessage()}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return"unknown error"},e.prototype.setValueToControl=function(e,t,n){void 0===n&&(n=!0);var r=c.getGuiEventObj("setexternalvalue",e,0);r.externalValue=t,r.param=n,this.task.insertEvent(r)},e.prototype.isDataviewEmpty=function(){return this.task.Records.isEmptyDataView},e.prototype.simulateClick=function(e,t){void 0===t&&(t=0),this.task.insertEvent(c.getGuiEventObj("click",e,t))},e.prototype.isLoggedIn=function(){return this.task.getIsLoggenIn()},e.prototype.GetFormRecords=function(){var e,n=this;if(!t.isNullOrUndefined(this.task.Records)&&this.task.Records.list.length>0){var r=this.task.Records.list,o=new Array;for(var i in this.task.template)"1"==this.task.template[i]&&o.push(i);e=new Array,o.length>0&&r.forEach((function(t){if(n.task.Records.isRowCreated(0)){var r={rowId:0};o.forEach((function(e){r[e]=t.values[e]})),e.push(r)}}))}return e},e.prototype.SetCookie=function(e,t,n,r,o,i,a){c.CookieService.setCookie(e,t,n,r,o,i,a)},e.prototype.GetCookie=function(e){return c.CookieService.getCookie(e)},e.prototype.DeleteCookie=function(e){return c.CookieService.deleteCookie(e)},e}();ue.ɵfac=function(e){return new(e||ue)(n.ɵɵinject(se))},ue.ɵprov=n.ɵɵdefineInjectable({token:ue,factory:ue.ɵfac}),n.ɵsetClassMetadata(ue,[{type:n.Injectable}],(function(){return[{type:se}]}),null);var pe=function(e,t,n,r,o){this.task=e,this.subformService=t,this.tableService=n,this.titleService=r,this.mgAccessorService=o,e.tableService=n,e.mgSubformService=t,e.mgTitleService=r,e.mgAccessorService=o};pe.ɵfac=function(e){return new(e||pe)(n.ɵɵinject(se),n.ɵɵinject(N),n.ɵɵinject(ce),n.ɵɵinject(le),n.ɵɵinject(ue))},pe.ɵprov=n.ɵɵdefineInjectable({token:pe,factory:pe.ɵfac}),n.ɵsetClassMetadata(pe,[{type:n.Injectable}],(function(){return[{type:se},{type:N},{type:ce},{type:le},{type:ue}]}),null);var de=function(){function e(e,t){this.ref=e,this.magicServices=t,this.magicProperties=u.MagicProperties}return Object.defineProperty(e.prototype,"task",{get:function(){return this.magicServices.task},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mgSub",{get:function(){return this.magicServices.subformService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tableService",{get:function(){return this.magicServices.tableService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mg",{get:function(){return this.magicServices.mgAccessorService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"taskId",{get:function(){return this.task.taskId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenFormGroup",{get:function(){return this.task.ScreenModeControls},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.task.detectChanges.pipe().subscribe((function(t){e.ref.detectChanges()}));this.task.initTask(this.taskIdParam,this.taskDescription),this.createFormControlsAccessor(this.screenFormGroup),this.setInputDateFormat(),this.task.customPropertiesSubject.pipe().subscribe((function(t){e.PropertyChanged(t.propertyName,t.rowId,t.value)})),this.task.recordsCountChangeSubject.pipe().subscribe((function(t){e.RecordsCountChanged(t)}))},e.prototype.createFormControlsAccessor=function(e){},e.prototype.setInputDateFormat=function(){},e.prototype.PropertyChanged=function(e,t,n){},e.prototype.RecordsCountChanged=function(e){},e.prototype.ngAfterViewInit=function(){this.mgSub.init()},e.prototype.ngAfterContentChecked=function(){this.task.oldPageSize!=this.tableService.getPageSize()&&(this.task.resize(this.tableService.getPageSize(),0),this.task.oldPageSize=this.tableService.getPageSize())},e.prototype.ngOnDestroy=function(){this.task.dispose()},e}();de.ɵfac=function(e){return new(e||de)(n.ɵɵdirectiveInject(n.ChangeDetectorRef),n.ɵɵdirectiveInject(pe))},de.ɵcmp=n.ɵɵdefineComponent({type:de,selectors:[["task-magic"]],inputs:{taskIdParam:"taskIdParam",taskDescription:"taskDescription"},features:[n.ɵɵProvidersFeature([se,N,ce])],decls:0,vars:0,template:function(e,t){},encapsulation:2}),n.ɵsetClassMetadata(de,[{type:n.Component,args:[{selector:"task-magic",providers:[se,N,ce],template:""}]}],(function(){return[{type:n.ChangeDetectorRef},{type:pe}]}),{taskIdParam:[{type:n.Input}],taskDescription:[{type:n.Input}]});var me=function(){function e(e,t){this._task=e,this.element=t,this.rowChangedSubscriber=null,this.htmlElement=this.element.nativeElement}return e.prototype.ngOnInit=function(){var e=this;this.rowChangedSubscriber=this._task.OnSelectedRowChanged.pipe(p.filter((function(t){return t===e.rowId}))).subscribe((function(t){e.isInView(e.htmlElement)||e.htmlElement.scrollIntoView()}))},e.prototype.isInView=function(e){var t=e.getBoundingClientRect(),n=e.parentElement.getBoundingClientRect();return t.top>=n.top&&t.bottom<=n.bottom},e.prototype.ngOnDestroy=function(){null!==this.rowChangedSubscriber&&this.rowChangedSubscriber.unsubscribe()},e.prototype.onClick=function(e){""!=this.rowId&&(this._task.insertEvent(c.getGuiEventObj("click","magicRow",+this.rowId)),fe.noOfAutoCompleteBoxesOpened<1&&(event.cancelBubble=!0))},e}();me.ɵfac=function(e){return new(e||me)(n.ɵɵdirectiveInject(se),n.ɵɵdirectiveInject(n.ElementRef))},me.ɵdir=n.ɵɵdefineDirective({type:me,selectors:[["","magicRow",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("click",(function(e){return t.onClick(e)}))},inputs:{rowId:["magicRow","rowId"]}}),n.ɵsetClassMetadata(me,[{type:n.Directive,args:[{selector:"[magicRow]"}]}],(function(){return[{type:se},{type:n.ElementRef}]}),{rowId:[{type:n.Input,args:["magicRow"]}],onClick:[{type:n.HostListener,args:["click",["$event"]]}]});var fe=function(){function e(e,t,n,r,o){this._task=e,this.element=t,this.renderer=n,this.vcRef=r,this.magicRow=o,this.eventHandlers={},this.eventsOnlyVal=!1,this.htmlElement=this.element.nativeElement,null!=o&&(this.rowId=o.rowId)}return Object.defineProperty(e.prototype,"magic",{set:function(e){this.id=e,this.selector="magic"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"eventsOnly",{set:function(e){console.log("eventsOnly"),this.eventsOnlyVal=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"task",{get:function(){return this._task},enumerable:!1,configurable:!0}),e.prototype.regEvents=function(){var t=this;this.eventHandlers.focusin=this.OnFocus.bind(this),Object.keys(this.eventHandlers).forEach((function(e){t.focusUnlistener=t.renderer.listen(t.htmlElement,e,t.eventHandlers[e])}));["click","mousedown","dblclick"].forEach((function(n){t.renderer.listen(t.htmlElement,n,(function(r){var o=!1;t.htmlElement instanceof HTMLButtonElement&&(o=!0),t.task.insertEvent(c.getGuiEventObj(n,t.id,+t.rowId,o)),e.noOfAutoCompleteBoxesOpened<1&&(r.cancelBubble=!0)}))})),this.renderer.listen(this.htmlElement,"change",(function(e){var n=c.getGuiEventObj("selectionchanged",t.id,+t.rowId);void 0!==event.target.selectedIndex&&(n.Value=event.target.selectedIndex.toString(),e.cancelBubble=!0,t.task.insertEvent(n))})),f.fromEvent(this.htmlElement,"input").pipe(p.map((function(e){return e.target.value})),p.debounceTime(200)).subscribe((function(e){if(t.task.getProperty(t.id,l.HtmlProperties.BindingLevel,t.rowId)===u.BindingLevel.Character){var n=t.task.Records.list[0].getControlMetadata(t.id).dataType;n!==u.StorageAttributeType.Date&&n!=u.StorageAttributeType.Time&&t.task.mgAccessorService.setValueToControl(t.id,e,!0)}})),this.renderer.listen(this.htmlElement,"keydown",(function(n){var r=c.getGuiEventObj("keydown",t.id,+t.rowId);r.modifiers=l.Modifiers.MODIFIER_NONE,n.altKey&&n.keyCode!==l.GuiConstants.KEY_ALT?r.modifiers=l.Modifiers.MODIFIER_ALT:n.ctrlKey&&n.keyCode!==l.GuiConstants.KEY_CTRL&&(r.modifiers=l.Modifiers.MODIFIER_CTRL);var o=n.keyCode===l.GuiConstants.KEY_PG_UP||n.keyCode===l.GuiConstants.KEY_PG_DOWN||n.keyCode===l.GuiConstants.KEY_LEFT||n.keyCode===l.GuiConstants.KEY_RIGHT||n.keyCode===l.GuiConstants.KEY_UP||n.keyCode===l.GuiConstants.KEY_DOWN||n.keyCode===l.GuiConstants.KEY_ESC||n.keyCode===l.GuiConstants.KEY_HOME||n.keyCode===l.GuiConstants.KEY_END||n.keyCode===l.GuiConstants.KEY_RETURN||n.keyCode>=l.GuiConstants.KEY_F1&&n.keyCode<=l.GuiConstants.KEY_F12;(r.modifiers!==l.Modifiers.MODIFIER_NONE||o)&&(r.keyCode=n.keyCode,(n.keyCode!==l.GuiConstants.KEY_ESC||n.keyCode===l.GuiConstants.KEY_ESC&&!e.opened&&e.noOfAutoCompleteBoxesOpened<1)&&(n.cancelBubble=!0),t.task.insertEvent(r))}))},e.prototype.OnFocus=function(){this.task.insertEvent(c.getGuiEventObj("focus",this.id,+this.rowId)),event.cancelBubble=!0},e.prototype.IsSameElement=function(e){var n=e.line;return this.task.isTableControl(e.CtrlName)&&(n=this.task.getGuiRowId(n,!0)),e.CtrlName===this.id&&(n===+this.rowId||0===n&&t.isNullOrUndefined(this.rowId))},e.prototype.IsSameComponent=function(e){return e.controlName===this.id},e.prototype.regUpdatesUI=function(){var e=this;this.subscribeRefreshDom=this.task.refreshDom.pipe(p.filter((function(t){return e.IsSameElement(t)}))).subscribe((function(n){var r=n;t.isNullOrUndefined(e.rowId)&&(e.rowId="0");try{e.eventsOnlyVal||e.handleCommand(r)}catch(e){console.dir(e)}})),this.subscribeInteractiveCommands=this.task.interactiveCommands.pipe(p.filter((function(t){return e.IsSameComponent(t)}))).subscribe((function(t){e.handleInteractiveCommands(t)}))},e.prototype.ngOnInit=function(){this.regEvents(),this.regUpdatesUI()},e.prototype.handleCommand=function(e){switch(e.CommandType){case l.CommandType.SET_PROPERTY:this.handleSetProperty(e);break;case l.CommandType.SET_FOCUS:this.focusUnlistener(),e.obj.ConnectedControl&&this.htmlElement instanceof HTMLButtonElement||this.htmlElement.focus(),this.focusUnlistener=this.renderer.listen(this.htmlElement,"focusin",this.eventHandlers.focusin)}},e.prototype.handleInteractiveCommands=function(e){if(e._commandType===l.InteractiveCommandType.CALL_JS){var n=e._str,r=e.arguments,o=this.vcRef._hostView.find((function(e){return e instanceof de})),i="";try{t.isNullOrUndefined(o[n])?console.error("Instance method "+n+" does not exists"):i=o[n].apply(o,r)}catch(e){console.error(e.message)}e.resultString=i}},e.prototype.handleSetProperty=function(e){if(e.Operation===l.HtmlProperties.ReadOnly)1!=e.obj1?this.renderer.removeAttribute(this.htmlElement,e.Operation):this.renderer.setAttribute(this.htmlElement,e.Operation,e.str)},e.prototype.ngOnDestroy=function(){this.subscribeRefreshDom.unsubscribe()},e}();fe.opened=!1,fe.noOfAutoCompleteBoxesOpened=0,fe.ɵfac=function(e){return new(e||fe)(n.ɵɵdirectiveInject(se),n.ɵɵdirectiveInject(n.ElementRef),n.ɵɵdirectiveInject(n.Renderer2),n.ɵɵdirectiveInject(n.ViewContainerRef),n.ɵɵdirectiveInject(me,8))},fe.ɵdir=n.ɵɵdefineDirective({type:fe,selectors:[["","magic",""]],inputs:{magic:"magic",eventsOnly:"eventsOnly",rowId:"rowId"}}),n.ɵsetClassMetadata(fe,[{type:n.Directive,args:[{selector:"[magic]"}]}],(function(){return[{type:se},{type:n.ElementRef},{type:n.Renderer2},{type:n.ViewContainerRef},{type:me,decorators:[{type:n.Optional}]}]}),{magic:[{type:n.Input,args:["magic"]}],eventsOnly:[{type:n.Input,args:["eventsOnly"]}],rowId:[{type:n.Input}]});var he=function(e){function t(t,n,r,o,i){return e.call(this,t,n,r,o,i)||this}return C(t,e),Object.defineProperty(t.prototype,"magic",{set:function(e){this.id=e,this.selector="magicnc"},enumerable:!1,configurable:!0}),t.prototype.regEvents=function(){var t=this;if(e.prototype.regEvents.call(this),this.htmlElement instanceof HTMLSelectElement&&this.htmlElement.addEventListener("change",(function(e){var n=c.getGuiEventObj("selectionchanged",t.id,0);n.Value=event.target.selectedIndex.toString(),t.task.insertEvent(n)})),this.isRadio()&&this.htmlElement.addEventListener("change",(function(e){t.task.getFormControl("0",t.id);var n=c.getGuiEventObj("selectionchanged",t.id,0);n.Value=e.target.value,t.task.insertEvent(n)})),this.isTabControl())for(var n=this.htmlElement.children[0],r=c.getGuiEventObj("selectionchanged",this.id,0),o=0;o<n.children.length;o++)n.children[o].addEventListener("click",(function(e){r.Value=(e.currentTarget.getAttribute("layer")-1).toString(),t.task.insertEvent(r)}))},t.prototype.isTabControl=function(){return this.htmlElement instanceof HTMLDivElement&&"magicTabControl"===this.htmlElement.children[0].getAttribute("magicMark")},t.prototype.isRadio=function(){return this.htmlElement instanceof HTMLDivElement&&"magicRadio"===this.htmlElement.children[0].getAttribute("magicMark")},t.prototype.handleCommand=function(t){switch(e.prototype.handleCommand.call(this,t),t.CommandType){case l.CommandType.SET_CLASS:var n=this._task.Records.list[0].getControlMetadata(this.id);""!=n.removedClass&&(this.htmlElement.classList.remove(n.removedClass),n.removedClass=""),this.htmlElement.classList.add(t.obj1);break;case l.CommandType.SET_VALUE:this.htmlElement instanceof HTMLLabelElement&&(this.htmlElement.innerText=t.value),this.htmlElement instanceof HTMLSelectElement&&(this.htmlElement.value=t.value),this.htmlElement instanceof HTMLAnchorElement&&(this.htmlElement.text=t.value),this.htmlElement instanceof HTMLInputElement&&("checkbox"===this.htmlElement.type?this.htmlElement.checked=t.value:this.htmlElement.value=t.value),this.htmlElement instanceof HTMLButtonElement&&(this.htmlElement.innerHTML=t.value);break;case l.CommandType.SET_PROPERTY:this.handleSetProperty(t);break;case l.CommandType.SET_STYLE:var r=_.magicValueGetStyle(t.Operation,t.obj1),o=_.MagicPropertyToHtmlAttributeMap.get(t.Operation);this.htmlElement.setAttribute("style",o+":"+r)}},t.prototype.handleSetProperty=function(t){var n,r;switch(e.prototype.handleSetProperty.call(this,t),t.Operation){case l.HtmlProperties.Text:this.htmlElement instanceof HTMLLabelElement&&(this.htmlElement.innerText=t.obj1);break;case l.HtmlProperties.Image:this.htmlElement instanceof HTMLImageElement?this.htmlElement.src=t.obj1:this.htmlElement.setAttribute("src",t.obj1);break;case l.HtmlProperties.ItemsList:if(this.htmlElement instanceof HTMLSelectElement){for(var o=this.htmlElement.length-1;o>=0;o--)this.htmlElement.remove(o);try{for(var i=E(t.obj1),a=i.next();!a.done;a=i.next()){var s=a.value,c=document.createElement("option");c.text=s.displayValue,c.value=s.index,this.htmlElement.add(c)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}else if(this.isTabControl()&&this.htmlElement.children.length>0){var u=this.htmlElement.children[0];for(o=0;o<u.children.length;o++)u.children[o]instanceof HTMLButtonElement&&(u.children[o].innerText=t.obj1[o].displayValue)}break;case l.HtmlProperties.Visible:this.htmlElement.setAttribute("style","visibility:"+(t.obj1?"visible":"hidden"));break;case l.HtmlProperties.Enabled:!1===t.obj1?this.htmlElement.setAttribute("disabled","true"):this.htmlElement.removeAttribute("disabled");break;case l.HtmlProperties.TabIndex:this.htmlElement.setAttribute(t.Operation,t.obj1);break;case l.HtmlProperties.SelectedValue:if(this.htmlElement instanceof HTMLSelectElement)this.htmlElement.value=t.obj1;else if(this.isTabControl()&&this.htmlElement.children.length>0)for(u=this.htmlElement.children[0],o=0;o<u.children.length;o++){var p=u.children[o],d=p.getAttribute("layer")-1;if(p instanceof HTMLButtonElement)d==t.obj1?p.classList.add("tab_button_active"):p.classList.remove("tab_button_active");else{var m=d==t.obj1?"display: inline":"display: none";p.setAttribute("style",m)}}break;case l.HtmlProperties.PlaceHolder:this.htmlElement.setAttribute("placeholder",t.obj1);break;case l.HtmlProperties.Tooltip:this.htmlElement.setAttribute("title",t.obj1);break;case l.HtmlProperties.Password:!1===t.obj1?this.htmlElement.setAttribute("type","text"):this.htmlElement.setAttribute("type","password")}},t}(fe);he.ɵfac=function(e){return new(e||he)(n.ɵɵdirectiveInject(se),n.ɵɵdirectiveInject(n.ElementRef),n.ɵɵdirectiveInject(n.Renderer2),n.ɵɵdirectiveInject(n.ViewContainerRef),n.ɵɵdirectiveInject(me,8))},he.ɵdir=n.ɵɵdefineDirective({type:he,selectors:[["","magicnc",""]],inputs:{magic:["magicnc","magic"]},features:[n.ɵɵInheritDefinitionFeature]}),n.ɵsetClassMetadata(he,[{type:n.Directive,args:[{selector:"[magicnc]"}]}],(function(){return[{type:se},{type:n.ElementRef},{type:n.Renderer2},{type:n.ViewContainerRef},{type:me,decorators:[{type:n.Optional}]}]}),{magic:[{type:n.Input,args:["magicnc"]}]});var ge=function(){};ge.DATE_FMT="dd/MMM/yyyy";var ye=function(e){function n(t){var n=e.call(this,"en-US")||this;return n._task=t,n}return C(n,e),n.prototype.transform=function(n,r){var o=this._task.GetControlPictureMask(r).getMask(),i=null,a=new ve;return t.isNullOrUndefined(n)||null===o?n="":(null!=(i=a.ConvertMgDateFormatToAngular(o))&&this._task.isTableControl(r)&&(null==this._task.mgInputDateFormat?this._task.mgInputDateFormat=i:i=this._task.mgInputDateFormat),e.prototype.transform.call(this,n,i))},n}(r.DatePipe);ye.ɵfac=function(e){return new(e||ye)(n.ɵɵdirectiveInject(se))},ye.ɵpipe=n.ɵɵdefinePipe({name:"magicDate",type:ye,pure:!0}),n.ɵsetClassMetadata(ye,[{type:n.Pipe,args:[{name:"magicDate"}]}],(function(){return[{type:se}]}),null);var ve=function(){function e(){}return e.prototype.ConvertMgDateFormatToAngular=function(e){var t=new d.StringBuilder;if(null!==e){for(var n=0;n<e.length;)switch(e.charCodeAt(n)){case u.PICInterface.PIC_YYYY:t.Append("yyyy"),n+=4;break;case u.PICInterface.PIC_MMD:t.Append("MM"),n+=2;break;case u.PICInterface.PIC_YY:t.Append("yy"),n+=2;break;case u.PICInterface.PIC_MMM:for(var r=0;n<e.length&&e.charCodeAt(n)==u.PICInterface.PIC_MMM;n++)r++;3==r&&t.Append("MMM"),r>3&&t.Append("MMMM");break;case u.PICInterface.PIC_DD:t.Append("dd"),n+=2;break;case u.PICInterface.PIC_WWW:for(r=0;n<e.length&&e.charCodeAt(n)==u.PICInterface.PIC_WWW;n++)r++;3==r&&t.Append("EEE"),r>3&&t.Append("EEEE");break;default:t.Append(e.charAt(n)),n++}return t.ToString()}return"dd-mm-yyyy"},e}(),Ce=function(){function e(e,t){this.magicDir=e,this._task=t}return e.prototype.ngAfterViewInit=function(){if(null!=this._task.getFormControl(this.magicDir.rowId,this.magicDir.id)&&null==this._task.mgInputDateFormat){var e=this._task.GetControlPictureMask(this.magicDir.id);e.getAttr()==u.StorageAttribute.DATE&&this.formatDate(e)}},e.prototype.onFocusEvent=function(e){var t=this._task.getFormControl(this.magicDir.rowId,this.magicDir.id);if(null!=t){var n=this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;if(n==u.StorageAttribute.NUMERIC||n==u.StorageAttribute.ALPHA||n==u.StorageAttribute.UNICODE){var r=this._task.GetControlPictureMask(this.magicDir.id);if(this.isPatternGenerationNeeded(n,r)){var o=this.generatePattern(n,r);null==t.validator?t.setValidators(i.Validators.pattern(o)):t.setValidators([t.validator,i.Validators.pattern(o)])}else n!=u.StorageAttribute.ALPHA&&n!=u.StorageAttribute.UNICODE||(null==t.validator?t.setValidators(i.Validators.maxLength(r.getMaskLength())):t.setValidators([t.validator,i.Validators.maxLength(r.getMaskLength())]))}}},e.prototype.onChangeEvent=function(e){var t=this._task.getFormControl(this.magicDir.rowId,this.magicDir.id);switch(this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType){case u.StorageAttribute.ALPHA:case u.StorageAttribute.UNICODE:this.formatAlphaUnicode(t);break;case u.StorageAttribute.BOOLEAN:this.formatBoolean(t)}},e.prototype.formatDate=function(e){var t=new ve;this._task.mgInputDateFormat=t.ConvertMgDateFormatToAngular(e.getMask())},e.prototype.formatAlphaUnicode=function(e){var t=e.value;if(null!==t&&t.length>0){var n=this._task.GetRangedValue(this.magicDir.id,t);null!=n&&(t=n);for(var r=this._task.GetControlPictureMask(this.magicDir.id).getMask(),o=new d.StringBuilder,i=0;i<t.length;i++)switch(r.charCodeAt(i)){case u.PICInterface.PIC_U:o.Append(t.charAt(i).toUpperCase());break;case u.PICInterface.PIC_L:o.Append(t.charAt(i).toLowerCase());break;default:o.Append(t.charAt(i))}e.setValue(o.ToString())}},e.prototype.formatBoolean=function(e){var t=e.value;if(null!==t&&t.length>0){var n=this._task.GetRangedValue(this.magicDir.id,t);n.toUpperCase().startsWith(t.toUpperCase())?e.setValue(n):e.setValue(t)}},e.prototype.generatePattern=function(e,t){var n="";switch(e){case u.StorageAttribute.NUMERIC:n=this.generatePatternForNumber(t);break;case u.StorageAttribute.ALPHA:case u.StorageAttribute.UNICODE:n=this.generatePatternForAlpha(t)}return n},e.prototype.generatePatternForNumber=function(e){var t=new d.StringBuilder;return t.Append("^"),e.isNegative()&&t.Append("-?"),e.getWholes()&&t.AppendFormat("\\d{{0},{1}}",0,e.getWholes()),e.getDec()&&t.AppendFormat("(\\.\\d{1,{0}})?",e.getDec()),t.Append("$"),t.ToString()},e.prototype.isPatternGenerationNeeded=function(e,t){switch(e){case u.StorageAttribute.NUMERIC:return!0;case u.StorageAttribute.ALPHA:case u.StorageAttribute.UNICODE:return t.getMaskChars()>0}},e.prototype.generatePatternForAlpha=function(e){var t=0,n=!1,r=!1,o=e.getMask(),i=new d.StringBuilder;i.Append("^");for(var a=0;a<o.length;){switch(!n||o.charCodeAt(a)!=u.PICInterface.PIC_N&&o.charCodeAt(a)!=u.PICInterface.PIC_U&&o.charCodeAt(a)!=u.PICInterface.PIC_L&&o.charCodeAt(a)!=u.PICInterface.PIC_X||(i.Append("("),r=!0,n=!1),t=0,o.charCodeAt(a)){case u.PICInterface.PIC_U:case u.PICInterface.PIC_X:case u.PICInterface.PIC_L:i.Append(".");var s=new d.RefParam(!1),c=u.PICInterface.PIC_U.toString();c+=u.PICInterface.PIC_L.toString(),c+=u.PICInterface.PIC_X.toString(),t=this.getDirectiveCount(o,a,c,s),n=s.value,a+=t;break;case u.PICInterface.PIC_N:i.Append("\\d");s=new d.RefParam(!1);t=this.getDirectiveCount(o,a,u.PICInterface.PIC_L.toString(),s),n=s.value,a+=t;break;default:i.Append(o[a]),a++}t>0&&i.AppendFormat("{{0},{1}}",n?t:0,t),r&&i.Append(")"),r=!1}return i.Append("$"),i.ToString()},e.prototype.getDirectiveCount=function(e,t,n,r){r.value=!1;for(var o=0;t<e.length&&this.IsPatternMatches(e.charCodeAt(t).toString(),n);)o++,t++;return t<e.length&&(r.value=!0),o},e.prototype.IsPatternMatches=function(e,t){for(var n=0;n<t.length;n++)if(e==t[n])return!0;return!1},e}();Ce.ɵfac=function(e){return new(e||Ce)(n.ɵɵdirectiveInject(fe),n.ɵɵdirectiveInject(se))},Ce.ɵdir=n.ɵɵdefineDirective({type:Ce,selectors:[["","mgFormat",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("focus",(function(e){return t.onFocusEvent(e)}))("change",(function(e){return t.onChangeEvent(e)}))}}),n.ɵsetClassMetadata(Ce,[{type:n.Directive,args:[{selector:"[mgFormat]"}]}],(function(){return[{type:fe},{type:se}]}),{onFocusEvent:[{type:n.HostListener,args:["focus",["$event"]]}],onChangeEvent:[{type:n.HostListener,args:["change",["$event"]]}]});var be=function(e){function t(t){var n=e.call(this,"en-US")||this;return n._task=t,n}return C(t,e),t.prototype.transform=function(t,n){var r=this._task.GetControlPictureMask(n).getMask(),o=new d.StringBuilder;if(void 0!==t&&null!==r){for(var i=0;i<r.length;)switch(r.charCodeAt(i)){case u.PICInterface.PIC_HH:o.Append("hh"),i+=2;break;case u.PICInterface.PIC_MMT:o.Append("mm"),i+=2;break;case u.PICInterface.PIC_SS:o.Append("ss"),i+=2;break;default:o.Append(r.charAt(i)),i++}return o.Append(" a"),e.prototype.transform.call(this,t,o.ToString())}return t},t}(r.DatePipe);be.ɵfac=function(e){return new(e||be)(n.ɵɵdirectiveInject(se))},be.ɵpipe=n.ɵɵdefinePipe({name:"magicTime",type:be,pure:!0}),n.ɵsetClassMetadata(be,[{type:n.Pipe,args:[{name:"magicTime"}]}],(function(){return[{type:se}]}),null);var Se=function(){function e(e,t){this._task=e,this.vcRef=t}return e.prototype.validate=function(e){var t;t=this.getControlName(e),this._task.Records.list[0].getControlMetadata(t).rangeValidator=!0;var n=null;return e.dirty&&(n=this._task.ValidateControlValue(t,this._task.ConvertValToNative(t,0,e.value))),null==n?null:{rangevalidator:{errorMsg:n}}},e.prototype.getControlName=function(e){var t=e.parent.controls;return Object.keys(t).find((function(n){return e===t[n]}))||null},e}();function Ie(e,t){if(1&e&&n.ɵɵelement(0,"ndc-dynamic",1),2&e){var r=n.ɵɵnextContext();n.ɵɵproperty("ndcDynamicComponent",r.Component)("ndcDynamicInputs",r.Parameters)}}Se.ɵfac=function(e){return new(e||Se)(n.ɵɵdirectiveInject(se),n.ɵɵdirectiveInject(n.ViewContainerRef))},Se.ɵdir=n.ɵɵdefineDirective({type:Se,selectors:[["","rangevalidator",""]],features:[n.ɵɵProvidersFeature([{provide:i.NG_VALIDATORS,useExisting:Se,multi:!0}])]}),n.ɵsetClassMetadata(Se,[{type:n.Directive,args:[{selector:"[rangevalidator] ",providers:[{provide:i.NG_VALIDATORS,useExisting:Se,multi:!0}]}]}],(function(){return[{type:se},{type:n.ViewContainerRef}]}),null);var Re=function(){function e(e,n){this.vcRef=e,this.mgSub=n,this.component=null,this.component=this.vcRef._hostView.find((function(e){return!t.isNullOrUndefined(e)}))}return Object.defineProperty(e.prototype,"magic",{set:function(e){this.id=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Component",{get:function(){return this.mgSub.mgGetComp(this.id)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Parameters",{get:function(){return this.mgSub.mgGetParameters(this.id)},enumerable:!1,configurable:!0}),e}();Re.ɵfac=function(e){return new(e||Re)(n.ɵɵdirectiveInject(n.ViewContainerRef),n.ɵɵdirectiveInject(N))},Re.ɵcmp=n.ɵɵdefineComponent({type:Re,selectors:[["magic-subform"]],inputs:{magic:"magic"},decls:1,vars:1,consts:[[3,"ndcDynamicComponent","ndcDynamicInputs",4,"ngIf"],[3,"ndcDynamicComponent","ndcDynamicInputs"]],template:function(e,t){1&e&&n.ɵɵtemplate(0,Ie,1,2,"ndc-dynamic",0),2&e&&n.ɵɵproperty("ngIf",t.Component)},directives:[r.NgIf,a.DynamicComponent,a.DynamicIoDirective],encapsulation:2}),n.ɵsetClassMetadata(Re,[{type:n.Component,args:[{selector:"magic-subform",template:'\n <ndc-dynamic\n *ngIf="Component" \n [ndcDynamicComponent]="Component" \n [ndcDynamicInputs]="Parameters">\n </ndc-dynamic>\n'}]}],(function(){return[{type:n.ViewContainerRef},{type:N}]}),{magic:[{type:n.Input,args:["magic"]}]});var Ee=["customContent"];function we(e,t){if(1&e&&(n.ɵɵelementStart(0,"span"),n.ɵɵtext(1),n.ɵɵelementEnd()),2&e){var r=n.ɵɵnextContext(2);n.ɵɵadvance(1),n.ɵɵtextInterpolate1(" ",r.mgService.getErrMsg(r.id,r.rowId)," ")}}function Me(e,t){if(1&e&&(n.ɵɵelementStart(0,"div"),n.ɵɵelementStart(1,"div",null,1),n.ɵɵprojection(3),n.ɵɵelementEnd(),n.ɵɵtemplate(4,we,2,1,"span",0),n.ɵɵelementEnd()),2&e){var r=n.ɵɵnextContext();n.ɵɵadvance(4),n.ɵɵproperty("ngIf",r.defaultDisplay)}}var ke=function(){function e(e,t,n){this._task=e,this.mgService=t,this.changeDetectorRef=n,this.defaultDisplay=!0,this.rowId="0"}return Object.defineProperty(e.prototype,"magic",{set:function(e){this.id=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rowId1",{set:function(e){this.rowId=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CustomContent",{set:function(e){this.defaultDisplay=null==e||this.isEmpty(e.nativeElement),this.changeDetectorRef.detectChanges()},enumerable:!1,configurable:!0}),e.prototype.isEmpty=function(e){for(var t=e.childNodes,n=0;n<t.length;n++){if(8!==t.item(n).nodeType&&0!==t.item(n).textContent.trim().length)return!1}return!0},e.prototype.HasErrors=function(e){var n,r;if(!t.isUndefined(e)){var o=this._task.getFormControl(this.rowId,e);if(null!==o){if(o.dirty&&(o.hasError("pattern")||o.hasError("required")||o.hasError("rangevalidator")||o.hasError("maxlength")||o.hasError("max")))return!0;if(o.touched&&o.hasError("required"))return!0;if(this._task.Records.list[this.rowId]&&this._task.Records.list[this.rowId].getControlMetadata(e)){var i=this._task.Records.list[this.rowId].getControlMetadata(e);try{for(var a=E(i.customValidators.keys()),s=a.next();!s.done;s=a.next()){var c=s.value;if(o.hasError(c))return!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}}}return!1},e}();ke.ɵfac=function(e){return new(e||ke)(n.ɵɵdirectiveInject(se),n.ɵɵdirectiveInject(ue),n.ɵɵdirectiveInject(n.ChangeDetectorRef))},ke.ɵcmp=n.ɵɵdefineComponent({type:ke,selectors:[["mgError"]],viewQuery:function(e,t){var r;(1&e&&n.ɵɵviewQuery(Ee,!0),2&e)&&(n.ɵɵqueryRefresh(r=n.ɵɵloadQuery())&&(t.CustomContent=r.first))},inputs:{magic:"magic",rowId1:["rowId","rowId1"]},ngContentSelectors:["*"],decls:1,vars:1,consts:[[4,"ngIf"],["customContent",""]],template:function(e,t){1&e&&(n.ɵɵprojectionDef(),n.ɵɵtemplate(0,Me,5,1,"div",0)),2&e&&n.ɵɵproperty("ngIf",t.HasErrors(t.id))},directives:[r.NgIf],encapsulation:2}),n.ɵsetClassMetadata(ke,[{type:n.Component,args:[{selector:"mgError",template:'<div *ngIf="HasErrors(id)">\n <div #customContent>\n <ng-content></ng-content>\n </div>\n <span *ngIf="defaultDisplay">\n {{mgService.getErrMsg(id, rowId)}} \n </span>\n </div>\n'}]}],(function(){return[{type:se},{type:ue},{type:n.ChangeDetectorRef}]}),{magic:[{type:n.Input,args:["magic"]}],rowId1:[{type:n.Input,args:["rowId"]}],CustomContent:[{type:n.ViewChild,args:["customContent",{static:!1}]}]});var Te=function(){function e(e){this.magicDirective=e}return e.prototype.onChange=function(e){this.magicDirective.task.onCheckChanged(e,this.magicDirective.id,+this.magicDirective.rowId)},e}();Te.ɵfac=function(e){return new(e||Te)(n.ɵɵdirectiveInject(fe))},Te.ɵdir=n.ɵɵdefineDirective({type:Te,selectors:[["input","type","checkbox","magic","",3,"noFormControl",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("change",(function(e){return t.onChange(e)}))}}),n.ɵsetClassMetadata(Te,[{type:n.Directive,args:[{selector:"\n input[type=checkbox][magic]:not([noFormControl])\n"}]}],(function(){return[{type:fe}]}),{onChange:[{type:n.HostListener,args:["change",["$event"]]}]});var Oe=function(){function e(e){this.magicDirective=e}return e.prototype.onChange=function(e){this.magicDirective.task.onComboboxSelectionChanged(e,this.magicDirective.id,+this.magicDirective.rowId)},e}();Oe.ɵfac=function(e){return new(e||Oe)(n.ɵɵdirectiveInject(fe))},Oe.ɵdir=n.ɵɵdefineDirective({type:Oe,selectors:[["select","magic","",3,"multiple",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("change",(function(e){return t.onChange(e)}))}}),n.ɵsetClassMetadata(Oe,[{type:n.Directive,args:[{selector:"select[magic]:not([multiple])"}]}],(function(){return[{type:fe}]}),{onChange:[{type:n.HostListener,args:["change",["$event"]]}]});var Pe=function(){function e(){}return e.prototype.exitMagic=function(){console.log("Magic application terminated")},e}();Pe.ɵfac=function(e){return new(e||Pe)},Pe.ɵprov=n.ɵɵdefineInjectable({token:Pe,factory:Pe.ɵfac}),n.ɵsetClassMetadata(Pe,[{type:n.Injectable}],null,null);var xe=["magicRoot"];function De(e,t){if(1&e&&n.ɵɵelement(0,"ndc-dynamic",6),2&e){var r=n.ɵɵnextContext();n.ɵɵproperty("ndcDynamicComponent",r.RootComponent)("ndcDynamicInputs",r.RootComponentParameters)}}function _e(e,t){if(1&e&&(n.ɵɵelementStart(0,"div",7),n.ɵɵelementContainer(1,8),n.ɵɵelementEnd()),2&e){var r=n.ɵɵnextContext(),o=n.ɵɵreference(7);n.ɵɵadvance(1),n.ɵɵproperty("ngTemplateOutlet",r.SpinnerTemplate?r.SpinnerTemplate:o)}}function Ae(e,t){1&e&&n.ɵɵelement(0,"div",9)}var je=function(){function e(e,t,n,r,o,i,a,s){this.engineMagicService=e,this.componentList=t,this.changeDetectorRef=n,this.titleService=r,this.overlayWindowService=o,this.httpClient=i,this.pendingCommandsCollector=a,this.exitMagicService=s,this.RootComponent=null,this.magicEngineTerminated=!1,this.initialize(),this.setTitle()}return e.prototype.onBeforeUnload=function(e){if(this.engineMagicService.TransCacheExists())return e.returnValue="Are you sure?","Are you sure?";this.engineMagicService.TerminateContextUsingFetchAPI(),this.magicEngineTerminated=!0},e.prototype.onUnload=function(e){this.magicEngineTerminated||this.engineMagicService.TerminateContextUsingFetchAPI()},e.prototype.ngAfterViewInit=function(){this.overlayWindowService.init(this.overlayWindowsContainerViewRef,this.rootMagicElementRef.nativeElement),this.engineMagicService.startMagicEngine(this.httpClient)},e.prototype.setViewContainerRef=function(e){this.overlayWindowsContainerViewRef=e},e.prototype.initialize=function(){this.registerUICommands()},e.prototype.setTitle=function(){var e=this.componentList.title;this.titleService.setTitle(e)},e.prototype.setComponent=function(e,t,n,r){this.pendingCommandsCollector.startCollecting(),r?this.overlayWindowService.open(e,t,n):(this.RootComponent=this.componentList.getComponent(e),this.RootComponentParameters={taskIdParam:t,taskDescription:n}),this.changeDetectorRef.detectChanges()},e.prototype.registerUICommands=function(){var e=this;this.engineMagicService.refreshDom.pipe(p.filter((function(e){return"0"===e.TaskTag}))).subscribe((function(t){e.executeCommand(t)})),this.engineMagicService.interactiveCommands.pipe(p.filter((function(e){return"0"===e.TaskTag}))).subscribe((function(t){L.executeInteractiveCommand(null,t,e.overlayWindowService)}))},e.prototype.executeCommand=function(e){switch(e.CommandType){case l.CommandType.OPEN_FORM:this.setComponent(e.str,e.stringList[0],e.stringList[1],e.Bool1);break;case l.CommandType.SET_IS_LOGGED_IN:this.engineMagicService.setIsLoggedIn(e.Bool1);break;case l.CommandType.CLOSE_FORM:null!=this.RootComponent&&e.str===this.RootComponentParameters.taskIdParam?(this.RootComponent=null,this.RootComponentParameters={},this.changeDetectorRef.detectChanges()):(this.overlayWindowService.close(e.str),this.changeDetectorRef.detectChanges());break;case l.CommandType.RELOAD_PAGE:window.location.reload();break;case l.CommandType.SHOW_SPINNER:this.showSpinner!=e.Bool1&&(this.showSpinner=e.Bool1,this.changeDetectorRef.detectChanges());break;case l.CommandType.EXIT_MAGIC:this.exitMagicService&&this.exitMagicService.exitMagic();break;case l.CommandType.SHOW_HTML_ERROR:window.document.write(e.str)}},e}();je.ɵfac=function(e){return new(e||je)(n.ɵɵdirectiveInject(x),n.ɵɵdirectiveInject(D),n.ɵɵdirectiveInject(n.ChangeDetectorRef),n.ɵɵdirectiveInject(m.Title),n.ɵɵdirectiveInject(oe),n.ɵɵdirectiveInject(h.HttpClient),n.ɵɵdirectiveInject(A),n.ɵɵdirectiveInject(Pe,8))},je.ɵcmp=n.ɵɵdefineComponent({type:je,selectors:[["magic-root"]],viewQuery:function(e,t){var r;(1&e&&n.ɵɵstaticViewQuery(xe,!0),2&e)&&(n.ɵɵqueryRefresh(r=n.ɵɵloadQuery())&&(t.rootMagicElementRef=r.first))},hostBindings:function(e,t){1&e&&n.ɵɵlistener("beforeunload",(function(e){return t.onBeforeUnload(e)}),!1,n.ɵɵresolveWindow)("unload",(function(e){return t.onUnload(e)}),!1,n.ɵɵresolveWindow)},inputs:{SpinnerTemplate:"SpinnerTemplate"},features:[n.ɵɵProvidersFeature([])],decls:8,vars:2,consts:[["magicRoot",""],[3,"ndcDynamicComponent","ndcDynamicInputs",4,"ngIf"],["magicViewContainerRef",""],["overlayWindowsContainer",""],["class","spinner-background",4,"ngIf"],["defaultSpinner",""],[3,"ndcDynamicComponent","ndcDynamicInputs"],[1,"spinner-background"],[3,"ngTemplateOutlet"],[1,"mgSpinnerClass"]],template:function(e,t){1&e&&(n.ɵɵelementStart(0,"div",null,0),n.ɵɵtemplate(2,De,1,2,"ndc-dynamic",1),n.ɵɵelement(3,"div",2,3),n.ɵɵelementEnd(),n.ɵɵtemplate(5,_e,2,1,"div",4),n.ɵɵtemplate(6,Ae,1,0,"ng-template",null,5,n.ɵɵtemplateRefExtractor)),2&e&&(n.ɵɵadvance(2),n.ɵɵproperty("ngIf",null!==t.RootComponent),n.ɵɵadvance(3),n.ɵɵproperty("ngIf",t.showSpinner))},directives:[r.NgIf,H,a.DynamicComponent,a.DynamicIoDirective,r.NgTemplateOutlet],styles:[".mgSpinnerClass[_ngcontent-%COMP%] {\n border: 10px solid #cccccc; \n border-top: 10px solid black; \n border-radius: 50%;\n position: fixed;\n margin: auto;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n width: 100px;\n height: 100px;\n animation: spin 2s linear infinite;\n }\n .spinner-background[_ngcontent-%COMP%] {\n \n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n left: 0;\n opacity: 0.5;\n }\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }"]}),n.ɵsetClassMetadata(je,[{type:n.Component,args:[{selector:"magic-root",providers:[],template:'\n <div #magicRoot>\n <ndc-dynamic\n *ngIf = "RootComponent !== null"\n [ndcDynamicComponent]="RootComponent"\n [ndcDynamicInputs] ="RootComponentParameters">\n </ndc-dynamic>\n\n <div #overlayWindowsContainer magicViewContainerRef>\n </div>\n </div>\n\n <div class="spinner-background" *ngIf="showSpinner">\n <ng-container [ngTemplateOutlet]="SpinnerTemplate ? SpinnerTemplate:defaultSpinner"></ng-container>\n </div>\n\n <ng-template #defaultSpinner>\n <div class="mgSpinnerClass"></div>\n </ng-template>\n ',styles:["\n .mgSpinnerClass {\n border: 10px solid #cccccc; /* Light grey */\n border-top: 10px solid black; /* Blue */\n border-radius: 50%;\n position: fixed;\n margin: auto;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n width: 100px;\n height: 100px;\n animation: spin 2s linear infinite;\n }\n .spinner-background {\n /* background fixed across whole screen */\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n left: 0;\n opacity: 0.5;\n }\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "]}]}],(function(){return[{type:x},{type:D},{type:n.ChangeDetectorRef},{type:m.Title},{type:oe},{type:h.HttpClient},{type:A},{type:Pe,decorators:[{type:n.Optional}]}]}),{rootMagicElementRef:[{type:n.ViewChild,args:["magicRoot",{static:!0}]}],SpinnerTemplate:[{type:n.Input}],onBeforeUnload:[{type:n.HostListener,args:["window:beforeunload",["$event"]]}],onUnload:[{type:n.HostListener,args:["window:unload",["$event"]]}]});var Fe={provide:i.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ne})),multi:!0},Ne=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(i.CheckboxControlValueAccessor);Ne.ɵfac=function(e){return Ve(e||Ne)},Ne.ɵdir=n.ɵɵdefineDirective({type:Ne,selectors:[["input","type","checkbox","magic","",3,"formControlName","",3,"no-form-control",""],["input","type","checkbox","magic","",3,"formControl",""],["input","type","checkbox","magic","",3,"ngModel",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("change",(function(e){return t.onChange(e.target.checked)}))("blur",(function(){return t.onTouched()}))},features:[n.ɵɵProvidersFeature([Fe]),n.ɵɵInheritDefinitionFeature]});var Ve=n.ɵɵgetInheritedFactory(Ne);n.ɵsetClassMetadata(Ne,[{type:n.Directive,args:[{selector:"\n input[type=checkbox][magic]:not([formControlName]):not([no-form-control]),\n input[type=checkbox][magic]:not([formControl]),\n input[type=checkbox][magic]:not([ngModel])\n ",host:{"(change)":"onChange($event.target.checked)","(blur)":"onTouched()"},providers:[Fe]}]}],null,null);var Le={provide:i.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ge})),multi:!0},Ge=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(i.DefaultValueAccessor);Ge.ɵfac=function(e){return Be(e||Ge)},Ge.ɵdir=n.ɵɵdefineDirective({type:Ge,selectors:[["input","magic","",3,"type","checkbox",3,"formControlName","",3,"no-form-control",""],["textarea","magic","",3,"formControlName","",3,"noFormControl","",3,"no-form-control",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("input",(function(e){return t._handleInput(e.target.value)}))("blur",(function(){return t.onTouched()}))("compositionstart",(function(){return t._compositionStart()}))("compositionend",(function(e){return t._compositionEnd(e.target.value)}))},exportAs:["magic"],features:[n.ɵɵProvidersFeature([Le]),n.ɵɵInheritDefinitionFeature]});var Be=n.ɵɵgetInheritedFactory(Ge);n.ɵsetClassMetadata(Ge,[{type:n.Directive,args:[{selector:"\n input[magic]:not([type=checkbox]):not([formControlName]):not([no-form-control]),\n textarea[magic]:not([formControlName]):not([noFormControl]):not([no-form-control])\n ",host:{"(input)":"$any(this)._handleInput($event.target.value)","(blur)":"onTouched()","(compositionstart)":"$any(this)._compositionStart()","(compositionend)":"$any(this)._compositionEnd($event.target.value)"},providers:[Le],exportAs:"magic"}]}],null,null);var Ue=function(){function e(e){this.magicDirective=e}return e.prototype.onChange=function(e){this.magicDirective.task.onCheckChanged(e,this.magicDirective.id,+this.magicDirective.rowId)},e}();Ue.ɵfac=function(e){return new(e||Ue)(n.ɵɵdirectiveInject(fe))},Ue.ɵdir=n.ɵɵdefineDirective({type:Ue,selectors:[["input","type","checkbox","magic","","noFormControl",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("change",(function(e){return t.onChange(e)}))}}),n.ɵsetClassMetadata(Ue,[{type:n.Directive,args:[{selector:"\n input[type=checkbox][magic]:([noFormControl]) \n "}]}],(function(){return[{type:fe}]}),{onChange:[{type:n.HostListener,args:["change",["$event"]]}]});var He=function(){function e(e){this.magicDirective=e}return e.prototype.onChange=function(e){this.magicDirective.task.setInputTextValue(this.magicDirective.id,this.magicDirective.rowId,event.srcElement.value)},e}();He.ɵfac=function(e){return new(e||He)(n.ɵɵdirectiveInject(fe))},He.ɵdir=n.ɵɵdefineDirective({type:He,selectors:[["input","magic","","noFormControl","",3,"type","checkbox"],["textarea","magic","","noFormControl","",3,"type","checkbox"]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("change",(function(e){return t.onChange(e)}))}}),n.ɵsetClassMetadata(He,[{type:n.Directive,args:[{selector:"input[magic]:([noFormControl]):not([type=checkbox]),\n textarea[magic]:([noFormControl]):not([type=checkbox])"}]}],(function(){return[{type:fe}]}),{onChange:[{type:n.HostListener,args:["change",["$event"]]}]});var We={provide:i.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return ze})),multi:!0},ze=function(){function e(e,t){this.renderer=e,this.elementRef=t,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){e?this.renderer.setProperty(this.elementRef.nativeElement,"valueAsDate",new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))):this.renderer.setProperty(this.elementRef.nativeElement,"value",null)},e.prototype.registerOnChange=function(e){this.onChange=function(t){return e(t instanceof Date?new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()):t)}},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this.renderer.setProperty(this.elementRef.nativeElement,"disabled",e)},e}();ze.ɵfac=function(e){return new(e||ze)(n.ɵɵdirectiveInject(n.Renderer2),n.ɵɵdirectiveInject(n.ElementRef))},ze.ɵdir=n.ɵɵdefineDirective({type:ze,selectors:[["","dateInput",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("input",(function(e){return t.onChange(e.target.valueAsDate)}))("blur",(function(){return t.onTouched()}))},features:[n.ɵɵProvidersFeature([We])]}),n.ɵsetClassMetadata(ze,[{type:n.Directive,args:[{selector:"[dateInput]",providers:[We]}]}],(function(){return[{type:n.Renderer2},{type:n.ElementRef}]}),{onChange:[{type:n.HostListener,args:["input",["$event.target.valueAsDate"]]}],onTouched:[{type:n.HostListener,args:["blur",[]]}]});var Ye=function(){function e(e,t,n,r){this._task=e,this.element=t,this.renderer=n,this.vcRef=r,this.eventHandlers={},this.eventsOnlyVal=!1,this.htmlElement=this.element.nativeElement}return Object.defineProperty(e.prototype,"magic",{set:function(e){this.id=e,this.selector="NonMagicControl"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"task",{get:function(){return this._task},enumerable:!1,configurable:!0}),e.prototype.regEvents=function(){var e=this;this.eventHandlers.focusin=this.OnFocus.bind(this),Object.keys(this.eventHandlers).forEach((function(t){e.focusUnlistener=e.renderer.listen(e.htmlElement,t,e.eventHandlers[t])}))},e.prototype.OnFocus=function(){this.task.insertEvent(c.getGuiEventObj("focusOnNonMagicControl","",-1)),event.cancelBubble=!0},e.prototype.ngOnInit=function(){this.regEvents()},e}();Ye.ɵfac=function(e){return new(e||Ye)(n.ɵɵdirectiveInject(se),n.ɵɵdirectiveInject(n.ElementRef),n.ɵɵdirectiveInject(n.Renderer2),n.ɵɵdirectiveInject(n.ViewContainerRef))},Ye.ɵdir=n.ɵɵdefineDirective({type:Ye,selectors:[["","NonMagicControl",""]],inputs:{magic:["NonMagicControl","magic"]}}),n.ɵsetClassMetadata(Ye,[{type:n.Directive,args:[{selector:"[NonMagicControl]"}]}],(function(){return[{type:se},{type:n.ElementRef},{type:n.Renderer2},{type:n.ViewContainerRef}]}),{magic:[{type:n.Input,args:["NonMagicControl"]}]});var Xe=[fe,Te,Ue,He,Oe,me,Ne,Ge,ze,de,Q,Z,te,B,G,z,V,je,Re,ke,he,Ce,ye,be,Se,Ye,U,H],Ke=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[x,D,A,F,oe]}},e}();Ke.ɵmod=n.ɵɵdefineNgModule({type:Ke}),Ke.ɵinj=n.ɵɵdefineInjector({factory:function(e){return new(e||Ke)},providers:[re,J],imports:[[r.CommonModule,i.FormsModule,i.ReactiveFormsModule,o.RouterModule,a.DynamicModule,h.HttpClientModule]]}),("undefined"==typeof ngJitMode||ngJitMode)&&n.ɵɵsetNgModuleScope(Ke,{declarations:[fe,Te,Ue,He,Oe,me,Ne,Ge,ze,de,Q,Z,te,B,G,z,V,je,Re,ke,he,Ce,ye,be,Se,Ye,U,H],imports:[r.CommonModule,i.FormsModule,i.ReactiveFormsModule,o.RouterModule,a.DynamicModule,h.HttpClientModule],exports:[fe,Te,Ue,He,Oe,me,Ne,Ge,ze,de,Q,Z,te,B,G,z,V,je,Re,ke,he,Ce,ye,be,Se,Ye,U,H]}),n.ɵsetClassMetadata(Ke,[{type:n.NgModule,args:[{declarations:M(Xe),exports:M(Xe),entryComponents:[],imports:[r.CommonModule,i.FormsModule,i.ReactiveFormsModule,o.RouterModule,a.DynamicModule,h.HttpClientModule],providers:[re,J]}]}],null,null);var qe={parse:{dateInput:{month:"short",year:"numeric",day:"numeric"}},display:{dateInput:"input",monthYearLabel:{year:"numeric",month:"short"},dateA11yLabel:{year:"numeric",month:"long",day:"numeric"},monthYearA11yLabel:{year:"numeric",month:"long"}}},$e=function(e){function t(t,n){var r=e.call(this,"en-US",t)||this;return r.platform=t,r.task=n,r.mgdtfmt=null,r}return C(t,e),t.prototype.parse=function(e){var t=e,n=0,r=0,o=0,i=this.mgdtfmt,a=t.indexOf("/")>0?"/":"-";if(null==e||""==e)return null;if(null==this.mgdtfmt&&null!=this.task.mgInputDateFormat&&(this.mgdtfmt=this.task.mgInputDateFormat),this.mgdtfmt.indexOf("MMM")>0||this.mgdtfmt.indexOf("MMMM")>0)return new Date(e);t.length;if(null!==i){for(var s=0;s<i.length;)switch(i[s]){case"d":var c=void 0;for(c=-1==(l=t.indexOf(a,0))?t:t.substr(0,l),l>-1&&(t=t.substr(l+1));"d"==i[s];s++);n=Number(c);break;case"M":c=void 0;for(c=-1==(l=t.indexOf(a,0))?t:t.substr(0,l),l>-1&&(t=t.substr(l+1));"M"==i[s];s++);r=Number(c)>0?Number(c)-1:0;break;case"y":var l;c=void 0;for(c=-1==(l=t.indexOf(a,0))?t:t.substr(0,l),l>-1&&(t=t.substr(l+1));"y"==i[s];s++);o=Number(c);break;default:s++}return 0==r&&0==o&&0==n?null:new Date(Date.UTC(o,r,n))}},t.prototype.format=function(e,t){return null==this.mgdtfmt&&null!=this.task.mgInputDateFormat&&(this.mgdtfmt=this.task.mgInputDateFormat),"input"===t?(null==this.mgdtfmt&&(this.mgdtfmt="M/d/yyyy"),r.formatDate(e,this.mgdtfmt,this.locale)):e.toDateString()},t}(g.NativeDateAdapter);$e.ɵfac=function(e){return new(e||$e)(n.ɵɵinject(y.Platform),n.ɵɵinject(se))},$e.ɵprov=n.ɵɵdefineInjectable({token:$e,factory:$e.ɵfac}),n.ɵsetClassMetadata($e,[{type:n.Injectable}],(function(){return[{type:y.Platform},{type:se}]}),null);var Qe=[{provide:g.DateAdapter,useClass:$e},{provide:g.MAT_DATE_FORMATS,useValue:qe}],Je=[pe,se,N,le,ue,Qe],Ze=M(Je,[ce]),et=function(){function e(){}return e.addChildren=function(e,t,n){for(var r=0;r<e.children.length;r++)void 0!==e.children[r].attributes[n]&&t.push(e.children[r]),this.addChildren(e.children[r],t,n)},e.getDistance=function(e,t,n){var r,o,i=e.clientLeft,a=e.clientTop,s=i+e.clientWidth,c=a+e.clientHeight;return(r=t<i?i-t:t>s?t-s:0)*r+(o=n<a?a-n:n>c?n-c:0)*o},e.getDimentions=function(e){for(var t=0,n=0,r=e.width,o=e.height;e;){if("BODY"==e.tagName){var i=e.scrollLeft||document.documentElement.scrollLeft,a=e.scrollTop||document.documentElement.scrollTop;t+=e.offsetLeft-i+e.clientLeft,n+=e.offsetTop-a+e.clientTop}else t+=e.offsetLeft-e.scrollLeft+e.clientLeft,n+=e.offsetTop-e.scrollTop+e.clientTop;e=e.offsetParent}return{x:t,y:n,width:r,height:o}},e}(),tt=function(){this.taskId="",this.comp=null,this.parameters={}};e.AccessorMagicService=ue,e.BaseMagicAlertComponent=B,e.BaseMagicConfirmComponent=G,e.CHECKBOX_VALUE_ACCESSOR=Fe,e.CheckboxMagicDirective=Te,e.CheckboxNoFormControlMagicDirective=Ue,e.ComboboxMagicDirective=Oe,e.CommandsCollectorMagicService=A,e.ComponentListMagicService=D,e.ConfirmationComponentsMagicProvider=re,e.Constants=ge,e.ControlMetadata=T,e.ControlsMetadata=O,e.DATE_VALUE_ACCESSOR=We,e.DateMagicPipe=ye,e.DateValueAccessor=ze,e.EngineMagicService=x,e.ErrorMagicComponent=ke,e.ExitMagicService=Pe,e.GuiInteractiveExecutor=L,e.InputNoFormControlMagicDirective=He,e.MAGIC_DEFAULT_VALUE_ACCESSOR=Le,e.MG_FORMATS=qe,e.MagicAlertComponent=Z,e.MagicCheckboxControlValueAccessor=Ne,e.MagicConfirmationBoxComponent=te,e.MagicDefaultValueAccessor=Ge,e.MagicDirective=fe,e.MagicFocusDirective=U,e.MagicModule=Ke,e.MagicOverlayContainer=Q,e.MagicOverlayContainerWrapper=z,e.MagicServices=pe,e.MagicShellComponent=je,e.MagicViewContainerRef=H,e.MgDateAdapter=$e,e.MgDateFormatter=ve,e.MgformatMagicDirective=Ce,e.ModalFormDefinition=tt,e.NoControlMagicDirective=he,e.NonMagicControlDirective=Ye,e.OverlayContainerMagicProvider=J,e.OverlayWindowService=oe,e.RangeValidatorMagicDirective=Se,e.Records=P,e.RouteCommand=j,e.RouterCommandsMagicService=F,e.RouterContainerMagicComponent=V,e.RowMagicDirective=me,e.StylesMapManager=_,e.SubformMagicComponent=Re,e.SubformMagicService=N,e.TableMagicService=ce,e.TaskBaseMagicComponent=de,e.TaskMagicService=se,e.TimeMagicPipe=be,e.TitleMagicService=le,e.basicMagicProviders=Je,e.confirmationBox=Y,e.magicProviders=Ze,e.matDateProviders=Qe,e.utils=et,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
15
|
+
***************************************************************************** */var v=function(e,t){return v=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},v(e,t)};function C(e,t){function n(){this.constructor=e}v(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}function b(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}function S(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function I(e,t,n,r){return new(n||(n=Promise))((function(o,i){function a(e){try{c(r.next(e))}catch(e){i(e)}}function s(e){try{c(r.throw(e))}catch(e){i(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function R(e,t){var n,r,o,i,a={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function s(i){return function(s){return function(i){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(o=2&i[0]?r.return:i[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,i[1])).done)return o;switch(r=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return a.label++,{value:i[1],done:!1};case 5:a.label++,r=i[1],i=[0];continue;case 7:i=a.ops.pop(),a.trys.pop();continue;default:if(!(o=a.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){a=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){a.label=i[1];break}if(6===i[0]&&a.label<o[1]){a.label=o[1],o=i;break}if(o&&a.label<o[2]){a.label=o[2],a.ops.push(i);break}o[2]&&a.ops.pop(),a.trys.pop();continue}i=t.call(e,a)}catch(e){i=[6,e],r=0}finally{n=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,s])}}}function E(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function w(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)}finally{if(o)throw o.error}}return a}function M(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(w(arguments[t]));return e}var k,T=function(){function e(){this.properties=new Map,this.classesMap=new Map,this.stylesMap=new Map,this.userProperties=new Map,this.customValidators=new Map}return e.prototype.setClass=function(e,t){var n,r;this.classesMap.has(e)&&(this.removedClass=this.classesMap.get(e)),this.classesMap.set(e,t);var o="";try{for(var i=E(this.classesMap),a=i.next();!a.done;a=i.next()){o+=a.value+" "}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}this.classes=o},e.prototype.setStyle=function(e,t){this.stylesMap.set(e,t)},e}(),O=function(){function e(){this.values=new Map,this.ControlsProperties=new Map,this.isCreated=!1,this.isEditing=!1}return Object.defineProperty(e.prototype,"Values",{get:function(){return this.values},enumerable:!1,configurable:!0}),e.prototype.getControlMetadata=function(e){return this.ControlsProperties.has(e)||this.ControlsProperties.set(e,new T),this.ControlsProperties.get(e)},e.prototype.update=function(e){var t=e.ControlsMetaData;for(var n in t){this.ControlsProperties.has(n)||this.ControlsProperties.set(n,new T);var r=this.ControlsProperties.get(n);for(var o in e.ControlsMetaData[n].Properties)r[o]=e.ControlsMetaData[n].Properties[o];r.controlType=e.ControlsMetaData[n].Type}for(var n in e.ControlsValues)this.setValue(n,e.ControlsValues[n])},e.prototype.setValue=function(e,t){this.values.set(e,t)},e.prototype.getProperty=function(e,t){return this.ControlsProperties.has(e)&&this.ControlsProperties.get(e).properties.has(t)?this.ControlsProperties.get(e).properties.get(t):""},e.prototype.getValue=function(e){return this.values.get(e)},e}(),P=function(){function e(){this.data=new Map,this.list=[],this.recordsBeforeCurrentView=0,this.isEmptyDataView=!1,this.sizeUpdated=!1}return e.prototype.getRow=function(e){return this.list[e+this.recordsBeforeCurrentView]},e.prototype.markRowAsCreated=function(e){e<this.list.length&&(this.addRow(e),this.data.get(e).isCreated=!0)},e.prototype.markRowAsNotCreated=function(e){e<this.list.length&&(this.data.get(e).isCreated=!1)},e.prototype.isRowCreated=function(e){return e<this.list.length&&(!(!this.data.has(e)||t.isNullOrUndefined(this.data.get(e)))&&this.data.get(e).isCreated)},e.prototype.startRowEditing=function(e){e<this.list.length&&this.data.has(e)&&(this.data.get(e).isEditing=!0)},e.prototype.stopRowEditing=function(e){e<this.list.length&&this.data.has(e)&&(this.data.get(e).isEditing=!1)},e.prototype.isRowInRowEditing=function(e){return+e<this.list.length&&(!(!this.data.has(+e)||t.isNullOrUndefined(this.data.get(+e)))&&this.data.get(+e).isEditing)},e.prototype.update=function(e){var t,n;for(var r in e.fullRefresh&&e.rows.length!=this.list.length&&(this.data=new Map,this.list=new Array),e.rows){this.data.has(+r)&&null!==this.data.get(+r)||this.data.set(+r,new O);var o=this.data.get(+r);o.update(e.rows[r]),o.rowId=r}try{for(var i=E(this.data),a=i.next();!a.done;a=i.next()){var s=w(a.value,2),c=s[0],l=s[1];this.list[c]=l}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},e.prototype.updateSize=function(e){if(this.list.length!=e){if(e<this.list.length)for(var t=e;t<this.list.length;t++)this.data.delete(t);this.list.length=e,this.sizeUpdated=!0}},e.prototype.clearFirstTableRecord=function(e){if(this.list.length>=1)for(var t in e)"1"==e[t]&&this.list[0].ControlsProperties.has(t)&&(this.list[0].ControlsProperties.get(t).properties=new Map)},e.prototype.addRow=function(e){0===e&&this.data.has(e)&&!t.isNullOrUndefined(this.data.get(e))||(this.data.set(e,new O),this.data.get(e).rowId=""+e,this.list[e]=this.data.get(e))},e.prototype.createFirst=function(){this.addRow(0)},e.prototype.fromJson=function(e){var t=JSON.parse(e);this.update(t)},e.prototype.setGuiTopIndex=function(e){this.guiTopIndex=e},e.prototype.getGuiTopIndex=function(){return this.guiTopIndex},e}();(k=e.HtmlClasses||(e.HtmlClasses={})).Color="color",k.font="font",k.FocusColor="focuscolor",k.HintColor="hintcolor";var x=function(){function e(){this.magicBridge=c.MagicBridge,this.isStub=!1,this.isLoggedIn=!1,this.refreshDom=new s.Subject,this.interactiveCommands=new s.Subject}return e.prototype.startMagicEngine=function(e){var t=this;this.magicBridge.registerExecuteCommandsCallback((function(e){var n,r;if(!t.isStub)try{var o=e;try{for(var i=E(o),a=i.next();!a.done;a=i.next()){var s=a.value;t.refreshDom.next(s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}catch(e){console.dir(e),console.log("magic engine not found"),console.log("moving to stub mode"),t.isStub=!0}})),this.magicBridge.registerInteractiveCallback((function(e){t.isStub||t.interactiveCommands.next(e)})),this.magicBridge.Initialize(e)},e.prototype.terminateMagic=function(){return I(this,void 0,void 0,(function(){return R(this,(function(e){switch(e.label){case 0:return[4,this.magicBridge.TerminateMagic()];case 1:return e.sent(),[2]}}))}))},e.prototype.insertEvent=function(e){this.isStub||this.magicBridge.insertEvent(e)},e.prototype.GetRangedValue=function(e,t,n){return this.magicBridge.GetRangedValue(e,t,n)},e.prototype.GetControlPictureMask=function(e,t){return this.magicBridge.GetControlPictureMask(e,t)},e.prototype.GetFormattedValue=function(e,t,n){return this.magicBridge.GetFormattedValue(e,t,n)},e.prototype.ValidateControlValue=function(e,t,n){return this.magicBridge.ValidateControlValue(e,t,n)},e.prototype.GetFldRanges=function(e,t){return this.magicBridge.GetFldRanges(e,t)},e.prototype.saveData=function(e){},e.prototype.getIsLoggedIn=function(){return this.isLoggedIn},e.prototype.setIsLoggedIn=function(e){this.isLoggedIn=e},e.prototype.TransCacheExists=function(){return this.magicBridge.TransCacheExists()},e.prototype.TerminateContextUsingFetchAPI=function(){this.magicBridge.TerminateContextUsingFetchAPI()},e}();x.ɵfac=function(e){return new(e||x)},x.ɵprov=n.ɵɵdefineInjectable({token:x,factory:x.ɵfac}),n.ɵsetClassMetadata(x,[{type:n.Injectable}],null,null);var D=function(){function e(){this.components=new Map,this.dialogs=new Map,this.lazyLoadModulesMap=null}return e.prototype.getData=function(e,t){var n=null,r=this.components.has(e);return!r&&t&&console.log("Error: Component: "+e+" does not exist in components map"),r&&(n=this.components.get(e)),n},e.prototype.getComponent=function(e,t){void 0===t&&(t=!0);var n=this.getData(e,t);return n?n.component:null},e.prototype.addComponents=function(e,t){for(var n in e){var r={moduleRef:t,component:e[n]};this.components.set(n,r)}},e.prototype.getModuleRef=function(e){var t=this.getData(e,!1);return t?t.moduleRef:null},e.prototype.getLazyLoadModuleData=function(e){return null!=this.lazyLoadModulesMap&&this.lazyLoadModulesMap.hasOwnProperty(e)?this.lazyLoadModulesMap[e]:null},e}(),_=function(){function e(){}return e.magicValueGetStyle=function(n,r){var o="";if(!t.isNullOrUndefined(r)){var i=e.StylesMap.get(n);i.constructor===Map?o=i.get(r):i.constructor===String&&(o=d.NString.Format(i.toString(),r))}return o},e}();_.StylesMap=new Map([[u.MagicProperties.LineDivider,new Map([[!0,"solid"],[!1,"hidden"]])],[u.MagicProperties.ImageFile,"url('{0}')"],[u.MagicProperties.Wallpaper,"url('{0}')"]]),_.MagicPropertyToHtmlAttributeMap=new Map([[u.MagicProperties.LineDivider,"border-bottom-style"],[u.MagicProperties.ImageFile,"background-image"],[u.MagicProperties.Wallpaper,"background-image"]]);var A=function(){function e(e){this.magic=e,this.count=0,this.commands=new d.List,this.subscription=null}return e.prototype.startCollecting=function(){var e=this;this.count++,u.Logger.Instance.WriteDevToLog("CommandsCollectorMagicService.startCollecting() --- "+this.count),null===this.subscription&&(this.subscription=this.magic.refreshDom.subscribe((function(t){e.commands.push(t)})))},e.prototype.stopCollecting=function(){this.count--,u.Logger.Instance.WriteDevToLog("CommandsCollectorMagicService.stopCollecting() --- "+this.count),0===this.count&&(this.subscription.unsubscribe(),this.subscription=null)},e.prototype.GetCommands=function(e){var t=this,n=this.commands.filter((function(t){return t.TaskTag===e}));return n.forEach((function(e){t.commands.Remove(e)})),n},e}();A.ɵfac=function(e){return new(e||A)(n.ɵɵinject(x))},A.ɵprov=n.ɵɵdefineInjectable({token:A,factory:A.ɵfac}),n.ɵsetClassMetadata(A,[{type:n.Injectable}],(function(){return[{type:x}]}),null);var j=function(){},F=function(){function e(){this.pendingRouteCommands=[]}return e.prototype.AddRouteCommand=function(e){this.pendingRouteCommands.push(e)},e.prototype.ExecuteNextCommand=function(){var e=this.pendingRouteCommands.shift();t.isNullOrUndefined(e)||e.callerMgSubformServiceRef.ExecuteRouteCommand(e)},e}();F.ɵfac=function(e){return new(e||F)},F.ɵprov=n.ɵɵdefineInjectable({token:F,factory:F.ɵfac}),n.ɵsetClassMetadata(F,[{type:n.Injectable}],null,null);var N=function(){function e(e,t,n,r,o,i,a,s,c){this.task=e,this.activatedRoute=t,this.componentList=n,this.pendingCommandsCollector=r,this.router=o,this.routerCommandsMagicService=i,this.componentListMagicService=a,this.loader=s,this.injector=c,this.subformsDict={},this.routesDict={},this.currentRouteDefinition=null}return e.prototype.mgGetComp=function(e){if(e in this.subformsDict){var t=this.subformsDict[e].formName;if(t)return this.componentList.getComponent(t)}return null},e.prototype.mgGetParameters=function(e){return e in this.subformsDict?this.subformsDict[e].parameters:""},e.prototype.deleteSubformComp=function(e,t){Object.keys(this.subformsDict).indexOf(e)>=0&&this.subformsDict[e].formName===t&&(this.subformsDict[e]={},this.task.refreshView())},e.prototype.addSubformComp=function(n,r,o,i,a,s,c){var l=this;this.pendingCommandsCollector.startCollecting();var u=!1;if(t.isNullOrUndefined(a)){Object.keys(this.subformsDict).indexOf(n)>=0&&this.subformsDict[n].formName===r&&(this.subformsDict[n]={},this.task.refreshView());var p=this.componentListMagicService.getModuleRef(r);if(null==p){var m=this.componentListMagicService.getLazyLoadModuleData(r);null!=m&&this.loader.load(m.modulePath+"#"+m.moduleName).then((function(e){p=e.create(l.injector),l.subformsDict[n]={formName:r,parameters:{taskIdParam:o,taskDescription:i}},l.task.refreshView()}))}else this.subformsDict[n]={formName:r,parameters:{taskIdParam:o,taskDescription:i}},u=!0}else{c&&(n="primary");var f=new d.List;f.push(a),null!==s&&(f=f.concat(s));var h={callerMgSubformServiceRef:this,routerOutletName:n,formName:r,parameters:{taskIdParam:o,taskDescription:i},routeParams:f};null===e.currentCallerMgSubformServiceRef?this.ExecuteRouteCommand(h):this.routerCommandsMagicService.AddRouteCommand(h)}u&&this.task.refreshView()},e.prototype.ExecuteRouteCommand=function(t){var n,r=t.callerMgSubformServiceRef,o=e.getRelativeRoute(r.activatedRoute);if(r.routesDict[t.routerOutletName]===t.routeParams[0])r.router.navigate([{outlets:(n={},n[t.routerOutletName]=null,n)}],{relativeTo:o}).then((function(n){e.currentCallerMgSubformServiceRef=r,r.currentRouteDefinition={formName:t.formName,parameters:t.parameters},r.PerformRouterNavigate(t.routerOutletName,t.routeParams)}));else if(e.currentCallerMgSubformServiceRef=r,r.currentRouteDefinition={formName:t.formName,parameters:t.parameters},e.routerContainers.length>0){var i=e.routerContainers[0];e.routerContainers.shift(),i.initializeComponent()}else r.PerformRouterNavigate(t.routerOutletName,t.routeParams)},e.prototype.PerformRouterNavigate=function(t,n){var r,o=e.getRelativeRoute(this.activatedRoute);this.router.navigate([{outlets:(r={},r[t]=n,r)}],{relativeTo:o}).then((function(t){if(null!==t&&!t){var n=e.currentCallerMgSubformServiceRef;n.currentRouteDefinition=null,e.currentCallerMgSubformServiceRef=null,n.pendingCommandsCollector.stopCollecting(),n.routerCommandsMagicService.ExecuteNextCommand()}}))},e.prototype.init=function(){var e=this,t=this.pendingCommandsCollector.GetCommands(this.task.taskId);t.length>0&&(t.forEach((function(t){e.task.executeCommand(t)})),this.task.refreshView()),this.pendingCommandsCollector.stopCollecting()},e.prototype.refreshView=function(){this.task.refreshView()},e.getRelativeRoute=function(e){var t=e;return null!==t.snapshot.routeConfig&&""===t.snapshot.routeConfig.path&&((t=t.parent).snapshot.routeConfig.loadChildren||console.log("getRelativeRoute(): both path and currentActiveRoute.snapshot.routeConfig.loadChildren are empty.")),t},e}();N.currentCallerMgSubformServiceRef=null,N.routerContainers=new Array,N.ɵfac=function(e){return new(e||N)(n.ɵɵinject(se),n.ɵɵinject(o.ActivatedRoute),n.ɵɵinject(D),n.ɵɵinject(A),n.ɵɵinject(o.Router),n.ɵɵinject(F),n.ɵɵinject(D),n.ɵɵinject(n.NgModuleFactoryLoader),n.ɵɵinject(n.Injector))},N.ɵprov=n.ɵɵdefineInjectable({token:N,factory:N.ɵfac}),n.ɵsetClassMetadata(N,[{type:n.Injectable}],(function(){return[{type:se},{type:o.ActivatedRoute},{type:D},{type:A},{type:o.Router},{type:F},{type:D},{type:n.NgModuleFactoryLoader},{type:n.Injector}]}),null);var V=function(){function e(e,t,n,r,o,i,a,s,c){this.activatedRoute=e,this.router=t,this.magic=n,this.containerTaskService=r,this.componentFactoryResolver=o,this.viewContainerRef=i,this.componentList=a,this.pendingCommandsCollector=s,this.routerCommandsMagicService=c,this.componentRef=null,this.parentMgSubformService=null}return Object.defineProperty(e,"LastRoute",{get:function(){return e.lastRoute},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){this.activatedRoute.outlet;var t=N.currentCallerMgSubformServiceRef,n=N.getRelativeRoute(this.activatedRoute);e.lastRoute=this.router.url,null==t||null===t.currentRouteDefinition?(this.insertRouteEvent(n),N.routerContainers.push(this)):this.initializeComponent()},e.prototype.insertRouteEvent=function(e){var t=c.getGuiEventObj("RouterNavigate",null,0);t.RouterPath=e.snapshot.routeConfig.path,"primary"!==e.snapshot.outlet&&(t.RouterOutletName=e.snapshot.outlet);var n=e.routeConfig.path;if(n.length>0){var r=n,o=u.StrUtil.tokenize(r,"/:");t.RouterPath=o[0],t.RouterParams=new d.List;for(var i=1;i<o.length;i++)t.RouterParams.push(e.snapshot.params[o[i]])}this.containerTaskService.insertEvent(t)},e.prototype.initializeComponent=function(){var e=this,t=N.currentCallerMgSubformServiceRef;if(null!==t.currentRouteDefinition){var n=this.componentList.getComponent(t.currentRouteDefinition.formName),r=this.componentFactoryResolver.resolveComponentFactory(n);this.componentRef=this.viewContainerRef.createComponent(r),Object.assign(this.componentRef.instance,t.currentRouteDefinition.parameters);var o=N.getRelativeRoute(this.activatedRoute),i=u.StrUtil.tokenize(o.snapshot.routeConfig.path,"/:");t.routesDict[o.snapshot.outlet]=i[0],this.parentMgSubformService=t,t.currentRouteDefinition=null,N.currentCallerMgSubformServiceRef=null;var a=!0;o.paramMap.subscribe((function(t){a||e.insertRouteEvent(o),a=!1})),this.parentMgSubformService.refreshView(),this.routerCommandsMagicService.ExecuteNextCommand()}},e.prototype.ngOnDestroy=function(){if(null!=this.componentRef){this.componentRef.instance.task.close();var t=N.getRelativeRoute(this.activatedRoute);this.parentMgSubformService.routesDict[t.outlet]="",e.lastRoute=this.router.url}},e}();V.lastRoute="/",V.ɵfac=function(e){return new(e||V)(n.ɵɵdirectiveInject(o.ActivatedRoute),n.ɵɵdirectiveInject(o.Router),n.ɵɵdirectiveInject(x),n.ɵɵdirectiveInject(se),n.ɵɵdirectiveInject(n.ComponentFactoryResolver),n.ɵɵdirectiveInject(n.ViewContainerRef),n.ɵɵdirectiveInject(D),n.ɵɵdirectiveInject(A),n.ɵɵdirectiveInject(F))},V.ɵcmp=n.ɵɵdefineComponent({type:V,selectors:[["magic-route-outlet"]],decls:0,vars:0,template:function(e,t){},encapsulation:2}),n.ɵsetClassMetadata(V,[{type:n.Component,args:[{selector:"magic-route-outlet",template:"\n "}]}],(function(){return[{type:o.ActivatedRoute},{type:o.Router},{type:x},{type:se},{type:n.ComponentFactoryResolver},{type:n.ViewContainerRef},{type:D},{type:A},{type:F}]}),null);var L=function(){function e(){}return e.prototype.Run=function(){try{switch(this.command._commandType){case l.InteractiveCommandType.GET_VALUE:this.onValue();break;case l.InteractiveCommandType.GET_ROWS_IN_PAGE:this.onGetRowsInPage();break;case l.InteractiveCommandType.GET_MAX_ROWS_IN_PAGINATED_TABLE:this.onGetMaxRowsInPaginatedTable();break;case l.InteractiveCommandType.MESSAGE_BOX:this.OnMessageBox();break;case l.InteractiveCommandType.GET_TOP_INDEX:this.OnGetTopIndex();break;case l.InteractiveCommandType.GET_IS_ROW_EDITING:this.OnGetIsRowEditing();break;case l.InteractiveCommandType.SET_TITLE:this.OnSetTitle();break;case l.InteractiveCommandType.REFRESH_PAGE:this.OnRefreshPage();break;case l.InteractiveCommandType.GET_LAST_ROUTE:this.OnGetLastRoute()}}catch(e){throw e}},e.executeInteractiveCommand=function(t,n,r){var o=new e;o.task=t,o.command=n,o.overlayService=r,o.Run()},e.prototype.onValue=function(){var e,n=this.task.getGuiRowId(+this.command._line,this.task.isTableControl(this.command.controlName)||this.command._obj2.IsTableChild),r=this.task.getFormControl(n.toString(),this.command.controlName);t.isNullOrUndefined(r)?this.task.isTableControl(this.command.controlName)&&(e=this.task.getValue(this.command.controlName,n.toString())):e=r.value,e=this.task.ConvertValToNative(this.command.controlName,n,e),this.command._mgValue.obj=e},e.prototype.onGetRowsInPage=function(){this.command._intVal1=this.task.tableService.getPageSize(),0==this.task.oldPageSize&&(this.task.oldPageSize=this.command._intVal1)},e.prototype.onGetMaxRowsInPaginatedTable=function(){this.command._intVal1=this.task.tableService.getMaxRowsInTable()},e.prototype.OnMessageBox=function(){this.overlayService.openConfirmationBox(this.command._mgValue.title,this.command._mgValue.str,this.command._mgValue.style)},e.prototype.OnSetTitle=function(){this.task.setTitle(this.command._mgValue.title)},e.prototype.OnRefreshPage=function(){var e=this.command._boolVal,t=this.command._obj1;e?window.location.replace(t):window.location.reload()},e.prototype.OnGetTopIndex=function(){this.command._intVal1=this.task.tableService.getTableTopIndex()},e.prototype.OnGetIsRowEditing=function(){var e=this.command._intVal1,n=this.task.getGuiRowId(e,!0);this.command._boolVal&&(t.isNullOrUndefined(n)||t.isNullOrUndefined(this.task.Records.list[n]))?this.command._boolVal=!1:this.command._boolVal=this.task.Records.list[n].isEditing},e.prototype.OnGetLastRoute=function(){this.command.resultString=V.LastRoute},e}();e.BaseMagicOverlayContainer=function(){},b([n.Input(),S("design:type",Object)],e.BaseMagicOverlayContainer.prototype,"ModalComp",void 0),b([n.Input(),S("design:type",Object)],e.BaseMagicOverlayContainer.prototype,"ModalCompParameters",void 0),b([n.Output(),S("design:type",Object)],e.BaseMagicOverlayContainer.prototype,"onClose",void 0),e.BaseMagicOverlayContainer=b([n.Input(),n.Output()],e.BaseMagicOverlayContainer);var G=function(){function e(){this.onClose=new n.EventEmitter}return e.prototype.OnClose=function(e){this.onClose.emit(e)},e}();G.ɵfac=function(e){return new(e||G)},G.ɵcmp=n.ɵɵdefineComponent({type:G,selectors:[["mg-base-alert"]],inputs:{title:"title",message:"message"},outputs:{onClose:"onClose"},decls:0,vars:0,template:function(e,t){},styles:[""]}),n.ɵsetClassMetadata(G,[{type:n.Component,args:[{selector:"mg-base-alert",template:"",styles:[""]}]}],null,{title:[{type:n.Input}],message:[{type:n.Input}],onClose:[{type:n.Output}]});var B=function(){function e(){this.onClose=new n.EventEmitter}return e.prototype.OnClose=function(){this.onClose.emit()},e}();B.ɵfac=function(e){return new(e||B)},B.ɵcmp=n.ɵɵdefineComponent({type:B,selectors:[["mg-base-alert"]],inputs:{title:"title",message:"message"},outputs:{onClose:"onClose"},decls:0,vars:0,template:function(e,t){},styles:[""]}),n.ɵsetClassMetadata(B,[{type:n.Component,args:[{selector:"mg-base-alert",template:"",styles:[""]}]}],null,{title:[{type:n.Input}],message:[{type:n.Input}],onClose:[{type:n.Output}]});var U=function(){function e(e){this.hostElement=e}return e.prototype.ngAfterViewInit=function(){this.hostElement.nativeElement.focus()},e}();U.ɵfac=function(e){return new(e||U)(n.ɵɵdirectiveInject(n.ElementRef))},U.ɵdir=n.ɵɵdefineDirective({type:U,selectors:[["","magicFocus",""]]}),n.ɵsetClassMetadata(U,[{type:n.Directive,args:[{selector:"[magicFocus]"}]}],(function(){return[{type:n.ElementRef}]}),null);var H=function(e,n){this.vcRef=e,this.resolver=n,this.vcRef._hostView.find((function(e){return null!=e&&!t.isNullOrUndefined(e.setViewContainerRef)})).setViewContainerRef(e)};H.ɵfac=function(e){return new(e||H)(n.ɵɵdirectiveInject(n.ViewContainerRef),n.ɵɵdirectiveInject(n.ComponentFactoryResolver))},H.ɵdir=n.ɵɵdefineDirective({type:H,selectors:[["","magicViewContainerRef",""]]}),n.ɵsetClassMetadata(H,[{type:n.Directive,args:[{selector:"[magicViewContainerRef]"}]}],(function(){return[{type:n.ViewContainerRef},{type:n.ComponentFactoryResolver}]}),null);var W=["overlayContainerWrapper"],z=function(){function e(e,t,r,o,i){this.componentListMagicService=e,this.loader=t,this.injector=r,this.componentFactoryResolver=o,this.changeDetectorRef=i,this.Component=null,this.Parameters={},this.onClose=new n.EventEmitter}return e.prototype.ngOnInit=function(){var e=this,t=this.componentListMagicService.getModuleRef(this.Parameters.MagicFormName);if(null==t){var n=this.componentListMagicService.getLazyLoadModuleData(this.Parameters.MagicFormName);null!=n?this.loader.load(n.modulePath+"#"+n.moduleName).then((function(n){t=n.create(e.injector),e.loadComponent(t)})):this.loadComponent(null)}else this.loadComponent(t)},e.prototype.loadComponent=function(n){var r,o=this;this.Parameters.ModalComp=this.componentListMagicService.getComponent(this.Parameters.MagicFormName,!t.isNullOrUndefined(this.Parameters.MagicFormName)),r=null!=n?n.componentFactoryResolver.resolveComponentFactory(this.Component):this.componentFactoryResolver.resolveComponentFactory(this.Component);var i=this.overlayContentViewContainerRef.createComponent(r),a=e.allowedBaseComps.get(this.OverlayTypeParam);if(i.instance instanceof a.comp)Object.assign(i.instance,this.Parameters),i.instance.onClose.subscribe((function(e){o.onClose.emit(e)}));else{var s="Provided window container should subclass of : "+a.error+"window will not work properly.";alert(s)}},e.prototype.setViewContainerRef=function(e){this.overlayContentViewContainerRef=e},e.prototype.GetRootElement=function(){return this.overlayContainerWrapperElementRef.nativeElement},e.prototype.DetectChanges=function(){this.changeDetectorRef.detectChanges()},e}();z.allowedBaseComps=new Map([[l.OverlayType.Overlay,{comp:e.BaseMagicOverlayContainer,error:"BaseMagicOverlayContainer . Overlay "}],[l.OverlayType.Alert,{comp:B,error:"BaseMagicAlertComponent. Alert "}],[l.OverlayType.ConfirmationBox,{comp:G,error:"BaseMagicConfirmComponent. Confirmation "}]]),z.ɵfac=function(e){return new(e||z)(n.ɵɵdirectiveInject(D),n.ɵɵdirectiveInject(n.NgModuleFactoryLoader),n.ɵɵdirectiveInject(n.Injector),n.ɵɵdirectiveInject(n.ComponentFactoryResolver),n.ɵɵdirectiveInject(n.ChangeDetectorRef))},z.ɵcmp=n.ɵɵdefineComponent({type:z,selectors:[["app-magic-overlay-container-wrapper"]],viewQuery:function(e,t){var r;(1&e&&n.ɵɵstaticViewQuery(W,!0),2&e)&&(n.ɵɵqueryRefresh(r=n.ɵɵloadQuery())&&(t.overlayContainerWrapperElementRef=r.first))},inputs:{Component:"Component",Parameters:"Parameters",OverlayTypeParam:"OverlayTypeParam"},outputs:{onClose:"onClose"},decls:7,vars:0,consts:[["tabIndex","0","magicFocus","",1,"overlay-container-wrapper-background",2,"width","0px","height","0px"],[1,"overlay-container-wrapper-background"],["overlayContainerWrapper",""],["magicViewContainerRef",""],["overlayContent",""],["tabIndex","0",1,"overlay-container-wrapper-background",2,"width","0px","height","0px"]],template:function(e,t){1&e&&(n.ɵɵelementStart(0,"div"),n.ɵɵelement(1,"div",0),n.ɵɵelementStart(2,"div",1,2),n.ɵɵelement(4,"div",3,4),n.ɵɵelementEnd(),n.ɵɵelement(6,"div",5),n.ɵɵelementEnd())},directives:[U,H],styles:[".overlay-container-wrapper-background[_ngcontent-%COMP%] {\n \n position: fixed;\n top: 0;\n z-index: 999;\n right: 0;\n bottom: 0;\n left: 0;\n }"]}),n.ɵsetClassMetadata(z,[{type:n.Component,args:[{selector:"app-magic-overlay-container-wrapper",template:'\n <div>\n <div class="overlay-container-wrapper-background" tabIndex="0" style="width: 0px; height: 0px;" magicFocus></div>\n <div class="overlay-container-wrapper-background" #overlayContainerWrapper>\n <div #overlayContent magicViewContainerRef>\n </div>\n </div>\n <div class="overlay-container-wrapper-background" tabIndex="0" style="width: 0px; height: 0px;" ></div>\n </div>\n ',styles:["\n .overlay-container-wrapper-background {\n /* modal background fixed across whole screen */\n position: fixed;\n top: 0;\n z-index: 999;\n right: 0;\n bottom: 0;\n left: 0;\n }\n "]}]}],(function(){return[{type:D},{type:n.NgModuleFactoryLoader},{type:n.Injector},{type:n.ComponentFactoryResolver},{type:n.ChangeDetectorRef}]}),{Component:[{type:n.Input}],Parameters:[{type:n.Input}],OverlayTypeParam:[{type:n.Input}],onClose:[{type:n.Output}],overlayContainerWrapperElementRef:[{type:n.ViewChild,args:["overlayContainerWrapper",{static:!0}]}]});var Y=function(){function e(){}return e.isConfirmBox=function(e){var t=15&e;return t===l.Styles.MSGBOX_BUTTON_OK_CANCEL||t===l.Styles.MSGBOX_BUTTON_ABORT_RETRY_IGNORE||t===l.Styles.MSGBOX_BUTTON_YES_NO_CANCEL||t===l.Styles.MSGBOX_BUTTON_YES_NO||t===l.Styles.MSGBOX_BUTTON_RETRY_CANCEL},e.convertToExcpectedResultBox=function(e,t){var n=15&e,r=l.Styles.MSGBOX_RESULT_OK;return n===l.Styles.MSGBOX_BUTTON_OK?r=l.Styles.MSGBOX_RESULT_OK:n===l.Styles.MSGBOX_BUTTON_OK_CANCEL?r=t?l.Styles.MSGBOX_RESULT_OK:l.Styles.MSGBOX_RESULT_CANCEL:n===l.Styles.MSGBOX_BUTTON_ABORT_RETRY_IGNORE?r=t?l.Styles.MSGBOX_RESULT_ABORT:l.Styles.MSGBOX_RESULT_RETRY:n===l.Styles.MSGBOX_BUTTON_YES_NO_CANCEL||n===l.Styles.MSGBOX_BUTTON_YES_NO?r=t?l.Styles.MSGBOX_RESULT_YES:l.Styles.MSGBOX_RESULT_NO:n===l.Styles.MSGBOX_BUTTON_RETRY_CANCEL&&(r=t?l.Styles.MSGBOX_RESULT_RETRY:l.Styles.MSGBOX_RESULT_CANCEL),r},e.showConfirmationBox=function(e,t,n){var r=!1,o=(l.Styles.MSGBOX_RESULT_OK,e+"\n\n"+t);return this.isConfirmBox(n)?r=confirm(o):(alert(o),r=!0),r},e}(),X=["modalheader"],K=["modalForeground"];function q(e,t){if(1&e){var r=n.ɵɵgetCurrentView();n.ɵɵelementStart(0,"button",8),n.ɵɵlistener("click",(function(){return n.ɵɵrestoreView(r),n.ɵɵnextContext().OnClose()})),n.ɵɵtext(1,"X"),n.ɵɵelementEnd()}}function $(e,t){if(1&e){var r=n.ɵɵgetCurrentView();n.ɵɵelementStart(0,"div",9,10),n.ɵɵtext(2),n.ɵɵelementStart(3,"button",11),n.ɵɵlistener("click",(function(){return n.ɵɵrestoreView(r),n.ɵɵnextContext().OnClose()})),n.ɵɵtext(4,"X"),n.ɵɵelementEnd(),n.ɵɵelementEnd()}if(2&e){var o=n.ɵɵnextContext();n.ɵɵadvance(2),n.ɵɵtextInterpolate1(" ",o.getText()," ")}}var Q=function(e){function r(t,r){var o=e.call(this)||this;return o.injector=t,o.componentFactoryResolver=r,o.ModalComp=null,o.ModalCompParameters={},o.onClose=new n.EventEmitter,o.componentRef=null,o}return C(r,e),r.prototype.ngOnInit=function(){var e=this.componentFactoryResolver.resolveComponentFactory(this.ModalComp);this.componentRef=this.modalbodyViewContainerRef.createComponent(e),Object.assign(this.componentRef.instance,this.ModalCompParameters)},r.prototype.setViewContainerRef=function(e){this.modalbodyViewContainerRef=e},r.prototype.getText=function(){return null!==this.componentRef?this.componentRef.instance.FormName():""},r.prototype.getStyle=function(){var e={};if(null!=this.componentRef){var t=this.componentRef.instance;e.width=t.Width(),e.height=t.Height(),t.IsCenteredToWindow()?e.margin="auto":(e["margin-left"]=t.X()+"px",e["margin-top"]=t.Y()+"px")}return e},r.prototype.getClientAreaStyles=function(){var e={};if(null!=this.componentRef){this.componentRef.instance;var n=this.getShowTitleBar()&&!t.isNullOrUndefined(this.headerElementRef)?this.headerElementRef.nativeElement.offsetHeight+1:0;if(!t.isNullOrUndefined(this.foregroundElementRef)){var r=this.foregroundElementRef.nativeElement.offsetHeight;e.height=r-n+"px";var o=this.foregroundElementRef.nativeElement.offsetWidth;e.width=o+"px"}e.overflow="auto"}return e},r.prototype.getShowTitleBar=function(){if(null!=this.componentRef)return this.componentRef.instance.ShowTitleBar()},r.prototype.OnClose=function(){this.onClose.emit()},r.prototype.OnBackgroundClick=function(){this.componentRef.instance.ShouldCloseOnBackgroundClick()&&this.OnClose()},r}(e.BaseMagicOverlayContainer);Q.ɵfac=function(e){return new(e||Q)(n.ɵɵdirectiveInject(n.Injector),n.ɵɵdirectiveInject(n.ComponentFactoryResolver))},Q.ɵcmp=n.ɵɵdefineComponent({type:Q,selectors:[["app-magic-overlay-container"]],viewQuery:function(e,t){var r;(1&e&&(n.ɵɵviewQuery(X,!0),n.ɵɵviewQuery(K,!0)),2&e)&&(n.ɵɵqueryRefresh(r=n.ɵɵloadQuery())&&(t.headerElementRef=r.first),n.ɵɵqueryRefresh(r=n.ɵɵloadQuery())&&(t.foregroundElementRef=r.first))},inputs:{ModalComp:"ModalComp",ModalCompParameters:"ModalCompParameters"},outputs:{onClose:"onClose"},features:[n.ɵɵInheritDefinitionFeature],decls:9,vars:4,consts:[[1,"modal-background",3,"click"],["tabindex","-1","style","float:right; border: none; background-color: transparent; outline: none; color: white",3,"click",4,"ngIf"],[1,"modal-foreground",3,"ngStyle"],["modalForeground",""],["class","modal-header",4,"ngIf"],[3,"ngStyle"],["magicViewContainerRef",""],["modalbody",""],["tabindex","-1",2,"float","right","border","none","background-color","transparent","outline","none","color","white",3,"click"],[1,"modal-header"],["modalheader",""],["tabindex","-1",2,"float","right",3,"click"]],template:function(e,t){1&e&&(n.ɵɵelementStart(0,"div"),n.ɵɵelementStart(1,"div",0),n.ɵɵlistener("click",(function(){return t.OnBackgroundClick()})),n.ɵɵtemplate(2,q,2,0,"button",1),n.ɵɵelementEnd(),n.ɵɵelementStart(3,"div",2,3),n.ɵɵtemplate(5,$,5,1,"div",4),n.ɵɵelementStart(6,"div",5),n.ɵɵelement(7,"div",6,7),n.ɵɵelementEnd(),n.ɵɵelementEnd(),n.ɵɵelementEnd()),2&e&&(n.ɵɵadvance(2),n.ɵɵproperty("ngIf",!t.getShowTitleBar()),n.ɵɵadvance(1),n.ɵɵproperty("ngStyle",t.getStyle()),n.ɵɵadvance(2),n.ɵɵproperty("ngIf",t.getShowTitleBar()),n.ɵɵadvance(1),n.ɵɵproperty("ngStyle",t.getClientAreaStyles()))},directives:[r.NgIf,r.NgStyle,H],styles:[".modal-foreground[_ngcontent-%COMP%]{background-color:#fff}.modal-background[_ngcontent-%COMP%], .modal-foreground[_ngcontent-%COMP%]{bottom:0;left:0;position:fixed;right:0;top:0}.modal-background[_ngcontent-%COMP%]{background-color:#000;opacity:.75}.modal-header[_ngcontent-%COMP%]{background-color:beige;border-bottom:2px solid red}"]}),n.ɵsetClassMetadata(Q,[{type:n.Component,args:[{selector:"app-magic-overlay-container",template:'\n <div>\n <div class="modal-background" (click)="OnBackgroundClick()">\n <button (click)="OnClose()" tabindex="-1" style="float:right; border: none; background-color: transparent; outline: none; color: white" *ngIf="!getShowTitleBar()">X</button>\n </div>\n <div #modalForeground class="modal-foreground" [ngStyle]="getStyle()">\n <div #modalheader class="modal-header" *ngIf="getShowTitleBar()">\n {{getText()}}\n <button (click)="OnClose()" style="float:right" tabindex="-1">X</button>\n </div>\n <div [ngStyle]="getClientAreaStyles()">\n <div #modalbody magicViewContainerRef>\n </div>\n </div>\n </div>\n </div>\n ',styleUrls:["./magic-overlay-container.css"]}]}],(function(){return[{type:n.Injector},{type:n.ComponentFactoryResolver}]}),{headerElementRef:[{type:n.ViewChild,args:["modalheader",{static:!1}]}],foregroundElementRef:[{type:n.ViewChild,args:["modalForeground",{static:!1}]}],ModalComp:[{type:n.Input}],ModalCompParameters:[{type:n.Input}],onClose:[{type:n.Output}]});var J=function(){function e(){}return e.prototype.getComponent=function(){return Q},e}();J.ɵfac=function(e){return new(e||J)},J.ɵprov=n.ɵɵdefineInjectable({token:J,factory:J.ɵfac}),n.ɵsetClassMetadata(J,[{type:n.Injectable}],null,null);var Z=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(B);Z.ɵfac=function(e){return ee(e||Z)},Z.ɵcmp=n.ɵɵdefineComponent({type:Z,selectors:[["sample-magic-alert-component"]],features:[n.ɵɵInheritDefinitionFeature],decls:8,vars:2,consts:[[1,"mg-message-background"],[3,"click"]],template:function(e,t){1&e&&(n.ɵɵelementStart(0,"div"),n.ɵɵelementStart(1,"div",0),n.ɵɵelementStart(2,"h2"),n.ɵɵtext(3),n.ɵɵelementEnd(),n.ɵɵelementStart(4,"p"),n.ɵɵtext(5),n.ɵɵelementEnd(),n.ɵɵelementStart(6,"button",1),n.ɵɵlistener("click",(function(){return t.OnClose()})),n.ɵɵtext(7,"OK"),n.ɵɵelementEnd(),n.ɵɵelementEnd(),n.ɵɵelementEnd()),2&e&&(n.ɵɵadvance(3),n.ɵɵtextInterpolate1(" ",t.title,""),n.ɵɵadvance(2),n.ɵɵtextInterpolate1("",t.message," "))},styles:[".mg-message-background[_ngcontent-%COMP%] {\n background-color: #F5F5F5;\n text-align: center;\n width: 40%;\n font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n padding: 17px;\n border-radius: 5px;\n text-align: center;\n margin-top: 10% ;\n margin-left: auto;\n margin-right: auto;\n border: 1px solid gray;\n }\n\n button[_ngcontent-%COMP%] {\n background-color: #8CD4F5;\n color: white;\n border: none;\n box-shadow: none;\n font-size: 17px;\n font-weight: 500;\n -webkit-border-radius: 4px;\n border-radius: 5px;\n padding: 10px 32px;\n margin: 26px 5px 0 5px;\n cursor: pointer;\n }"]});var ee=n.ɵɵgetInheritedFactory(Z);n.ɵsetClassMetadata(Z,[{type:n.Component,args:[{selector:"sample-magic-alert-component",template:'<div>\n <div class="mg-message-background">\n <h2> {{title}}</h2>\n <p>{{message}} </p>\n\n <button (click)="OnClose()">OK</button>\n </div>\n </div>',styles:["\n .mg-message-background {\n background-color: #F5F5F5;\n text-align: center;\n width: 40%;\n font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n padding: 17px;\n border-radius: 5px;\n text-align: center;\n margin-top: 10% ;\n margin-left: auto;\n margin-right: auto;\n border: 1px solid gray;\n }\n\n button {\n background-color: #8CD4F5;\n color: white;\n border: none;\n box-shadow: none;\n font-size: 17px;\n font-weight: 500;\n -webkit-border-radius: 4px;\n border-radius: 5px;\n padding: 10px 32px;\n margin: 26px 5px 0 5px;\n cursor: pointer;\n }\n "]}]}],null,null);var te=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(G);te.ɵfac=function(e){return ne(e||te)},te.ɵcmp=n.ɵɵdefineComponent({type:te,selectors:[["sample-magic-confirmation-box"]],features:[n.ɵɵInheritDefinitionFeature],decls:11,vars:2,consts:[[1,"mg-message-background"],[3,"click"],[1,"cancel",3,"click"]],template:function(e,t){1&e&&(n.ɵɵelementStart(0,"div"),n.ɵɵelementStart(1,"div",0),n.ɵɵelementStart(2,"h2"),n.ɵɵtext(3),n.ɵɵelementEnd(),n.ɵɵtext(4),n.ɵɵelement(5,"br"),n.ɵɵelement(6,"br"),n.ɵɵelementStart(7,"button",1),n.ɵɵlistener("click",(function(){return t.OnClose(!0)})),n.ɵɵtext(8,"OK"),n.ɵɵelementEnd(),n.ɵɵelementStart(9,"button",2),n.ɵɵlistener("click",(function(){return t.OnClose(!1)})),n.ɵɵtext(10,"Cancel"),n.ɵɵelementEnd(),n.ɵɵelementEnd(),n.ɵɵelementEnd()),2&e&&(n.ɵɵadvance(3),n.ɵɵtextInterpolate1(" ",t.title,""),n.ɵɵadvance(1),n.ɵɵtextInterpolate1(" ",t.message," "))},styles:[".mg-message-background[_ngcontent-%COMP%] {\n background-color: #F5F5F5;\n text-align: center;\n width: 40%;\n font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n padding: 17px;\n border-radius: 5px;\n text-align: center;\n margin-top: 10% ;\n margin-left: auto;\n margin-right: auto;\n border: 1px solid gray;\n }\n\n button[_ngcontent-%COMP%] {\n background-color: #8CD4F5;\n color: white;\n border: none;\n box-shadow: none;\n font-size: 17px;\n font-weight: 500;\n -webkit-border-radius: 4px;\n border-radius: 5px;\n padding: 10px 32px;\n margin: 26px 5px 0 5px;\n cursor: pointer;\n }\n \n button.cancel[_ngcontent-%COMP%] {\n background-color: #C1C1C1;\n }"]});var ne=n.ɵɵgetInheritedFactory(te);n.ɵsetClassMetadata(te,[{type:n.Component,args:[{selector:"sample-magic-confirmation-box",template:'<div>\n <div class="mg-message-background">\n <h2> {{title}}</h2>\n {{message}}\n <br>\n <br>\n\n <button (click)="OnClose(true)">OK</button>\n <button class="cancel" (click)="OnClose(false)">Cancel</button>\n </div>\n </div>',styles:["\n .mg-message-background {\n background-color: #F5F5F5;\n text-align: center;\n width: 40%;\n font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;\n padding: 17px;\n border-radius: 5px;\n text-align: center;\n margin-top: 10% ;\n margin-left: auto;\n margin-right: auto;\n border: 1px solid gray;\n }\n\n button {\n background-color: #8CD4F5;\n color: white;\n border: none;\n box-shadow: none;\n font-size: 17px;\n font-weight: 500;\n -webkit-border-radius: 4px;\n border-radius: 5px;\n padding: 10px 32px;\n margin: 26px 5px 0 5px;\n cursor: pointer;\n }\n \n button.cancel {\n background-color: #C1C1C1;\n }\n "]}]}],null,null);var re=function(){function e(){}return e.prototype.showDefaultConfirmations=function(){return!0},e.prototype.getAlertComponent=function(){return Z},e.prototype.getConfirmtionComponent=function(){return te},e}();re.ɵfac=function(e){return new(e||re)},re.ɵprov=n.ɵɵdefineInjectable({token:re,factory:re.ɵfac}),n.ɵsetClassMetadata(re,[{type:n.Injectable}],null,null);var oe=function(){function e(e,t,n,r,o){this.componentFactoryResolver=e,this.componentList=t,this.engineMagicService=n,this.overlayContainerMagicProvider=r,this.confirmationComponentsMagicProvider=o,this.overlayWindowFocusManager=null}return e.prototype.init=function(e,t){this.overlayWindowsContainerViewRef=e,this.overlayWindowFocusManager=new ie(t)},e.prototype.open=function(e,t,n){var r=this,o=null!=this.componentList.lazyLoadModulesMap&&this.componentList.lazyLoadModulesMap.hasOwnProperty(e)?null:this.componentList.getComponent(e),i={taskIdParam:t,taskDescription:n};this.createModalComponent({MagicFormName:e,ModalComp:o,ModalCompParameters:i},this.overlayContainerMagicProvider.getComponent(),l.OverlayType.Overlay).instance.onClose.subscribe((function(){var e=c.getGuiEventObj("close",null,0);e.TaskID=t,r.engineMagicService.insertEvent(e)}))},e.prototype.close=function(e){this.overlayWindowsContainerViewRef.remove(),this.overlayWindowFocusManager.popDialog();var t=c.getGuiEventObj("dispose",null,0);t.TaskID=e,this.engineMagicService.insertEvent(t)},e.prototype.openConfirmationBox=function(e,t,n){var r=this;if(this.confirmationComponentsMagicProvider.showDefaultConfirmations()){var o=Y.showConfirmationBox(e,t,n);this.finishConfirmation(n,o)}else{var i=Y.isConfirmBox(n)?this.confirmationComponentsMagicProvider.getConfirmtionComponent():this.confirmationComponentsMagicProvider.getAlertComponent(),a=Y.isConfirmBox(n)?l.OverlayType.ConfirmationBox:l.OverlayType.Alert;this.createModalComponent({title:e,message:t},i,a).instance.onClose.subscribe((function(e){r.overlayWindowsContainerViewRef.remove(),r.overlayWindowFocusManager.popDialog(),r.finishConfirmation(n,e)}))}},e.prototype.finishConfirmation=function(e,t){var n=c.getGuiEventObj("confirmationClosed",null,0);n.keyCode=Y.convertToExcpectedResultBox(e,t),this.engineMagicService.insertEvent(n)},e.prototype.createModalComponent=function(e,t,n){var r,o={Component:t,Parameters:e,OverlayTypeParam:n},i=this.componentFactoryResolver.resolveComponentFactory(z);return r=this.overlayWindowsContainerViewRef.createComponent(i),Object.assign(r.instance,o),this.overlayWindowFocusManager.pushDialog(r.instance.GetRootElement()),r.instance.DetectChanges(),r},e}();oe.ɵfac=function(e){return new(e||oe)(n.ɵɵinject(n.ComponentFactoryResolver),n.ɵɵinject(D),n.ɵɵinject(x),n.ɵɵinject(J),n.ɵɵinject(re))},oe.ɵprov=n.ɵɵdefineInjectable({token:oe,factory:oe.ɵfac}),n.ɵsetClassMetadata(oe,[{type:n.Injectable}],(function(){return[{type:n.ComponentFactoryResolver},{type:D},{type:x},{type:J},{type:re}]}),null);var ie=function(){function e(e){this.rootMagicElement=null,this.openDialogList=new Array(0),this.ignoreUtilFocusChanges=!1,this.lastFocus=null,this.focusListener=null,this.rootMagicElement=e}return e.prototype.pushDialog=function(e){0===this.openDialogList.length&&(this.focusListener=this.trapFocus.bind(this),document.addEventListener("focus",this.focusListener,!0)),this.openDialogList.push(new ae(e,document.activeElement instanceof HTMLElement?document.activeElement:null))},e.prototype.popDialog=function(){var e=this.openDialogList.pop();this.attemptFocus(e.FocusElementOnClose),0===this.openDialogList.length&&(document.removeEventListener("focus",this.focusListener,!0),this.focusListener=null)},e.prototype.trapFocus=function(e){if(!this.ignoreUtilFocusChanges&&this.openDialogList.length>0){var t=this.openDialogList[this.openDialogList.length-1].RootElement;t.contains(e.target)?this.lastFocus=e.target:(this.rootMagicElement.contains(e.target)&&(this.focusFirstDescendant(t),this.lastFocus==document.activeElement&&this.focusLastDescendant(t)),this.lastFocus=document.activeElement)}},e.prototype.focusFirstDescendant=function(e){for(var t=0;t<e.childNodes.length;t++){var n=e.childNodes[t];if(this.attemptFocus(n)||this.focusFirstDescendant(n))return!0}return!1},e.prototype.focusLastDescendant=function(e){for(var t=e.childNodes.length-1;t>=0;t--){var n=e.childNodes[t];if(this.attemptFocus(n)||this.focusLastDescendant(n))return!0}return!1},e.prototype.attemptFocus=function(e){if(!this.isFocusable(e))return!1;this.ignoreUtilFocusChanges=!0;try{e.focus()}catch(e){}return this.ignoreUtilFocusChanges=!1,document.activeElement===e},e.prototype.isFocusable=function(e){if(t.isNullOrUndefined(e))return!1;if(e.tabIndex>0||0===e.tabIndex&&null!==e.getAttribute("tabIndex"))return!0;if(e.tabIndex<0)return!1;if(e.disabled)return!1;switch(e.nodeName){case"A":return!!e.href&&"ignore"!=e.rel;case"INPUT":return"hidden"!=e.type&&"file"!=e.type;case"BUTTON":case"SELECT":case"TEXTAREA":return!0;default:return!1}},e}(),ae=function(){function e(e,t){this.rootElement=e,this.focusElementOnClose=t}return Object.defineProperty(e.prototype,"RootElement",{get:function(){return this.rootElement},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"FocusElementOnClose",{get:function(){return this.focusElementOnClose},enumerable:!1,configurable:!0}),e}(),se=function(){function e(e,t){this.magic=e,this.overlayWindowService=t,this.Records=new P,this.formGroups=[],this.refreshDom=new s.Subject,this.detectChanges=new s.Subject,this.interactiveCommands=new s.Subject,this.OnSelectedRowChanged=new n.EventEmitter,this.customPropertiesSubject=new s.Subject,this.recordsCountChangeSubject=new s.Subject,this.oldPageSize=0,this.Records.setGuiTopIndex(0),this.mgInputDateFormat=null}return e.prototype.getIsLoggenIn=function(){return this.magic.getIsLoggedIn()},Object.defineProperty(e.prototype,"taskId",{get:function(){return this._taskId},set:function(e){this._taskId=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"ScreenControlsData",{get:function(){return this.Records.list[0]},enumerable:!1,configurable:!0}),e.prototype.settemplate=function(e){this.template=e},e.prototype.buildScreenModeControls=function(){var e=new i.FormGroup({});for(var t in this.template)if("0"==this.template[t]){var n=new i.FormControl("");this.setStubValue(0,n,t),e.addControl(t,n)}this.ScreenModeControls=e},e.prototype.isTableControl=function(e){return"1"==this.template[e]},e.prototype.getMgInputDateFormat=function(){return this.mgInputDateFormat},e.prototype.getFormControl=function(e,n){var r,o=this.isTableControl(n)?this.formGroups[e]:this.ScreenModeControls;return t.isNullOrUndefined(o)||(o.get(n),r=o.controls[n]),r},e.prototype.setInputTextValue=function(e,n,r){this.setValue(e,n,this.ConvertValToNative(e,0,r));var o=this.getFormControl(n,e);t.isNullOrUndefined(r)||o.setValue(r)},e.prototype.buildTableRowControls=function(e){var t=new i.FormGroup({});for(var n in this.template)if("1"==this.template[n]){var r=new i.FormControl("");this.setStubValue(e,r,n),t.addControl(n,r)}this.formGroups[e]=t},e.prototype.updateRecordsBeforeCurrentView=function(e){this.Records.recordsBeforeCurrentView=e},e.prototype.setIncludesFirst=function(e){this.Records.includesFirst=e},e.prototype.setIncludesLast=function(e){this.Records.includesLast=e},e.prototype.markRowAsCreated=function(e){this.Records.markRowAsCreated(e)},e.prototype.markRowAsNotCreated=function(e){this.Records.markRowAsNotCreated(e)},e.prototype.startRowEditing=function(e){this.Records.startRowEditing(e)},e.prototype.stopRowEditing=function(e){this.Records.stopRowEditing(e)},e.prototype.isRowInRowEditing=function(e){return this.Records.isRowInRowEditing(e)},e.prototype.setIsEmptyDataView=function(e){this.Records.isEmptyDataView!==e&&(e&&this.recordsCountChangeSubject.next(0),this.Records.isEmptyDataView=e,this.tableService.refreshDataSource(),this.refreshView())},e.prototype.initTask=function(e,n){var r=this;this.Records.createFirst(),this.oldPageSize=0,this.IsStub()?this.loadData():(this.taskId=e,this.settemplate(n)),this.buildScreenModeControls(),t.isNullOrUndefined(this.subscribeRefreshDom)||this.subscribeRefreshDom.unsubscribe(),t.isNullOrUndefined(this.subscribeInteractiveCommands)||this.subscribeInteractiveCommands.unsubscribe(),this.subscribeRefreshDom=this.magic.refreshDom.pipe(p.filter((function(e){return e.TaskTag===r.taskId}))).subscribe((function(e){r.executeCommand(e)})),this.subscribeInteractiveCommands=this.magic.interactiveCommands.pipe(p.filter((function(e){return e.TaskTag===r.taskId}))).subscribe((function(e){r.executeInteractiveCommand(e)}))},e.prototype.refreshView=function(){this.detectChanges.next("")},e.prototype.insertEvent=function(e){e.TaskID=this.taskId,this.magic.insertEvent(e)},e.prototype.GetControlPictureMask=function(e){return this.magic.GetControlPictureMask(this.taskId,e)},e.prototype.ValidateControlValue=function(e,t){return this.magic.ValidateControlValue(this.taskId,e,t)},e.prototype.GetRangedValue=function(e,t){return this.magic.GetRangedValue(this.taskId,e,t)},e.prototype.GetFldRanges=function(e){return this.magic.GetFldRanges(this.taskId,e)},e.prototype.getProperty=function(e,n,r){if(t.isNullOrUndefined(r)&&(r="0"),this.IsStub())return this.getPropertyStub(this.Records.list[r],e,n);var o=this.Records.list[r];return t.isNullOrUndefined(o)?void 0:this.Records.list[r].getProperty(e,n)},e.prototype.getPropertyStub=function(e,t,n){return t in(e=e.ControlsProperties)&&n in e[t].properties?e[t].properties[n]:""},e.prototype.getStyleStub=function(e,t,n){return(e=e.ControlsProperties)[t].stylesMap.get(n)},e.prototype.getClasses=function(e,n){return t.isNullOrUndefined(n)&&(n="0"),this.Records.list[n].getControlMetadata(e).classes},e.prototype.getStyle=function(e,n,r){if(t.isNullOrUndefined(r)&&(r="0"),this.IsStub())return this.getStyleStub(this.Records.list[r],e,n);var o=this.Records.list[r].getControlMetadata(e).stylesMap.get(n);return _.magicValueGetStyle(n,o)},e.prototype.getValue=function(e,n){return t.isNullOrUndefined(n)&&(n="0"),this.Records.list.length>+n?this.Records.list[n].values[e]:""},e.prototype.getFormattedValue=function(e,t){return this.magic.GetFormattedValue(this.taskId,e,t)},e.prototype.setValue=function(e,t,n){return this.Records.list[t].setValue(e,n)},e.prototype.executeInteractiveCommand=function(e){L.executeInteractiveCommand(this,e,this.overlayWindowService),this.interactiveCommands.next(e)},e.prototype.handleSetProperty=function(e,n){var r=e.CtrlName,o=e.line||0,i=this.getGuiRowId(o,n);if(e.Operation===l.HtmlProperties.SelectedRow)e.obj1!==l.GuiConstants.NO_ROW_SELECTED&&(i=this.getGuiRowId(e.obj1,!0),this.Records.list[i].getControlMetadata(r).properties.set(e.Operation,e.line),this.tableService.selectRow(i.toString()),this.OnSelectedRowChanged.emit(i.toString()));else if(e.Operation===l.HtmlProperties.Enabled){var a=this.getFormControl(i.toString(),r);t.isNullOrUndefined(a)||(e.obj1?a.enable():a.disable()),this.Records.list[i].getControlMetadata(r).properties.set(e.Operation,e.obj1)}else this.Records.list[i].getControlMetadata(r).properties.set(e.Operation,e.obj1)},e.prototype.executeCommand=function(e){var n,r=e.line||0,o=0,i=e.CtrlName,a=this.isTableControl(i);switch(null!==e.obj&&(a=a||e.obj.IsTableChild),o=this.getGuiRowId(r,a),e.CommandType){case l.CommandType.SET_IS_LOGGED_IN:break;case l.CommandType.SET_TABLE_TOP_INDEX:this.tableService.setTableTopIndex(e.number);break;case l.CommandType.REFRESH_TASK:this.tableService.refreshDataSource(),this.refreshView();break;case l.CommandType.SET_TABLE_ITEMS_COUNT:t.isUndefined(e.number)||(this.tableService.updateTableSize(e.number),e.number>0&&this.Records.sizeUpdated&&!this.Records.isEmptyDataView&&(this.recordsCountChangeSubject.next(e.number),this.Records.sizeUpdated=!1));break;case l.CommandType.SET_RECORDS_BEFORE_CURRENT_VIEW:this.updateRecordsBeforeCurrentView(e.number);break;case l.CommandType.CREATE_TABLE_ROW:o=this.getGuiRowId(e.number,!0),this.buildTableRowControls(o),this.markRowAsCreated(o);break;case l.CommandType.SET_IS_ROW_EDITING:o=this.getGuiRowId(e.line,e.value),this.startRowEditing(o);break;case l.CommandType.SET_NOT_IS_ROW_EDITING:o=this.getGuiRowId(e.line,e.value),this.stopRowEditing(o);break;case l.CommandType.UNDO_CREATE_TABLE_ROW:this.markRowAsNotCreated(this.getGuiRowId(e.number,!0));break;case l.CommandType.SET_TABLE_INCLUDES_FIRST:this.setIncludesFirst(e.Bool1);break;case l.CommandType.SET_TABLE_INCLUDES_LAST:this.setIncludesLast(e.Bool1);break;case l.CommandType.SET_PROPERTY:this.handleSetProperty(e,a),e.Operation==l.HtmlProperties.ReadOnly&&this.refreshDom.next(e);break;case l.CommandType.PROP_SET_USER_PROPERTY:(n=this.Records.list[o].getControlMetadata(i)).userProperties.get(e.Operation)!==e.obj1&&(n.userProperties.set(e.Operation,e.obj1),this.customPropertiesSubject.next({propertyName:i+"~"+e.Operation,value:e.obj1,rowId:o}));break;case l.CommandType.PROP_SET_CUSTOM_VALIDATOR:n=this.Records.list[o].getControlMetadata(i);var s=this.getFormControl(o.toString(),i);null!=s&&(n.customValidators.set(e.Operation,e.obj1),null!=s.validator?s.setValidators([s.validator,this.customValidator(o.toString(),i)]):s.setValidators(this.customValidator(o.toString(),i)),s.updateValueAndValidity());break;case l.CommandType.SET_CLASS:(n=this.Records.list[o].getControlMetadata(i)).setClass(e.Operation,e.obj1);break;case l.CommandType.SET_STYLE:(n=this.Records.list[o].getControlMetadata(i)).setStyle(e.Operation,e.obj1);break;case l.CommandType.SET_ATTRIBUTE:(n=this.Records.list[0].getControlMetadata(i)).dataType=String.fromCharCode(e.number);break;case l.CommandType.SET_VALUE:this.Records.list[o].values[i]=e.value;var c=this.getFormControl(o.toString(),i);t.isNullOrUndefined(c)||c.setValue(this.ConvertValFromNative(i,e.line,e.value));break;case l.CommandType.CREATE_SUB_FORM:this.mgSubformService.addSubformComp(e.CtrlName,e.userDropFormat.toString(),e.str,e.fileName,e.contextID,e.params,e.Bool1);break;case l.CommandType.CLOSE_SUB_FORM:this.mgSubformService.deleteSubformComp(e.CtrlName,e.userDropFormat.toString());break;case l.CommandType.SET_EMPTY_DATAVIEW:this.setIsEmptyDataView(e.Bool1);break;case l.CommandType.SET_FOCUS:this.refreshDom.next(e)}},e.prototype.customValidator=function(e,t){var n=this;return function(r){var o,i,a,s;s=n.Records.list[e].getControlMetadata(t);try{for(var c=E(s.customValidators.keys()),l=c.next();!l.done;l=c.next()){var u=l.value;if(!s.customValidators.get(u).isValid())return(a={})[u]=!0,a}}catch(e){o={error:e}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(o)throw o.error}}return null}},e.prototype.ConvertValToNative=function(e,t,n){switch(this.Records.list[0].getControlMetadata(e).dataType){case u.StorageAttribute.BOOLEAN:if("string"==typeof n){var r=this.GetFldRanges(e),o=r.indexOf(","),i=r.substr(0,o),a=r.substr(o+1);return!!d.NString.Equals(n,i,!0)||!d.NString.Equals(n,a,!0)&&n}return n;case u.StorageAttribute.TIME:if("string"==typeof n){var s=n.indexOf(":",0),c=+n.substr(0,s),l=+n.substr(s+1,2),p=0;n.length>5&&(s=n.indexOf(":",s+1))>=0&&(p=+n.substr(s+1,2)),n.indexOf("PM")>0&&(c+=12);var m=new Date;return m.setHours(c),m.setMinutes(l),m.setSeconds(p),m}return n;case u.StorageAttribute.NUMERIC:return null===n?0:n;default:return n}},e.prototype.ConvertValFromNative=function(e,t,n){switch(this.Records.list[0].getControlMetadata(e).dataType){case u.StorageAttribute.TIME:if(n instanceof Date){var r=new d.StringBuilder,o=n.getHours()>9?"{0}":"0{0}";return r.AppendFormat(o,n.getHours().toString()),r.Append(":"),o=n.getMinutes()>9?"{0}":"0{0}",r.AppendFormat(o,n.getMinutes().toString()),n.getSeconds()>0&&(r.Append(":"),o=n.getSeconds()>9?"{0}":"0{0}",r.AppendFormat(o,n.getSeconds().toString())),r.ToString()}return n;case u.StorageAttribute.BOOLEAN:var i;if(i=this.Records.list[0].getControlMetadata(e),"boolean"==typeof n&&i.rangeValidator){var a=this.GetFldRanges(e),s=a.indexOf(","),c=a.substr(0,s),l=a.substr(s+1);return n?c:l}return n;default:return n}},e.prototype.resize=function(e,t){var n=c.getGuiEventObj("resize","table",0);n.PageSize=e,n.Line=t,this.insertEvent(n)},e.prototype.onScrollDown=function(){if(!this.Records.includesLast){var e=c.getGuiEventObj("getRows","table",0);e.Line=this.formGroups.length,this.insertEvent(e)}},e.prototype.setTitle=function(e){this.mgTitleService.setTitle(e)},e.prototype.getGuiRowId=function(e,t){return t?e+this.Records.recordsBeforeCurrentView:0},e.prototype.getDvRowId=function(e){return e-this.Records.recordsBeforeCurrentView},e.prototype.dispose=function(){this.refreshDom.complete(),this.detectChanges.complete(),this.subscribeInteractiveCommands.unsubscribe(),this.subscribeRefreshDom.unsubscribe(),this.interactiveCommands.complete(),this.customPropertiesSubject.complete(),this.OnSelectedRowChanged.complete()},e.prototype.onComboboxSelectionChanged=function(e,n,r){var o=c.getGuiEventObj("selectionchanged",n,r);if("number"==typeof e)o.Value=e;else if(t.isNullOrUndefined(e.target))o.Value=e.value;else{for(var i=new Array(e.target.selectedOptions.length),a=0;a<e.target.selectedOptions.length;a++)i[a]=e.target.selectedOptions[a].index;o.Value=i.join(",")}this.insertEvent(o)},e.prototype.onListBoxSelectionChanged=function(e,n){for(var r,o=c.getGuiEventObj("selectionchanged",n,0),i=(r=t.isNullOrUndefined(e.target)?e.source.selectedOptions.selected:e.target.selectedOptions).length,a=new Array(i),s=0;s<i;s++)t.isNullOrUndefined(e.target)?a[s]=r[s].value:a[s]=r[s].index;o.Value=a,this.insertEvent(o)},e.prototype.onCheckChanged=function(e,t,n){void 0===n&&(n=0);var r=c.getGuiEventObj("selectionchanged",t,n);"boolean"==typeof e?r.Value=e:void 0===e.target?r.Value=e.checked:r.Value=e.target.checked,this.insertEvent(r)},e.prototype.mgOnTabSelectionChanged=function(e,t){var n=c.getGuiEventObj("selectionchanged",e,0);n.Value=t.toString(),this.insertEvent(n)},e.prototype.mgOnRadioSelectionChanged=function(e,t){var n=this.getFormControl("0",t),r=c.getGuiEventObj("selectionchanged",t,0);"string"!=typeof n.value?r.Value=n.value.index:r.Value=n.value,this.insertEvent(r)},e.prototype.close=function(){this.insertEvent(c.getGuiEventObj("close",null,0))},e.prototype.IsStub=function(){return this.magic.isStub},e.prototype.saveData=function(e){this.magic.saveData(e)},e.prototype.createData=function(){var e={records:this.Records,template:this.template},t="loadData():any {\n let stubData = "+JSON.stringify(e)+";\n this.loadStubData(stubData);}";console.log(t),this.saveData(t)},e.prototype.loadStubData=function(e){this.Records=e.records,this.settemplate(e.template),this.taskId="1";for(var t=0;t<this.Records.list.length;t++)this.buildTableRowControls(t)},e.prototype.loadData=function(){alert("Please, overwrite method loadData")},e.prototype.setStubValue=function(e,t,n){if(this.IsStub())try{var r=this.Records.list[e].values[n];t.setValue(r)}catch(e){}},e}();se.ɵfac=function(e){return new(e||se)(n.ɵɵinject(x),n.ɵɵinject(oe))},se.ɵprov=n.ɵɵdefineInjectable({token:se,factory:se.ɵfac}),n.ɵsetClassMetadata(se,[{type:n.Injectable}],(function(){return[{type:x},{type:oe}]}),null);var ce=function(){function e(e,t){this.componentList=e,this.task=t,this.shouldOpenFieldTextEditor=!0}return e.prototype.refreshDataSource=function(){},e.prototype.getPageSize=function(){return 10},e.prototype.getMaxRowsInTable=function(){return this.task.Records.list.length},e.prototype.selectRow=function(e){this.selectedItem=e},e.prototype.getSelectedRow=function(){return this.selectedItem},e.prototype.selectedRow=function(){return null},e.prototype.selectPage=function(e){},e.prototype.OpenDialogForControl=function(e){return"MAT-SELECT"!==e.tagName&&"MAT-CHECKBOX"!==e.tagName&&"INPUT"!==e.tagName&&"SELECT"!==e.tagName},e.prototype.getDialog=function(){return null},e.prototype.onScrollDown=function(){this.task.onScrollDown()},e.prototype.sortData=function(e){},e.prototype.mgOnPaginateChange=function(e){},e.prototype.mgOptionChanged=function(e){},e.prototype.updateTableSize=function(e){0===e&&(e=1,this.task.Records.clearFirstTableRecord(this.task.template)),this.task.formGroups.length=e,this.task.Records.updateSize(e),this.task.setIncludesFirst(!1)},e.prototype.setTableTopIndex=function(e){this.task.Records.includesFirst||e++,this.task.Records.setGuiTopIndex(e)},e.prototype.getTableTopIndex=function(){var e=this.task.Records.getGuiTopIndex();return this.task.Records.includesFirst||e--,e},e}();ce.ɵfac=function(e){return new(e||ce)(n.ɵɵinject(D),n.ɵɵinject(se))},ce.ɵprov=n.ɵɵdefineInjectable({token:ce,factory:ce.ɵfac}),n.ɵsetClassMetadata(ce,[{type:n.Injectable}],(function(){return[{type:D},{type:se}]}),null);var le=function(){function e(e){this.titleService=e}return e.prototype.setTitle=function(e){this.titleService.setTitle(e)},e}();le.ɵfac=function(e){return new(e||le)(n.ɵɵinject(m.Title))},le.ɵprov=n.ɵɵdefineInjectable({token:le,factory:le.ɵfac}),n.ɵsetClassMetadata(le,[{type:n.Injectable}],(function(){return[{type:m.Title}]}),null);var ue=function(){function e(e){this.task=e,this.Logger=null,this.Logger=u.Logger.Instance}return e.prototype.checkIsReadOnly=function(e){var t;return null===(t=this.task.Records.list[0].getControlMetadata(e)).properties.get(l.HtmlProperties.ReadOnly)||!0!==t.properties.get(l.HtmlProperties.ReadOnly)},e.prototype.getText=function(e,t){return this.task.getProperty(e,l.HtmlProperties.Text,t)},e.prototype.getTabpageText=function(e,t){var n=this.task.getProperty(e,l.HtmlProperties.ItemsList);return void 0!==n?n[t].displayValue:""},e.prototype.getImage=function(e,t){return this.task.getProperty(e,l.HtmlProperties.Image,t)},e.prototype.isImageExists=function(e,n){var r=this.task.getProperty(e,l.HtmlProperties.Image,n);return!t.isNullOrUndefined(r)},e.prototype.getClasses=function(e,t){return this.task.getClasses(e,t)},e.prototype.getStyle=function(e,t,n){return this.task.getStyle(e,t,n)},e.prototype.getVisible=function(e,t){return this.getProperty(e,l.HtmlProperties.Visible,t)?"visible":"hidden"},e.prototype.getNumericPicture=function(e){if(t.isNullOrUndefined(e))return null;var n=new l.PIC(e,u.StorageAttribute.NUMERIC,0),r={};(r.prefix="",n.getPosPref_().length>0&&n.getNegPref_().length>0)&&("-"+n.getPosPref_()==n.getNegPref_()&&(r.prefix=n.getPosPref_()));return n.getPosSuff_().length>0?r.suffix=n.getPosSuff_():r.suffix="",n.isNegative()?r.allowNegative=!0:r.allowNegative=!1,n.getDec()>=0&&(r.precision=n.getDec()),n.isLeft()&&(r.align="left"),r.decimal=l.GuiEnvironment.Environment.GetDecimal(),n.withComa()?r.thousands=l.GuiEnvironment.Environment.GetThousands():r.thousands="",n.getWholes()&&(r.wholes=n.getWholes()),r},e.prototype.getMustInput=function(e,t){return this.getProperty(e,l.HtmlProperties.MustInput,t)?"true":"false"},e.prototype.isDisabled=function(e,t){return!0!==this.getProperty(e,l.HtmlProperties.Enabled,t)||null},e.prototype.getProperty=function(e,t,n){return this.task.getProperty(e,t,n)},e.prototype.getTitle=function(e,t){return this.task.getProperty(e,l.HtmlProperties.Tooltip,t)},e.prototype.getZoomButtonTitle=function(e,t){return this.task.getProperty(e,l.HtmlProperties.ZoomButtonTooltip,t)},e.prototype.getSelectedValue=function(e,t){return this.task.getProperty(e,l.HtmlProperties.SelectedValue,t)},e.prototype.getPlaceholder=function(e,t){return this.task.getProperty(e,l.HtmlProperties.PlaceHolder,t)},e.prototype.getType=function(e,t){return this.task.getProperty(e,l.HtmlProperties.Password,t)?"password":"text"},e.prototype.getTabIndex=function(e,t){return this.task.getProperty(e,l.HtmlProperties.TabIndex,t)},e.prototype.getValue=function(e,t){return this.task.getValue(e,t)},e.prototype.getFormattedValue=function(e,t){var n=this.task.getValue(e,t);return n=this.task.getFormattedValue(e,n)},e.prototype.getPicture=function(e,n){if(t.isNullOrUndefined(e))return null;var r=this.task.GetControlPictureMask(e);return null!=r?r.getFormat().toString():null},e.prototype.getCustomProperty=function(e,t,n){if(-1==e.indexOf("~"))return this.getCustomProperty_1(e,t,n);var r=e.split("~")[0],o=e.split("~")[1];return this.getCustomProperty_1(r,o,t)},e.prototype.getCustomProperty_1=function(e,n,r){var o;t.isNullOrUndefined(r)&&(r="0");var i=this.task.Records.list[r];if(t.isNullOrUndefined(i));else{var a=i.getControlMetadata(e);a.userProperties.has(n)&&(o=a.userProperties.get(n))}return o},e.prototype.getItemListValues=function(e,t){return this.getProperty(e,l.HtmlProperties.ItemsList,t)},e.prototype.getFilteredList=function(e,n){t.isNullOrUndefined(n)&&(n="0");var r=this.getItemListValues(e,n),o=this.task.getFormControl(n,e).value;return null!==o&&""!==o&&r instanceof Array?(o=o.toLowerCase(),r.filter((function(e){return e.displayValue.toLowerCase().includes(o)}))):r},e.prototype.getDisplayValue=function(e,n){var r="",o=this.getProperty(e,l.HtmlProperties.ItemsList,n),i=this.task.getValue(e,n);return i>=0&&i<o.length&&!t.isNullOrUndefined(o[i])&&(r=o[i].displayValue),r},e.prototype.isOptionSelected=function(e,t){var n,r,o=this.task.getValue(t,"0");try{for(var i=E(o),a=i.next();!a.done;a=i.next()){if(a.value===e)return!0}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return!1},e.prototype.isTabPageSelected=function(e,t){return this.task.getProperty(e,l.HtmlProperties.SelectedValue)==t-1},e.prototype.isTabPageLayerSelected=function(e,t){return this.task.getProperty(e,l.HtmlProperties.SelectedLayer)==t-1},e.prototype.getTabSelectedIndex=function(e){return this.task.getProperty(e,l.HtmlProperties.SelectedValue)},e.prototype.ifRowCreated=function(e){if(null==e)return!1;var n="number"==typeof e?e.toString():e.rowId,r=this.getFormGroupByRow(n);return!t.isNullOrUndefined(r)},e.prototype.getFormGroupByRow=function(e){return this.task.formGroups[e]},e.prototype.isRowSelected=function(e,t){return this.task.getProperty(e,l.HtmlProperties.SelectedRow,"0")==t},e.prototype.isRowInRowEditing=function(e){var t;return t="number"==typeof e?e.toString():e.rowId,this.task.isRowInRowEditing(t)},e.prototype.isCurrentInRowEditing=function(){var e=this.task.tableService.getSelectedRow();return this.task.isRowInRowEditing(e)},e.prototype.guiTopIndex=function(){return this.task.tableService.getTableTopIndex()},e.prototype.getErrMsg=function(e,t){var n,r,o=this.task.getFormControl(t,e);if(o.hasError("required"))return"Control must be updated.";if(o.hasError("pattern"))return"Required pattern is : "+o.errors.pattern.requiredPattern;if(o.hasError("rangevalidator"))return o.errors.rangevalidator.errorMsg;if(o.hasError("maxlength"))return"Max length allowed is : "+o.errors.maxlength.requiredLength;if(o.hasError("max"))return"Max value alllowed is : "+o.errors.max.max;var i=this.task.Records.list[t].getControlMetadata(e);try{for(var a=E(i.customValidators.keys()),s=a.next();!s.done;s=a.next()){var c=s.value;if(o.hasError(c))return i.customValidators.get(c).getErrMessage()}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return"unknown error"},e.prototype.setValueToControl=function(e,t,n){void 0===n&&(n=!0);var r=c.getGuiEventObj("setexternalvalue",e,0);r.externalValue=t,r.param=n,this.task.insertEvent(r)},e.prototype.isDataviewEmpty=function(){return this.task.Records.isEmptyDataView},e.prototype.simulateClick=function(e,t){void 0===t&&(t=0),this.task.insertEvent(c.getGuiEventObj("click",e,t))},e.prototype.isLoggedIn=function(){return this.task.getIsLoggenIn()},e.prototype.GetFormRecords=function(){var e,n=this;if(!t.isNullOrUndefined(this.task.Records)&&this.task.Records.list.length>0){var r=this.task.Records.list,o=new Array;for(var i in this.task.template)"1"==this.task.template[i]&&o.push(i);e=new Array,o.length>0&&r.forEach((function(t){if(n.task.Records.isRowCreated(0)){var r={rowId:0};o.forEach((function(e){r[e]=t.values[e]})),e.push(r)}}))}return e},e.prototype.SetCookie=function(e,t,n,r,o,i,a){c.CookieService.setCookie(e,t,n,r,o,i,a)},e.prototype.GetCookie=function(e){return c.CookieService.getCookie(e)},e.prototype.DeleteCookie=function(e){return c.CookieService.deleteCookie(e)},e}();ue.ɵfac=function(e){return new(e||ue)(n.ɵɵinject(se))},ue.ɵprov=n.ɵɵdefineInjectable({token:ue,factory:ue.ɵfac}),n.ɵsetClassMetadata(ue,[{type:n.Injectable}],(function(){return[{type:se}]}),null);var pe=function(e,t,n,r,o){this.task=e,this.subformService=t,this.tableService=n,this.titleService=r,this.mgAccessorService=o,e.tableService=n,e.mgSubformService=t,e.mgTitleService=r,e.mgAccessorService=o};pe.ɵfac=function(e){return new(e||pe)(n.ɵɵinject(se),n.ɵɵinject(N),n.ɵɵinject(ce),n.ɵɵinject(le),n.ɵɵinject(ue))},pe.ɵprov=n.ɵɵdefineInjectable({token:pe,factory:pe.ɵfac}),n.ɵsetClassMetadata(pe,[{type:n.Injectable}],(function(){return[{type:se},{type:N},{type:ce},{type:le},{type:ue}]}),null);var de=function(){function e(e,t){this.ref=e,this.magicServices=t,this.magicProperties=u.MagicProperties}return Object.defineProperty(e.prototype,"task",{get:function(){return this.magicServices.task},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mgSub",{get:function(){return this.magicServices.subformService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"tableService",{get:function(){return this.magicServices.tableService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"mg",{get:function(){return this.magicServices.mgAccessorService},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"taskId",{get:function(){return this.task.taskId},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"screenFormGroup",{get:function(){return this.task.ScreenModeControls},enumerable:!1,configurable:!0}),e.prototype.ngOnInit=function(){var e=this;this.task.detectChanges.pipe().subscribe((function(t){e.ref.detectChanges()}));this.task.initTask(this.taskIdParam,this.taskDescription),this.createFormControlsAccessor(this.screenFormGroup),this.setInputDateFormat(),this.task.customPropertiesSubject.pipe().subscribe((function(t){e.PropertyChanged(t.propertyName,t.rowId,t.value)})),this.task.recordsCountChangeSubject.pipe().subscribe((function(t){e.RecordsCountChanged(t)}))},e.prototype.createFormControlsAccessor=function(e){},e.prototype.setInputDateFormat=function(){},e.prototype.PropertyChanged=function(e,t,n){},e.prototype.RecordsCountChanged=function(e){},e.prototype.ngAfterViewInit=function(){this.mgSub.init()},e.prototype.ngAfterContentChecked=function(){this.task.oldPageSize!=this.tableService.getPageSize()&&(this.task.resize(this.tableService.getPageSize(),0),this.task.oldPageSize=this.tableService.getPageSize())},e.prototype.ngOnDestroy=function(){this.task.dispose()},e}();de.ɵfac=function(e){return new(e||de)(n.ɵɵdirectiveInject(n.ChangeDetectorRef),n.ɵɵdirectiveInject(pe))},de.ɵcmp=n.ɵɵdefineComponent({type:de,selectors:[["task-magic"]],inputs:{taskIdParam:"taskIdParam",taskDescription:"taskDescription"},features:[n.ɵɵProvidersFeature([se,N,ce])],decls:0,vars:0,template:function(e,t){},encapsulation:2}),n.ɵsetClassMetadata(de,[{type:n.Component,args:[{selector:"task-magic",providers:[se,N,ce],template:""}]}],(function(){return[{type:n.ChangeDetectorRef},{type:pe}]}),{taskIdParam:[{type:n.Input}],taskDescription:[{type:n.Input}]});var me=function(){function e(e,t){this._task=e,this.element=t,this.rowChangedSubscriber=null,this.htmlElement=this.element.nativeElement}return e.prototype.ngOnInit=function(){var e=this;this.rowChangedSubscriber=this._task.OnSelectedRowChanged.pipe(p.filter((function(t){return t===e.rowId}))).subscribe((function(t){e.isInView(e.htmlElement)||e.htmlElement.scrollIntoView()}))},e.prototype.isInView=function(e){var t=e.getBoundingClientRect(),n=e.parentElement.getBoundingClientRect();return t.top>=n.top&&t.bottom<=n.bottom},e.prototype.ngOnDestroy=function(){null!==this.rowChangedSubscriber&&this.rowChangedSubscriber.unsubscribe()},e.prototype.onClick=function(e){""!=this.rowId&&(this._task.insertEvent(c.getGuiEventObj("click","magicRow",+this.rowId)),fe.noOfAutoCompleteBoxesOpened<1&&(event.cancelBubble=!0))},e}();me.ɵfac=function(e){return new(e||me)(n.ɵɵdirectiveInject(se),n.ɵɵdirectiveInject(n.ElementRef))},me.ɵdir=n.ɵɵdefineDirective({type:me,selectors:[["","magicRow",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("click",(function(e){return t.onClick(e)}))},inputs:{rowId:["magicRow","rowId"]}}),n.ɵsetClassMetadata(me,[{type:n.Directive,args:[{selector:"[magicRow]"}]}],(function(){return[{type:se},{type:n.ElementRef}]}),{rowId:[{type:n.Input,args:["magicRow"]}],onClick:[{type:n.HostListener,args:["click",["$event"]]}]});var fe=function(){function e(e,t,n,r,o){this._task=e,this.element=t,this.renderer=n,this.vcRef=r,this.magicRow=o,this.eventHandlers={},this.eventsOnlyVal=!1,this.htmlElement=this.element.nativeElement,null!=o&&(this.rowId=o.rowId)}return Object.defineProperty(e.prototype,"magic",{set:function(e){this.id=e,this.selector="magic"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"eventsOnly",{set:function(e){console.log("eventsOnly"),this.eventsOnlyVal=!0},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"task",{get:function(){return this._task},enumerable:!1,configurable:!0}),e.prototype.regEvents=function(){var t=this;this.eventHandlers.focusin=this.OnFocus.bind(this),Object.keys(this.eventHandlers).forEach((function(e){t.focusUnlistener=t.renderer.listen(t.htmlElement,e,t.eventHandlers[e])}));["click","mousedown","dblclick"].forEach((function(n){t.renderer.listen(t.htmlElement,n,(function(r){var o=!1;t.htmlElement instanceof HTMLButtonElement&&(o=!0),t.task.insertEvent(c.getGuiEventObj(n,t.id,+t.rowId,o)),e.noOfAutoCompleteBoxesOpened<1&&(r.cancelBubble=!0)}))})),this.renderer.listen(this.htmlElement,"change",(function(e){var n=c.getGuiEventObj("selectionchanged",t.id,+t.rowId);void 0!==event.target.selectedIndex&&(n.Value=event.target.selectedIndex.toString(),e.cancelBubble=!0,t.task.insertEvent(n))})),f.fromEvent(this.htmlElement,"input").pipe(p.map((function(e){return e.target.value})),p.debounceTime(200)).subscribe((function(e){if(t.task.getProperty(t.id,l.HtmlProperties.BindingLevel,t.rowId)===u.BindingLevel.Character){var n=t.task.Records.list[0].getControlMetadata(t.id).dataType;n!==u.StorageAttributeType.Date&&n!=u.StorageAttributeType.Time&&t.task.mgAccessorService.setValueToControl(t.id,e,!0)}})),this.renderer.listen(this.htmlElement,"keydown",(function(n){var r=c.getGuiEventObj("keydown",t.id,+t.rowId);r.modifiers=l.Modifiers.MODIFIER_NONE,n.altKey&&n.keyCode!==l.GuiConstants.KEY_ALT?r.modifiers=l.Modifiers.MODIFIER_ALT:n.ctrlKey&&n.keyCode!==l.GuiConstants.KEY_CTRL&&(r.modifiers=l.Modifiers.MODIFIER_CTRL);var o=n.keyCode===l.GuiConstants.KEY_PG_UP||n.keyCode===l.GuiConstants.KEY_PG_DOWN||n.keyCode===l.GuiConstants.KEY_LEFT||n.keyCode===l.GuiConstants.KEY_RIGHT||n.keyCode===l.GuiConstants.KEY_UP||n.keyCode===l.GuiConstants.KEY_DOWN||n.keyCode===l.GuiConstants.KEY_ESC||n.keyCode===l.GuiConstants.KEY_HOME||n.keyCode===l.GuiConstants.KEY_END||n.keyCode===l.GuiConstants.KEY_RETURN||n.keyCode>=l.GuiConstants.KEY_F1&&n.keyCode<=l.GuiConstants.KEY_F12;(r.modifiers!==l.Modifiers.MODIFIER_NONE||o)&&(r.keyCode=n.keyCode,(n.keyCode!==l.GuiConstants.KEY_ESC||n.keyCode===l.GuiConstants.KEY_ESC&&!e.opened&&e.noOfAutoCompleteBoxesOpened<1)&&(n.cancelBubble=!0),t.task.insertEvent(r))}))},e.prototype.OnFocus=function(){this.task.insertEvent(c.getGuiEventObj("focus",this.id,+this.rowId)),event.cancelBubble=!0},e.prototype.IsSameElement=function(e){var n=e.line;return this.task.isTableControl(e.CtrlName)&&(n=this.task.getGuiRowId(n,!0)),e.CtrlName===this.id&&(n===+this.rowId||0===n&&t.isNullOrUndefined(this.rowId))},e.prototype.IsSameComponent=function(e){return e.controlName===this.id},e.prototype.regUpdatesUI=function(){var e=this;this.subscribeRefreshDom=this.task.refreshDom.pipe(p.filter((function(t){return e.IsSameElement(t)}))).subscribe((function(n){var r=n;t.isNullOrUndefined(e.rowId)&&(e.rowId="0");try{e.eventsOnlyVal||e.handleCommand(r)}catch(e){console.dir(e)}})),this.subscribeInteractiveCommands=this.task.interactiveCommands.pipe(p.filter((function(t){return e.IsSameComponent(t)}))).subscribe((function(t){e.handleInteractiveCommands(t)}))},e.prototype.ngOnInit=function(){this.regEvents(),this.regUpdatesUI()},e.prototype.handleCommand=function(e){switch(e.CommandType){case l.CommandType.SET_PROPERTY:this.handleSetProperty(e);break;case l.CommandType.SET_FOCUS:this.focusUnlistener(),e.obj.ConnectedControl&&this.htmlElement instanceof HTMLButtonElement||this.htmlElement.focus(),this.focusUnlistener=this.renderer.listen(this.htmlElement,"focusin",this.eventHandlers.focusin)}},e.prototype.handleInteractiveCommands=function(e){if(e._commandType===l.InteractiveCommandType.CALL_JS){var n=e._str,r=e.arguments,o=this.vcRef._hostView.find((function(e){return e instanceof de})),i="";try{t.isNullOrUndefined(o[n])?console.error("Instance method "+n+" does not exists"):i=o[n].apply(o,r)}catch(e){console.error(e.message)}e.resultString=i}},e.prototype.handleSetProperty=function(e){if(e.Operation===l.HtmlProperties.ReadOnly)1!=e.obj1?this.renderer.removeAttribute(this.htmlElement,e.Operation):this.renderer.setAttribute(this.htmlElement,e.Operation,e.str)},e.prototype.ngOnDestroy=function(){this.subscribeRefreshDom.unsubscribe()},e}();fe.opened=!1,fe.noOfAutoCompleteBoxesOpened=0,fe.ɵfac=function(e){return new(e||fe)(n.ɵɵdirectiveInject(se),n.ɵɵdirectiveInject(n.ElementRef),n.ɵɵdirectiveInject(n.Renderer2),n.ɵɵdirectiveInject(n.ViewContainerRef),n.ɵɵdirectiveInject(me,8))},fe.ɵdir=n.ɵɵdefineDirective({type:fe,selectors:[["","magic",""]],inputs:{magic:"magic",eventsOnly:"eventsOnly",rowId:"rowId"}}),n.ɵsetClassMetadata(fe,[{type:n.Directive,args:[{selector:"[magic]"}]}],(function(){return[{type:se},{type:n.ElementRef},{type:n.Renderer2},{type:n.ViewContainerRef},{type:me,decorators:[{type:n.Optional}]}]}),{magic:[{type:n.Input,args:["magic"]}],eventsOnly:[{type:n.Input,args:["eventsOnly"]}],rowId:[{type:n.Input}]});var he=function(e){function t(t,n,r,o,i){return e.call(this,t,n,r,o,i)||this}return C(t,e),Object.defineProperty(t.prototype,"magic",{set:function(e){this.id=e,this.selector="magicnc"},enumerable:!1,configurable:!0}),t.prototype.regEvents=function(){var t=this;if(e.prototype.regEvents.call(this),this.htmlElement instanceof HTMLSelectElement&&this.htmlElement.addEventListener("change",(function(e){var n=c.getGuiEventObj("selectionchanged",t.id,0);n.Value=event.target.selectedIndex.toString(),t.task.insertEvent(n)})),this.isRadio()&&this.htmlElement.addEventListener("change",(function(e){t.task.getFormControl("0",t.id);var n=c.getGuiEventObj("selectionchanged",t.id,0);n.Value=e.target.value,t.task.insertEvent(n)})),this.isTabControl())for(var n=this.htmlElement.children[0],r=c.getGuiEventObj("selectionchanged",this.id,0),o=0;o<n.children.length;o++)n.children[o].addEventListener("click",(function(e){r.Value=(e.currentTarget.getAttribute("layer")-1).toString(),t.task.insertEvent(r)}))},t.prototype.isTabControl=function(){return this.htmlElement instanceof HTMLDivElement&&"magicTabControl"===this.htmlElement.children[0].getAttribute("magicMark")},t.prototype.isRadio=function(){return this.htmlElement instanceof HTMLDivElement&&"magicRadio"===this.htmlElement.children[0].getAttribute("magicMark")},t.prototype.handleCommand=function(t){switch(e.prototype.handleCommand.call(this,t),t.CommandType){case l.CommandType.SET_CLASS:var n=this._task.Records.list[0].getControlMetadata(this.id);""!=n.removedClass&&(this.htmlElement.classList.remove(n.removedClass),n.removedClass=""),this.htmlElement.classList.add(t.obj1);break;case l.CommandType.SET_VALUE:this.htmlElement instanceof HTMLLabelElement&&(this.htmlElement.innerText=t.value),this.htmlElement instanceof HTMLSelectElement&&(this.htmlElement.value=t.value),this.htmlElement instanceof HTMLAnchorElement&&(this.htmlElement.text=t.value),this.htmlElement instanceof HTMLInputElement&&("checkbox"===this.htmlElement.type?this.htmlElement.checked=t.value:this.htmlElement.value=t.value),this.htmlElement instanceof HTMLButtonElement&&(this.htmlElement.innerHTML=t.value);break;case l.CommandType.SET_PROPERTY:this.handleSetProperty(t);break;case l.CommandType.SET_STYLE:var r=_.magicValueGetStyle(t.Operation,t.obj1),o=_.MagicPropertyToHtmlAttributeMap.get(t.Operation);this.htmlElement.setAttribute("style",o+":"+r)}},t.prototype.handleSetProperty=function(t){var n,r;switch(e.prototype.handleSetProperty.call(this,t),t.Operation){case l.HtmlProperties.Text:this.htmlElement instanceof HTMLLabelElement&&(this.htmlElement.innerText=t.obj1);break;case l.HtmlProperties.Image:this.htmlElement instanceof HTMLImageElement?this.htmlElement.src=t.obj1:this.htmlElement.setAttribute("src",t.obj1);break;case l.HtmlProperties.ItemsList:if(this.htmlElement instanceof HTMLSelectElement){for(var o=this.htmlElement.length-1;o>=0;o--)this.htmlElement.remove(o);try{for(var i=E(t.obj1),a=i.next();!a.done;a=i.next()){var s=a.value,c=document.createElement("option");c.text=s.displayValue,c.value=s.index,this.htmlElement.add(c)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}else if(this.isTabControl()&&this.htmlElement.children.length>0){var u=this.htmlElement.children[0];for(o=0;o<u.children.length;o++)u.children[o]instanceof HTMLButtonElement&&(u.children[o].innerText=t.obj1[o].displayValue)}break;case l.HtmlProperties.Visible:this.htmlElement.setAttribute("style","visibility:"+(t.obj1?"visible":"hidden"));break;case l.HtmlProperties.Enabled:!1===t.obj1?this.htmlElement.setAttribute("disabled","true"):this.htmlElement.removeAttribute("disabled");break;case l.HtmlProperties.TabIndex:this.htmlElement.setAttribute(t.Operation,t.obj1);break;case l.HtmlProperties.SelectedValue:if(this.htmlElement instanceof HTMLSelectElement)this.htmlElement.value=t.obj1;else if(this.isTabControl()&&this.htmlElement.children.length>0)for(u=this.htmlElement.children[0],o=0;o<u.children.length;o++){var p=u.children[o],d=p.getAttribute("layer")-1;if(p instanceof HTMLButtonElement)d==t.obj1?p.classList.add("tab_button_active"):p.classList.remove("tab_button_active");else{var m=d==t.obj1?"display: inline":"display: none";p.setAttribute("style",m)}}break;case l.HtmlProperties.PlaceHolder:this.htmlElement.setAttribute("placeholder",t.obj1);break;case l.HtmlProperties.Tooltip:this.htmlElement.setAttribute("title",t.obj1);break;case l.HtmlProperties.Password:!1===t.obj1?this.htmlElement.setAttribute("type","text"):this.htmlElement.setAttribute("type","password")}},t}(fe);he.ɵfac=function(e){return new(e||he)(n.ɵɵdirectiveInject(se),n.ɵɵdirectiveInject(n.ElementRef),n.ɵɵdirectiveInject(n.Renderer2),n.ɵɵdirectiveInject(n.ViewContainerRef),n.ɵɵdirectiveInject(me,8))},he.ɵdir=n.ɵɵdefineDirective({type:he,selectors:[["","magicnc",""]],inputs:{magic:["magicnc","magic"]},features:[n.ɵɵInheritDefinitionFeature]}),n.ɵsetClassMetadata(he,[{type:n.Directive,args:[{selector:"[magicnc]"}]}],(function(){return[{type:se},{type:n.ElementRef},{type:n.Renderer2},{type:n.ViewContainerRef},{type:me,decorators:[{type:n.Optional}]}]}),{magic:[{type:n.Input,args:["magicnc"]}]});var ge=function(){};ge.DATE_FMT="dd/MMM/yyyy";var ye=function(e){function n(t){var n=e.call(this,"en-US")||this;return n._task=t,n}return C(n,e),n.prototype.transform=function(n,r){var o=this._task.GetControlPictureMask(r).getMask(),i=null,a=new ve;return t.isNullOrUndefined(n)||null===o?n="":(null!=(i=a.ConvertMgDateFormatToAngular(o))&&this._task.isTableControl(r)&&(null==this._task.mgInputDateFormat?this._task.mgInputDateFormat=i:i=this._task.mgInputDateFormat),e.prototype.transform.call(this,n,i))},n}(r.DatePipe);ye.ɵfac=function(e){return new(e||ye)(n.ɵɵdirectiveInject(se))},ye.ɵpipe=n.ɵɵdefinePipe({name:"magicDate",type:ye,pure:!0}),n.ɵsetClassMetadata(ye,[{type:n.Pipe,args:[{name:"magicDate"}]}],(function(){return[{type:se}]}),null);var ve=function(){function e(){}return e.prototype.ConvertMgDateFormatToAngular=function(e){var t=new d.StringBuilder;if(null!==e){for(var n=0;n<e.length;)switch(e.charCodeAt(n)){case u.PICInterface.PIC_YYYY:t.Append("yyyy"),n+=4;break;case u.PICInterface.PIC_MMD:t.Append("MM"),n+=2;break;case u.PICInterface.PIC_YY:t.Append("yy"),n+=2;break;case u.PICInterface.PIC_MMM:for(var r=0;n<e.length&&e.charCodeAt(n)==u.PICInterface.PIC_MMM;n++)r++;3==r&&t.Append("MMM"),r>3&&t.Append("MMMM");break;case u.PICInterface.PIC_DD:t.Append("dd"),n+=2;break;case u.PICInterface.PIC_WWW:for(r=0;n<e.length&&e.charCodeAt(n)==u.PICInterface.PIC_WWW;n++)r++;3==r&&t.Append("EEE"),r>3&&t.Append("EEEE");break;default:t.Append(e.charAt(n)),n++}return t.ToString()}return"dd-mm-yyyy"},e}(),Ce=function(){function e(e,t){this.magicDir=e,this._task=t}return e.prototype.ngAfterViewInit=function(){if(null!=this._task.getFormControl(this.magicDir.rowId,this.magicDir.id)&&null==this._task.mgInputDateFormat){var e=this._task.GetControlPictureMask(this.magicDir.id);e.getAttr()==u.StorageAttribute.DATE&&this.formatDate(e)}},e.prototype.onFocusEvent=function(e){var t=this._task.getFormControl(this.magicDir.rowId,this.magicDir.id);if(null!=t){var n=this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType;if(n==u.StorageAttribute.NUMERIC||n==u.StorageAttribute.ALPHA||n==u.StorageAttribute.UNICODE){var r=this._task.GetControlPictureMask(this.magicDir.id);if(this.isPatternGenerationNeeded(n,r)){var o=this.generatePattern(n,r);null==t.validator?t.setValidators(i.Validators.pattern(o)):t.setValidators([t.validator,i.Validators.pattern(o)])}else n!=u.StorageAttribute.ALPHA&&n!=u.StorageAttribute.UNICODE||(null==t.validator?t.setValidators(i.Validators.maxLength(r.getMaskLength())):t.setValidators([t.validator,i.Validators.maxLength(r.getMaskLength())]))}}},e.prototype.onChangeEvent=function(e){var t=this._task.getFormControl(this.magicDir.rowId,this.magicDir.id);switch(this._task.Records.list[0].getControlMetadata(this.magicDir.id).dataType){case u.StorageAttribute.ALPHA:case u.StorageAttribute.UNICODE:this.formatAlphaUnicode(t);break;case u.StorageAttribute.BOOLEAN:this.formatBoolean(t)}},e.prototype.formatDate=function(e){var t=new ve;this._task.mgInputDateFormat=t.ConvertMgDateFormatToAngular(e.getMask())},e.prototype.formatAlphaUnicode=function(e){var t=e.value;if(null!==t&&t.length>0){var n=this._task.GetRangedValue(this.magicDir.id,t);null!=n&&(t=n);for(var r=this._task.GetControlPictureMask(this.magicDir.id).getMask(),o=new d.StringBuilder,i=0;i<t.length;i++)switch(r.charCodeAt(i)){case u.PICInterface.PIC_U:o.Append(t.charAt(i).toUpperCase());break;case u.PICInterface.PIC_L:o.Append(t.charAt(i).toLowerCase());break;default:o.Append(t.charAt(i))}e.setValue(o.ToString())}},e.prototype.formatBoolean=function(e){var t=e.value;if(null!==t&&t.length>0){var n=this._task.GetRangedValue(this.magicDir.id,t);n.toUpperCase().startsWith(t.toUpperCase())?e.setValue(n):e.setValue(t)}},e.prototype.generatePattern=function(e,t){var n="";switch(e){case u.StorageAttribute.NUMERIC:n=this.generatePatternForNumber(t);break;case u.StorageAttribute.ALPHA:case u.StorageAttribute.UNICODE:n=this.generatePatternForAlpha(t)}return n},e.prototype.generatePatternForNumber=function(e){var t=new d.StringBuilder;return t.Append("^"),e.isNegative()&&t.Append("-?"),e.getWholes()&&t.AppendFormat("\\d{{0},{1}}",0,e.getWholes()),e.getDec()&&t.AppendFormat("(\\.\\d{1,{0}})?",e.getDec()),t.Append("$"),t.ToString()},e.prototype.isPatternGenerationNeeded=function(e,t){switch(e){case u.StorageAttribute.NUMERIC:return!0;case u.StorageAttribute.ALPHA:case u.StorageAttribute.UNICODE:return t.getMaskChars()>0}},e.prototype.generatePatternForAlpha=function(e){var t=0,n=!1,r=!1,o=e.getMask(),i=new d.StringBuilder;i.Append("^");for(var a=0;a<o.length;){switch(!n||o.charCodeAt(a)!=u.PICInterface.PIC_N&&o.charCodeAt(a)!=u.PICInterface.PIC_U&&o.charCodeAt(a)!=u.PICInterface.PIC_L&&o.charCodeAt(a)!=u.PICInterface.PIC_X||(i.Append("("),r=!0,n=!1),t=0,o.charCodeAt(a)){case u.PICInterface.PIC_U:case u.PICInterface.PIC_X:case u.PICInterface.PIC_L:i.Append(".");var s=new d.RefParam(!1),c=u.PICInterface.PIC_U.toString();c+=u.PICInterface.PIC_L.toString(),c+=u.PICInterface.PIC_X.toString(),t=this.getDirectiveCount(o,a,c,s),n=s.value,a+=t;break;case u.PICInterface.PIC_N:i.Append("\\d");s=new d.RefParam(!1);t=this.getDirectiveCount(o,a,u.PICInterface.PIC_L.toString(),s),n=s.value,a+=t;break;default:i.Append(o[a]),a++}t>0&&i.AppendFormat("{{0},{1}}",n?t:0,t),r&&i.Append(")"),r=!1}return i.Append("$"),i.ToString()},e.prototype.getDirectiveCount=function(e,t,n,r){r.value=!1;for(var o=0;t<e.length&&this.IsPatternMatches(e.charCodeAt(t).toString(),n);)o++,t++;return t<e.length&&(r.value=!0),o},e.prototype.IsPatternMatches=function(e,t){for(var n=0;n<t.length;n++)if(e==t[n])return!0;return!1},e}();Ce.ɵfac=function(e){return new(e||Ce)(n.ɵɵdirectiveInject(fe),n.ɵɵdirectiveInject(se))},Ce.ɵdir=n.ɵɵdefineDirective({type:Ce,selectors:[["","mgFormat",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("focus",(function(e){return t.onFocusEvent(e)}))("change",(function(e){return t.onChangeEvent(e)}))}}),n.ɵsetClassMetadata(Ce,[{type:n.Directive,args:[{selector:"[mgFormat]"}]}],(function(){return[{type:fe},{type:se}]}),{onFocusEvent:[{type:n.HostListener,args:["focus",["$event"]]}],onChangeEvent:[{type:n.HostListener,args:["change",["$event"]]}]});var be=function(e){function t(t){var n=e.call(this,"en-US")||this;return n._task=t,n}return C(t,e),t.prototype.transform=function(t,n){var r=this._task.GetControlPictureMask(n).getMask(),o=new d.StringBuilder;if(void 0!==t&&null!==r){for(var i=0;i<r.length;)switch(r.charCodeAt(i)){case u.PICInterface.PIC_HH:o.Append("hh"),i+=2;break;case u.PICInterface.PIC_MMT:o.Append("mm"),i+=2;break;case u.PICInterface.PIC_SS:o.Append("ss"),i+=2;break;default:o.Append(r.charAt(i)),i++}return o.Append(" a"),e.prototype.transform.call(this,t,o.ToString())}return t},t}(r.DatePipe);be.ɵfac=function(e){return new(e||be)(n.ɵɵdirectiveInject(se))},be.ɵpipe=n.ɵɵdefinePipe({name:"magicTime",type:be,pure:!0}),n.ɵsetClassMetadata(be,[{type:n.Pipe,args:[{name:"magicTime"}]}],(function(){return[{type:se}]}),null);var Se=function(){function e(e,t){this._task=e,this.vcRef=t}return e.prototype.validate=function(e){var t;t=this.getControlName(e),this._task.Records.list[0].getControlMetadata(t).rangeValidator=!0;var n=null;return e.dirty&&(n=this._task.ValidateControlValue(t,this._task.ConvertValToNative(t,0,e.value))),null==n?null:{rangevalidator:{errorMsg:n}}},e.prototype.getControlName=function(e){var t=e.parent.controls;return Object.keys(t).find((function(n){return e===t[n]}))||null},e}();function Ie(e,t){if(1&e&&n.ɵɵelement(0,"ndc-dynamic",1),2&e){var r=n.ɵɵnextContext();n.ɵɵproperty("ndcDynamicComponent",r.Component)("ndcDynamicInputs",r.Parameters)}}Se.ɵfac=function(e){return new(e||Se)(n.ɵɵdirectiveInject(se),n.ɵɵdirectiveInject(n.ViewContainerRef))},Se.ɵdir=n.ɵɵdefineDirective({type:Se,selectors:[["","rangevalidator",""]],features:[n.ɵɵProvidersFeature([{provide:i.NG_VALIDATORS,useExisting:Se,multi:!0}])]}),n.ɵsetClassMetadata(Se,[{type:n.Directive,args:[{selector:"[rangevalidator] ",providers:[{provide:i.NG_VALIDATORS,useExisting:Se,multi:!0}]}]}],(function(){return[{type:se},{type:n.ViewContainerRef}]}),null);var Re=function(){function e(e,n){this.vcRef=e,this.mgSub=n,this.component=null,this.component=this.vcRef._hostView.find((function(e){return!t.isNullOrUndefined(e)}))}return Object.defineProperty(e.prototype,"magic",{set:function(e){this.id=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Component",{get:function(){return this.mgSub.mgGetComp(this.id)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"Parameters",{get:function(){return this.mgSub.mgGetParameters(this.id)},enumerable:!1,configurable:!0}),e}();Re.ɵfac=function(e){return new(e||Re)(n.ɵɵdirectiveInject(n.ViewContainerRef),n.ɵɵdirectiveInject(N))},Re.ɵcmp=n.ɵɵdefineComponent({type:Re,selectors:[["magic-subform"]],inputs:{magic:"magic"},decls:1,vars:1,consts:[[3,"ndcDynamicComponent","ndcDynamicInputs",4,"ngIf"],[3,"ndcDynamicComponent","ndcDynamicInputs"]],template:function(e,t){1&e&&n.ɵɵtemplate(0,Ie,1,2,"ndc-dynamic",0),2&e&&n.ɵɵproperty("ngIf",t.Component)},directives:[r.NgIf,a.DynamicComponent,a.DynamicIoDirective],encapsulation:2}),n.ɵsetClassMetadata(Re,[{type:n.Component,args:[{selector:"magic-subform",template:'\n <ndc-dynamic\n *ngIf="Component" \n [ndcDynamicComponent]="Component" \n [ndcDynamicInputs]="Parameters">\n </ndc-dynamic>\n'}]}],(function(){return[{type:n.ViewContainerRef},{type:N}]}),{magic:[{type:n.Input,args:["magic"]}]});var Ee=["customContent"];function we(e,t){if(1&e&&(n.ɵɵelementStart(0,"span"),n.ɵɵtext(1),n.ɵɵelementEnd()),2&e){var r=n.ɵɵnextContext(2);n.ɵɵadvance(1),n.ɵɵtextInterpolate1(" ",r.mgService.getErrMsg(r.id,r.rowId)," ")}}function Me(e,t){if(1&e&&(n.ɵɵelementStart(0,"div"),n.ɵɵelementStart(1,"div",null,1),n.ɵɵprojection(3),n.ɵɵelementEnd(),n.ɵɵtemplate(4,we,2,1,"span",0),n.ɵɵelementEnd()),2&e){var r=n.ɵɵnextContext();n.ɵɵadvance(4),n.ɵɵproperty("ngIf",r.defaultDisplay)}}var ke=function(){function e(e,t,n){this._task=e,this.mgService=t,this.changeDetectorRef=n,this.defaultDisplay=!0,this.rowId="0"}return Object.defineProperty(e.prototype,"magic",{set:function(e){this.id=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"rowId1",{set:function(e){this.rowId=e},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"CustomContent",{set:function(e){this.defaultDisplay=null==e||this.isEmpty(e.nativeElement),this.changeDetectorRef.detectChanges()},enumerable:!1,configurable:!0}),e.prototype.isEmpty=function(e){for(var t=e.childNodes,n=0;n<t.length;n++){if(8!==t.item(n).nodeType&&0!==t.item(n).textContent.trim().length)return!1}return!0},e.prototype.HasErrors=function(e){var n,r;if(!t.isUndefined(e)){var o=this._task.getFormControl(this.rowId,e);if(null!==o){if(o.dirty&&(o.hasError("pattern")||o.hasError("required")||o.hasError("rangevalidator")||o.hasError("maxlength")||o.hasError("max")))return!0;if(o.touched&&o.hasError("required"))return!0;if(this._task.Records.list[this.rowId]&&this._task.Records.list[this.rowId].getControlMetadata(e)){var i=this._task.Records.list[this.rowId].getControlMetadata(e);try{for(var a=E(i.customValidators.keys()),s=a.next();!s.done;s=a.next()){var c=s.value;if(o.hasError(c))return!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}}}return!1},e}();ke.ɵfac=function(e){return new(e||ke)(n.ɵɵdirectiveInject(se),n.ɵɵdirectiveInject(ue),n.ɵɵdirectiveInject(n.ChangeDetectorRef))},ke.ɵcmp=n.ɵɵdefineComponent({type:ke,selectors:[["mgError"]],viewQuery:function(e,t){var r;(1&e&&n.ɵɵviewQuery(Ee,!0),2&e)&&(n.ɵɵqueryRefresh(r=n.ɵɵloadQuery())&&(t.CustomContent=r.first))},inputs:{magic:"magic",rowId1:["rowId","rowId1"]},ngContentSelectors:["*"],decls:1,vars:1,consts:[[4,"ngIf"],["customContent",""]],template:function(e,t){1&e&&(n.ɵɵprojectionDef(),n.ɵɵtemplate(0,Me,5,1,"div",0)),2&e&&n.ɵɵproperty("ngIf",t.HasErrors(t.id))},directives:[r.NgIf],encapsulation:2}),n.ɵsetClassMetadata(ke,[{type:n.Component,args:[{selector:"mgError",template:'<div *ngIf="HasErrors(id)">\n <div #customContent>\n <ng-content></ng-content>\n </div>\n <span *ngIf="defaultDisplay">\n {{mgService.getErrMsg(id, rowId)}} \n </span>\n </div>\n'}]}],(function(){return[{type:se},{type:ue},{type:n.ChangeDetectorRef}]}),{magic:[{type:n.Input,args:["magic"]}],rowId1:[{type:n.Input,args:["rowId"]}],CustomContent:[{type:n.ViewChild,args:["customContent",{static:!1}]}]});var Te=function(){function e(e){this.magicDirective=e}return e.prototype.onChange=function(e){this.magicDirective.task.onCheckChanged(e,this.magicDirective.id,+this.magicDirective.rowId)},e}();Te.ɵfac=function(e){return new(e||Te)(n.ɵɵdirectiveInject(fe))},Te.ɵdir=n.ɵɵdefineDirective({type:Te,selectors:[["input","type","checkbox","magic","",3,"noFormControl",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("change",(function(e){return t.onChange(e)}))}}),n.ɵsetClassMetadata(Te,[{type:n.Directive,args:[{selector:"\n input[type=checkbox][magic]:not([noFormControl])\n"}]}],(function(){return[{type:fe}]}),{onChange:[{type:n.HostListener,args:["change",["$event"]]}]});var Oe=function(){function e(e){this.magicDirective=e}return e.prototype.onChange=function(e){this.magicDirective.task.onComboboxSelectionChanged(e,this.magicDirective.id,+this.magicDirective.rowId)},e}();Oe.ɵfac=function(e){return new(e||Oe)(n.ɵɵdirectiveInject(fe))},Oe.ɵdir=n.ɵɵdefineDirective({type:Oe,selectors:[["select","magic","",3,"multiple",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("change",(function(e){return t.onChange(e)}))}}),n.ɵsetClassMetadata(Oe,[{type:n.Directive,args:[{selector:"select[magic]:not([multiple])"}]}],(function(){return[{type:fe}]}),{onChange:[{type:n.HostListener,args:["change",["$event"]]}]});var Pe=function(){function e(){}return e.prototype.exitMagic=function(){console.log("Magic application terminated")},e}();Pe.ɵfac=function(e){return new(e||Pe)},Pe.ɵprov=n.ɵɵdefineInjectable({token:Pe,factory:Pe.ɵfac}),n.ɵsetClassMetadata(Pe,[{type:n.Injectable}],null,null);var xe=["magicRoot"];function De(e,t){if(1&e&&n.ɵɵelement(0,"ndc-dynamic",6),2&e){var r=n.ɵɵnextContext();n.ɵɵproperty("ndcDynamicComponent",r.RootComponent)("ndcDynamicInputs",r.RootComponentParameters)}}function _e(e,t){if(1&e&&(n.ɵɵelementStart(0,"div",7),n.ɵɵelementContainer(1,8),n.ɵɵelementEnd()),2&e){var r=n.ɵɵnextContext(),o=n.ɵɵreference(7);n.ɵɵadvance(1),n.ɵɵproperty("ngTemplateOutlet",r.SpinnerTemplate?r.SpinnerTemplate:o)}}function Ae(e,t){1&e&&n.ɵɵelement(0,"div",9)}var je=function(){function e(e,t,n,r,o,i,a,s){this.engineMagicService=e,this.componentList=t,this.changeDetectorRef=n,this.titleService=r,this.overlayWindowService=o,this.httpClient=i,this.pendingCommandsCollector=a,this.exitMagicService=s,this.RootComponent=null,this.magicEngineTerminated=!1,this.initialize(),this.setTitle()}return e.prototype.onBeforeUnload=function(e){if(this.engineMagicService.TransCacheExists())return e.returnValue="Are you sure?","Are you sure?";this.engineMagicService.TerminateContextUsingFetchAPI(),this.magicEngineTerminated=!0},e.prototype.onUnload=function(e){this.magicEngineTerminated||this.engineMagicService.TerminateContextUsingFetchAPI()},e.prototype.ngAfterViewInit=function(){this.overlayWindowService.init(this.overlayWindowsContainerViewRef,this.rootMagicElementRef.nativeElement),this.engineMagicService.startMagicEngine(this.httpClient)},e.prototype.setViewContainerRef=function(e){this.overlayWindowsContainerViewRef=e},e.prototype.initialize=function(){this.registerUICommands()},e.prototype.setTitle=function(){var e=this.componentList.title;this.titleService.setTitle(e)},e.prototype.setComponent=function(e,t,n,r){this.pendingCommandsCollector.startCollecting(),r?this.overlayWindowService.open(e,t,n):(this.RootComponent=this.componentList.getComponent(e),this.RootComponentParameters={taskIdParam:t,taskDescription:n}),this.changeDetectorRef.detectChanges()},e.prototype.registerUICommands=function(){var e=this;this.engineMagicService.refreshDom.pipe(p.filter((function(e){return"0"===e.TaskTag}))).subscribe((function(t){e.executeCommand(t)})),this.engineMagicService.interactiveCommands.pipe(p.filter((function(e){return"0"===e.TaskTag}))).subscribe((function(t){L.executeInteractiveCommand(null,t,e.overlayWindowService)}))},e.prototype.executeCommand=function(e){switch(e.CommandType){case l.CommandType.OPEN_FORM:this.setComponent(e.str,e.stringList[0],e.stringList[1],e.Bool1);break;case l.CommandType.SET_IS_LOGGED_IN:this.engineMagicService.setIsLoggedIn(e.Bool1);break;case l.CommandType.CLOSE_FORM:null!=this.RootComponent&&e.str===this.RootComponentParameters.taskIdParam?(this.RootComponent=null,this.RootComponentParameters={},this.changeDetectorRef.detectChanges()):(this.overlayWindowService.close(e.str),this.changeDetectorRef.detectChanges());break;case l.CommandType.RELOAD_PAGE:window.location.reload();break;case l.CommandType.SHOW_SPINNER:this.showSpinner!=e.Bool1&&(this.showSpinner=e.Bool1,this.changeDetectorRef.detectChanges());break;case l.CommandType.EXIT_MAGIC:this.exitMagicService&&this.exitMagicService.exitMagic();break;case l.CommandType.SHOW_HTML_ERROR:window.document.write(e.str)}},e}();je.ɵfac=function(e){return new(e||je)(n.ɵɵdirectiveInject(x),n.ɵɵdirectiveInject(D),n.ɵɵdirectiveInject(n.ChangeDetectorRef),n.ɵɵdirectiveInject(m.Title),n.ɵɵdirectiveInject(oe),n.ɵɵdirectiveInject(h.HttpClient),n.ɵɵdirectiveInject(A),n.ɵɵdirectiveInject(Pe,8))},je.ɵcmp=n.ɵɵdefineComponent({type:je,selectors:[["magic-root"]],viewQuery:function(e,t){var r;(1&e&&n.ɵɵstaticViewQuery(xe,!0),2&e)&&(n.ɵɵqueryRefresh(r=n.ɵɵloadQuery())&&(t.rootMagicElementRef=r.first))},hostBindings:function(e,t){1&e&&n.ɵɵlistener("beforeunload",(function(e){return t.onBeforeUnload(e)}),!1,n.ɵɵresolveWindow)("unload",(function(e){return t.onUnload(e)}),!1,n.ɵɵresolveWindow)},inputs:{SpinnerTemplate:"SpinnerTemplate"},features:[n.ɵɵProvidersFeature([])],decls:8,vars:2,consts:[["magicRoot",""],[3,"ndcDynamicComponent","ndcDynamicInputs",4,"ngIf"],["magicViewContainerRef",""],["overlayWindowsContainer",""],["class","spinner-background",4,"ngIf"],["defaultSpinner",""],[3,"ndcDynamicComponent","ndcDynamicInputs"],[1,"spinner-background"],[3,"ngTemplateOutlet"],[1,"mgSpinnerClass"]],template:function(e,t){1&e&&(n.ɵɵelementStart(0,"div",null,0),n.ɵɵtemplate(2,De,1,2,"ndc-dynamic",1),n.ɵɵelement(3,"div",2,3),n.ɵɵelementEnd(),n.ɵɵtemplate(5,_e,2,1,"div",4),n.ɵɵtemplate(6,Ae,1,0,"ng-template",null,5,n.ɵɵtemplateRefExtractor)),2&e&&(n.ɵɵadvance(2),n.ɵɵproperty("ngIf",null!==t.RootComponent),n.ɵɵadvance(3),n.ɵɵproperty("ngIf",t.showSpinner))},directives:[r.NgIf,H,a.DynamicComponent,a.DynamicIoDirective,r.NgTemplateOutlet],styles:[".mgSpinnerClass[_ngcontent-%COMP%] {\n border: 10px solid #cccccc; \n border-top: 10px solid black; \n border-radius: 50%;\n position: fixed;\n margin: auto;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n width: 100px;\n height: 100px;\n animation: spin 2s linear infinite;\n }\n .spinner-background[_ngcontent-%COMP%] {\n \n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n left: 0;\n opacity: 0.5;\n }\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }"]}),n.ɵsetClassMetadata(je,[{type:n.Component,args:[{selector:"magic-root",providers:[],template:'\n <div #magicRoot>\n <ndc-dynamic\n *ngIf = "RootComponent !== null"\n [ndcDynamicComponent]="RootComponent"\n [ndcDynamicInputs] ="RootComponentParameters">\n </ndc-dynamic>\n\n <div #overlayWindowsContainer magicViewContainerRef>\n </div>\n </div>\n\n <div class="spinner-background" *ngIf="showSpinner">\n <ng-container [ngTemplateOutlet]="SpinnerTemplate ? SpinnerTemplate:defaultSpinner"></ng-container>\n </div>\n\n <ng-template #defaultSpinner>\n <div class="mgSpinnerClass"></div>\n </ng-template>\n ',styles:["\n .mgSpinnerClass {\n border: 10px solid #cccccc; /* Light grey */\n border-top: 10px solid black; /* Blue */\n border-radius: 50%;\n position: fixed;\n margin: auto;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n width: 100px;\n height: 100px;\n animation: spin 2s linear infinite;\n }\n .spinner-background {\n /* background fixed across whole screen */\n position: fixed;\n top: 0;\n right: 0;\n bottom: 0;\n z-index: 1000;\n left: 0;\n opacity: 0.5;\n }\n @keyframes spin {\n 0% { transform: rotate(0deg); }\n 100% { transform: rotate(360deg); }\n }\n "]}]}],(function(){return[{type:x},{type:D},{type:n.ChangeDetectorRef},{type:m.Title},{type:oe},{type:h.HttpClient},{type:A},{type:Pe,decorators:[{type:n.Optional}]}]}),{rootMagicElementRef:[{type:n.ViewChild,args:["magicRoot",{static:!0}]}],SpinnerTemplate:[{type:n.Input}],onBeforeUnload:[{type:n.HostListener,args:["window:beforeunload",["$event"]]}],onUnload:[{type:n.HostListener,args:["window:unload",["$event"]]}]});var Fe={provide:i.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ne})),multi:!0},Ne=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(i.CheckboxControlValueAccessor);Ne.ɵfac=function(e){return Ve(e||Ne)},Ne.ɵdir=n.ɵɵdefineDirective({type:Ne,selectors:[["input","type","checkbox","magic","",3,"formControlName","",3,"no-form-control",""],["input","type","checkbox","magic","",3,"formControl",""],["input","type","checkbox","magic","",3,"ngModel",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("change",(function(e){return t.onChange(e.target.checked)}))("blur",(function(){return t.onTouched()}))},features:[n.ɵɵProvidersFeature([Fe]),n.ɵɵInheritDefinitionFeature]});var Ve=n.ɵɵgetInheritedFactory(Ne);n.ɵsetClassMetadata(Ne,[{type:n.Directive,args:[{selector:"\n input[type=checkbox][magic]:not([formControlName]):not([no-form-control]),\n input[type=checkbox][magic]:not([formControl]),\n input[type=checkbox][magic]:not([ngModel])\n ",host:{"(change)":"onChange($event.target.checked)","(blur)":"onTouched()"},providers:[Fe]}]}],null,null);var Le={provide:i.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return Ge})),multi:!0},Ge=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return C(t,e),t}(i.DefaultValueAccessor);Ge.ɵfac=function(e){return Be(e||Ge)},Ge.ɵdir=n.ɵɵdefineDirective({type:Ge,selectors:[["input","magic","",3,"type","checkbox",3,"formControlName","",3,"no-form-control",""],["textarea","magic","",3,"formControlName","",3,"noFormControl","",3,"no-form-control",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("input",(function(e){return t._handleInput(e.target.value)}))("blur",(function(){return t.onTouched()}))("compositionstart",(function(){return t._compositionStart()}))("compositionend",(function(e){return t._compositionEnd(e.target.value)}))},exportAs:["magic"],features:[n.ɵɵProvidersFeature([Le]),n.ɵɵInheritDefinitionFeature]});var Be=n.ɵɵgetInheritedFactory(Ge);n.ɵsetClassMetadata(Ge,[{type:n.Directive,args:[{selector:"\n input[magic]:not([type=checkbox]):not([formControlName]):not([no-form-control]),\n textarea[magic]:not([formControlName]):not([noFormControl]):not([no-form-control])\n ",host:{"(input)":"$any(this)._handleInput($event.target.value)","(blur)":"onTouched()","(compositionstart)":"$any(this)._compositionStart()","(compositionend)":"$any(this)._compositionEnd($event.target.value)"},providers:[Le],exportAs:"magic"}]}],null,null);var Ue=function(){function e(e){this.magicDirective=e}return e.prototype.onChange=function(e){this.magicDirective.task.onCheckChanged(e,this.magicDirective.id,+this.magicDirective.rowId)},e}();Ue.ɵfac=function(e){return new(e||Ue)(n.ɵɵdirectiveInject(fe))},Ue.ɵdir=n.ɵɵdefineDirective({type:Ue,selectors:[["input","type","checkbox","magic","","noFormControl",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("change",(function(e){return t.onChange(e)}))}}),n.ɵsetClassMetadata(Ue,[{type:n.Directive,args:[{selector:"\n input[type=checkbox][magic]:([noFormControl]) \n "}]}],(function(){return[{type:fe}]}),{onChange:[{type:n.HostListener,args:["change",["$event"]]}]});var He=function(){function e(e){this.magicDirective=e}return e.prototype.onChange=function(e){this.magicDirective.task.setInputTextValue(this.magicDirective.id,this.magicDirective.rowId,event.srcElement.value)},e}();He.ɵfac=function(e){return new(e||He)(n.ɵɵdirectiveInject(fe))},He.ɵdir=n.ɵɵdefineDirective({type:He,selectors:[["input","magic","","noFormControl","",3,"type","checkbox"],["textarea","magic","","noFormControl","",3,"type","checkbox"]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("change",(function(e){return t.onChange(e)}))}}),n.ɵsetClassMetadata(He,[{type:n.Directive,args:[{selector:"input[magic]:([noFormControl]):not([type=checkbox]),\n textarea[magic]:([noFormControl]):not([type=checkbox])"}]}],(function(){return[{type:fe}]}),{onChange:[{type:n.HostListener,args:["change",["$event"]]}]});var We={provide:i.NG_VALUE_ACCESSOR,useExisting:n.forwardRef((function(){return ze})),multi:!0},ze=function(){function e(e,t){this.renderer=e,this.elementRef=t,this.onChange=function(e){},this.onTouched=function(){}}return e.prototype.writeValue=function(e){e?this.renderer.setProperty(this.elementRef.nativeElement,"valueAsDate",new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate()))):this.renderer.setProperty(this.elementRef.nativeElement,"value",null)},e.prototype.registerOnChange=function(e){this.onChange=function(t){return e(t instanceof Date?new Date(t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()):t)}},e.prototype.registerOnTouched=function(e){this.onTouched=e},e.prototype.setDisabledState=function(e){this.renderer.setProperty(this.elementRef.nativeElement,"disabled",e)},e}();ze.ɵfac=function(e){return new(e||ze)(n.ɵɵdirectiveInject(n.Renderer2),n.ɵɵdirectiveInject(n.ElementRef))},ze.ɵdir=n.ɵɵdefineDirective({type:ze,selectors:[["","dateInput",""]],hostBindings:function(e,t){1&e&&n.ɵɵlistener("input",(function(e){return t.onChange(e.target.valueAsDate)}))("blur",(function(){return t.onTouched()}))},features:[n.ɵɵProvidersFeature([We])]}),n.ɵsetClassMetadata(ze,[{type:n.Directive,args:[{selector:"[dateInput]",providers:[We]}]}],(function(){return[{type:n.Renderer2},{type:n.ElementRef}]}),{onChange:[{type:n.HostListener,args:["input",["$event.target.valueAsDate"]]}],onTouched:[{type:n.HostListener,args:["blur",[]]}]});var Ye=function(){function e(e,t,n,r){this._task=e,this.element=t,this.renderer=n,this.vcRef=r,this.eventHandlers={},this.eventsOnlyVal=!1,this.htmlElement=this.element.nativeElement}return Object.defineProperty(e.prototype,"magic",{set:function(e){this.id=e,this.selector="NonMagicControl"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"task",{get:function(){return this._task},enumerable:!1,configurable:!0}),e.prototype.regEvents=function(){var e=this;this.eventHandlers.focusin=this.OnFocus.bind(this),Object.keys(this.eventHandlers).forEach((function(t){e.focusUnlistener=e.renderer.listen(e.htmlElement,t,e.eventHandlers[t])}))},e.prototype.OnFocus=function(){this.task.insertEvent(c.getGuiEventObj("focusOnNonMagicControl","",-1)),event.cancelBubble=!0},e.prototype.ngOnInit=function(){this.regEvents()},e}();Ye.ɵfac=function(e){return new(e||Ye)(n.ɵɵdirectiveInject(se),n.ɵɵdirectiveInject(n.ElementRef),n.ɵɵdirectiveInject(n.Renderer2),n.ɵɵdirectiveInject(n.ViewContainerRef))},Ye.ɵdir=n.ɵɵdefineDirective({type:Ye,selectors:[["","NonMagicControl",""]],inputs:{magic:["NonMagicControl","magic"]}}),n.ɵsetClassMetadata(Ye,[{type:n.Directive,args:[{selector:"[NonMagicControl]"}]}],(function(){return[{type:se},{type:n.ElementRef},{type:n.Renderer2},{type:n.ViewContainerRef}]}),{magic:[{type:n.Input,args:["NonMagicControl"]}]});var Xe=[fe,Te,Ue,He,Oe,me,Ne,Ge,ze,de,Q,Z,te,B,G,z,V,je,Re,ke,he,Ce,ye,be,Se,Ye,U,H],Ke=function(){function e(){}return e.forRoot=function(){return{ngModule:e,providers:[x,D,A,F,oe]}},e}();Ke.ɵmod=n.ɵɵdefineNgModule({type:Ke}),Ke.ɵinj=n.ɵɵdefineInjector({factory:function(e){return new(e||Ke)},providers:[re,J],imports:[[r.CommonModule,i.FormsModule,i.ReactiveFormsModule,o.RouterModule,a.DynamicModule,h.HttpClientModule]]}),("undefined"==typeof ngJitMode||ngJitMode)&&n.ɵɵsetNgModuleScope(Ke,{declarations:[fe,Te,Ue,He,Oe,me,Ne,Ge,ze,de,Q,Z,te,B,G,z,V,je,Re,ke,he,Ce,ye,be,Se,Ye,U,H],imports:[r.CommonModule,i.FormsModule,i.ReactiveFormsModule,o.RouterModule,a.DynamicModule,h.HttpClientModule],exports:[fe,Te,Ue,He,Oe,me,Ne,Ge,ze,de,Q,Z,te,B,G,z,V,je,Re,ke,he,Ce,ye,be,Se,Ye,U,H]}),n.ɵsetClassMetadata(Ke,[{type:n.NgModule,args:[{declarations:M(Xe),exports:M(Xe),entryComponents:[],imports:[r.CommonModule,i.FormsModule,i.ReactiveFormsModule,o.RouterModule,a.DynamicModule,h.HttpClientModule],providers:[re,J]}]}],null,null);var qe={parse:{dateInput:{month:"short",year:"numeric",day:"numeric"}},display:{dateInput:"input",monthYearLabel:{year:"numeric",month:"short"},dateA11yLabel:{year:"numeric",month:"long",day:"numeric"},monthYearA11yLabel:{year:"numeric",month:"long"}}},$e=function(e){function t(t,n){var r=e.call(this,"en-US",t)||this;return r.platform=t,r.task=n,r.mgdtfmt=null,r}return C(t,e),t.prototype.parse=function(e){var t=e,n=0,r=0,o=0,i=this.mgdtfmt,a=t.indexOf("/")>0?"/":"-";if(null==e||""==e)return null;if(null==this.mgdtfmt&&null!=this.task.mgInputDateFormat&&(this.mgdtfmt=this.task.mgInputDateFormat),this.mgdtfmt.indexOf("MMM")>0||this.mgdtfmt.indexOf("MMMM")>0)return new Date(e);t.length;if(null!==i){for(var s=0;s<i.length;)switch(i[s]){case"d":var c=void 0;for(c=-1==(l=t.indexOf(a,0))?t:t.substr(0,l),l>-1&&(t=t.substr(l+1));"d"==i[s];s++);n=Number(c);break;case"M":c=void 0;for(c=-1==(l=t.indexOf(a,0))?t:t.substr(0,l),l>-1&&(t=t.substr(l+1));"M"==i[s];s++);r=Number(c)>0?Number(c)-1:0;break;case"y":var l;c=void 0;for(c=-1==(l=t.indexOf(a,0))?t:t.substr(0,l),l>-1&&(t=t.substr(l+1));"y"==i[s];s++);o=Number(c);break;default:s++}return 0==r&&0==o&&0==n?null:new Date(Date.UTC(o,r,n))}},t.prototype.format=function(e,t){return null==this.mgdtfmt&&null!=this.task.mgInputDateFormat&&(this.mgdtfmt=this.task.mgInputDateFormat),"input"===t?(null==this.mgdtfmt&&(this.mgdtfmt="M/d/yyyy"),r.formatDate(e,this.mgdtfmt,this.locale)):e.toDateString()},t}(g.NativeDateAdapter);$e.ɵfac=function(e){return new(e||$e)(n.ɵɵinject(y.Platform),n.ɵɵinject(se))},$e.ɵprov=n.ɵɵdefineInjectable({token:$e,factory:$e.ɵfac}),n.ɵsetClassMetadata($e,[{type:n.Injectable}],(function(){return[{type:y.Platform},{type:se}]}),null);var Qe=[{provide:g.DateAdapter,useClass:$e},{provide:g.MAT_DATE_FORMATS,useValue:qe}],Je=[pe,se,N,le,ue,Qe],Ze=M(Je,[ce]),et=function(){function e(){}return e.addChildren=function(e,t,n){for(var r=0;r<e.children.length;r++)void 0!==e.children[r].attributes[n]&&t.push(e.children[r]),this.addChildren(e.children[r],t,n)},e.getDistance=function(e,t,n){var r,o,i=e.clientLeft,a=e.clientTop,s=i+e.clientWidth,c=a+e.clientHeight;return(r=t<i?i-t:t>s?t-s:0)*r+(o=n<a?a-n:n>c?n-c:0)*o},e.getDimentions=function(e){for(var t=0,n=0,r=e.width,o=e.height;e;){if("BODY"==e.tagName){var i=e.scrollLeft||document.documentElement.scrollLeft,a=e.scrollTop||document.documentElement.scrollTop;t+=e.offsetLeft-i+e.clientLeft,n+=e.offsetTop-a+e.clientTop}else t+=e.offsetLeft-e.scrollLeft+e.clientLeft,n+=e.offsetTop-e.scrollTop+e.clientTop;e=e.offsetParent}return{x:t,y:n,width:r,height:o}},e}(),tt=function(){this.taskId="",this.comp=null,this.parameters={}};e.AccessorMagicService=ue,e.BaseMagicAlertComponent=B,e.BaseMagicConfirmComponent=G,e.CHECKBOX_VALUE_ACCESSOR=Fe,e.CheckboxMagicDirective=Te,e.CheckboxNoFormControlMagicDirective=Ue,e.ComboboxMagicDirective=Oe,e.CommandsCollectorMagicService=A,e.ComponentListMagicService=D,e.ConfirmationComponentsMagicProvider=re,e.Constants=ge,e.ControlMetadata=T,e.ControlsMetadata=O,e.DATE_VALUE_ACCESSOR=We,e.DateMagicPipe=ye,e.DateValueAccessor=ze,e.EngineMagicService=x,e.ErrorMagicComponent=ke,e.ExitMagicService=Pe,e.GuiInteractiveExecutor=L,e.InputNoFormControlMagicDirective=He,e.MAGIC_DEFAULT_VALUE_ACCESSOR=Le,e.MG_FORMATS=qe,e.MagicAlertComponent=Z,e.MagicCheckboxControlValueAccessor=Ne,e.MagicConfirmationBoxComponent=te,e.MagicDefaultValueAccessor=Ge,e.MagicDirective=fe,e.MagicFocusDirective=U,e.MagicModule=Ke,e.MagicOverlayContainer=Q,e.MagicOverlayContainerWrapper=z,e.MagicServices=pe,e.MagicShellComponent=je,e.MagicViewContainerRef=H,e.MgDateAdapter=$e,e.MgDateFormatter=ve,e.MgformatMagicDirective=Ce,e.ModalFormDefinition=tt,e.NoControlMagicDirective=he,e.NonMagicControlDirective=Ye,e.OverlayContainerMagicProvider=J,e.OverlayWindowService=oe,e.RangeValidatorMagicDirective=Se,e.Records=P,e.RouteCommand=j,e.RouterCommandsMagicService=F,e.RouterContainerMagicComponent=V,e.RowMagicDirective=me,e.StylesMapManager=_,e.SubformMagicComponent=Re,e.SubformMagicService=N,e.TableMagicService=ce,e.TaskBaseMagicComponent=de,e.TaskMagicService=se,e.TimeMagicPipe=be,e.TitleMagicService=le,e.basicMagicProviders=Je,e.confirmationBox=Y,e.magicProviders=Ze,e.matDateProviders=Qe,e.utils=et,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
16
16
|
//# sourceMappingURL=magic-xpa-angular.umd.min.js.map
|