@sava-info-systems/api-maker-with-extensions 1.9.0 → 1.11.0
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/dist/1025.js +1 -1
- package/dist/1097.js +1 -1
- package/dist/148.js +1 -1
- package/dist/1558.js +1 -1
- package/dist/1678.js +1 -1
- package/dist/1754.js +1 -1
- package/dist/1928.js +1 -1
- package/dist/1957.js +1 -1
- package/dist/2140.js +1 -1
- package/dist/2295.js +1 -1
- package/dist/2473.js +1 -1
- package/dist/2714.js +1 -1
- package/dist/2735.js +1 -1
- package/dist/2908.js +1 -1
- package/dist/3139.js +1 -1
- package/dist/3450.js +1 -1
- package/dist/4110.js +1 -1
- package/dist/4181.js +1 -1
- package/dist/4186.js +1 -1
- package/dist/4211.js +1 -1
- package/dist/4575.js +1 -1
- package/dist/4842.js +1 -1
- package/dist/485.js +1 -1
- package/dist/4895.js +1 -1
- package/dist/5249.js +1 -1
- package/dist/5334.js +1 -1
- package/dist/5421.js +1 -1
- package/dist/5679.js +1 -1
- package/dist/5761.js +1 -1
- package/dist/5765.js +1 -1
- package/dist/6236.js +1 -1
- package/dist/6393.js +1 -1
- package/dist/6401.js +1 -1
- package/dist/7368.js +1 -1
- package/dist/7436.js +1 -1
- package/dist/7470.js +1 -1
- package/dist/7649.js +1 -1
- package/dist/7975.js +1 -1
- package/dist/7977.js +1 -1
- package/dist/7987.js +1 -1
- package/dist/8125.js +1 -1
- package/dist/8266.js +1 -1
- package/dist/8296.js +1 -1
- package/dist/8841.js +1 -1
- package/dist/885.js +1 -1
- package/dist/891.js +1 -1
- package/dist/913.js +1 -1
- package/dist/9243.js +1 -1
- package/dist/9575.js +1 -1
- package/dist/9939.js +1 -1
- package/dist/assets/schema-types/InterfaceProps.ts +3 -1
- package/dist/assets/schema-types/types.ts +313 -12
- package/dist/assets/swagger/index.html +4 -0
- package/dist/common.js +1 -1
- package/dist/index.html +4 -1
- package/dist/main.js +1 -1
- package/main.js +1 -1
- package/package.json +6 -5
- package/sandbox/assets/schema-types/types.js +41 -0
- package/sandbox/sandbox.js +1 -1
- package/src/assets/schema-types/types.ts +313 -12
- package/src/public/dist-db-masters/browser/main.js +49 -49
- package/src/public/index.hbs +2 -2
package/dist/1097.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1097,6925,8374,8682,1617],{1097:(Me,B,l)=>{l.r(B),l.d(B,{DbMastersM:()=>Vt});var N=l(7664),x=l(8176),O=l(3726),d=l(5861),m=l(95),_=l(6990),u=l(3157),p=l(328),U=l(9361),C=l(1162),D=l(553),k=l(5085),n=l(1601),T=l(3531),H=l(9989),e=l(4946),Z=l(9961),w=l(7240),I=l(7414),ie=l(9729),P=l(5852),j=l(2304),se=l(4795),R=l(3429),J=l(2915),V=l(2189),K=l(3835),Y=l(6814),W=l(2660),z=l(5860),X=l(756),L=l(7680),Q=l(4844),q=l(3259),Ce=l(3965),ee=l(5025);const Se=["insertCodeModalC"],be=["monacoEditorModalC"];function Te(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",37),e._uU(2," Add UI Page"),e.qZA())}function ve(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",38),e._uU(2," View UI Page"),e.qZA())}function ye(i,r){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",39),e._uU(2," Edit UI Page "),e.TgZ(3,"span",40),e._uU(4),e.qZA(),e.TgZ(5,"span",40),e._uU(6),e.qZA(),e.TgZ(7,"span",40),e._uU(8),e.qZA(),e.TgZ(9,"span",40),e._uU(10),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(null==t.form.get("instanceName").value?null:t.form.get("instanceName").value.name),e.xp6(2),e.hij("| \xa0",null==t.form.get("databaseName").value?null:t.form.get("databaseName").value.db,""),e.xp6(2),e.hij("| \xa0",null==t.form.get("collectionName").value?null:t.form.get("collectionName").value.name,""),e.xp6(2),e.hij("| \xa0",t.form.get("name").value,"")}}function De(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",41)(1,"app-monaco-editor",42),e.NdJ("editorGenerated",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!1)("editorOptions",t.editorOptionsDBMasters)}}function Ue(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",41)(1,"app-monaco-editor",42),e.NdJ("editorGenerated",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.editorGeneratedJSUtil(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!0)("editorOptions",t.editorOptionsDBMastersJS)}}function ke(i,r){if(1&i&&(e.TgZ(0,"span",43),e._uU(1),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.AsE(" You are allowed to use ",null==t.authS.backendSettings?null:t.authS.backendSettings.dbMastersCountForUI," UI pages, and you are using ",t.totalCreatedMasters," UI Pages. ")}}function Ze(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"a",44),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function we(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function Ie(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",45),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",46),e.YNc(2,we,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function xe(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function Ee(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function Ae(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",45),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",46),e.YNc(2,xe,2,0,"span",4),e.YNc(3,Ee,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid||t.totalCreatedMasters>(null==t.authS.backendSettings?null:t.authS.backendSettings.dbMastersCountForUI)),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Fe(i,r){1&i&&e._UZ(0,"p-progressSpinner",47)}let ne=(()=>{class i{fb;ns;generalS;constantsS;dbMastersS;authCS;monacoS;authS;instanceS;eventCenterS;generalCS;navigationCS;userS;cd;data;totalCreatedMasters;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=u.F;id;BE_HOST_PORT=D.N.BE_HOST_PORT;DOCS_HOST_PORT=D.N.DOCS_HOST_PORT;instances=[];editorDBMaster;editorDBMasterJS;editorOptionsDBMasters={readOnly:!1,language:"typescript",contextmenu:!0};editorOptionsDBMastersJS={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab={};dbIdMap={};colIdMap={};formDataTemp=null;constructor(t,a,o,s,c,f,M,g,h,v,y,E,A,F){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=s,this.dbMastersS=c,this.authCS=f,this.monacoS=M,this.authS=g,this.instanceS=h,this.eventCenterS=v,this.generalCS=y,this.navigationCS=E,this.userS=A,this.cd=F}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){if(o)if(t.form.enable(),o.action===u.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.form.disable(),t.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.resetDependentObjects("INSTANCE"),yield t.loadInstances();const s=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,k.R.DB_MASTERS_JSON).toPromise();t.editorOptionsDBMasters={readOnly:!1},t.generalCS.setValueInEditor(t,"editorDBMaster",s.data);const c=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,k.R.DB_MASTERS_JS_UTILS).toPromise();t.editorOptionsDBMastersJS={readOnly:!1},t.generalCS.setValueInEditor(t,"editorDBMasterJS",c.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var t=this;return(0,d.Z)(function*(){const a=yield t.dbMastersS.getById(t.data.formData._id).toPromise();t.form.reset(),t.resetDependentObjects("INSTANCE"),t.form.patchValue(a.data),t.formDataTemp=a.data,t.generalCS.setValueInEditor(t,"editorDBMaster",a.data?.dbMasterConfigCode||""),t.generalCS.setValueInEditor(t,"editorDBMasterJS",a.data?.pageUtilsCode||""),yield t.loadInstances(),t.formDataTemp=null})()}createForm(){this.form=this.fb.group({name:[null,[m.kI.required,m.kI.minLength(3),m.kI.maxLength(50),m.kI.pattern("[a-zA-Z0-9_-]*$")]],instanceName:[null,[m.kI.required]],databaseName:[null,[m.kI.required]],collectionName:[null,[m.kI.required]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idDBMastersForm").modal("show")},100)}hideModal(){$("#idDBMastersForm").modal("hide")}save(t){var a=this;return(0,d.Z)(function*(){const o=a.form.getRawValue();let M;o.instanceName=o.instanceName.name,o.databaseName=o.databaseName.db,o.collectionName=o.collectionName.name,M=a.data.formData&&a.data.formData._id?(yield a.dbMastersS.getById(a.data.formData._id).toPromise()).data:{};const g=Object.assign({},M,o);g.user=a.authCS.getUserId(),g.dbMasterConfigCode=a.editorDBMaster.getValue(),g.pageUtilsCode=a.editorDBMasterJS.getValue();try{let h;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorDBMaster,a.monacoDecorations),a.monacoS.clearEditorDecorations(a.editorDBMasterJS,a.monacoDecorations),a.data.mode===p.D.ADD?h=yield a.dbMastersS.post(g).toPromise():a.data.mode===p.D.EDIT&&(h=yield a.dbMastersS.put(g._id,g,{select:C.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.dbMaster.addSuccess:a.constantsS.dbMaster.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?u.F.SAVED:u.F.UPDATED,data:h}),a.loading.form=!1}catch(h){a.loading.form=!1,a.ns.showErrorFromResponse(h.error||h,"Unable to save database master."),a.lastError=h.error,a.tab=a.tab||{},a.tab.axiosResponse={data:h.error},a.monacoS.highlightErrorInMonacoEditor(a.editorDBMaster,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=U.H.All,this.insertCodeModalC.showModal(T.b.CodeFinderResultC)}editorGenerated(t){var a=this;return(0,d.Z)(function*(){a.editorDBMaster=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=U.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.DBMastersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===H.g.TEXT_COPIED&&o.componentName===T.b.DBMastersFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}editorGeneratedJSUtil(t){var a=this;return(0,d.Z)(function*(){a.editorDBMasterJS=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=U.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.DBMastersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===H.g.TEXT_COPIED&&o.componentName===T.b.DBMastersFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),n.d.json)}loadInstances(){var t=this;return(0,d.Z)(function*(){t.resetDependentObjects("INSTANCE"),t.loading.form=!0;try{const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{name:1}};t.tab.allInstances=(yield t.instanceS.query(a).toPromise()).data||[]}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allInstances=[]}if(t.formDataTemp){const a=t.form.controls.instanceName;t.tab.instance=_.find(t.tab.allInstances,{name:t.formDataTemp.instanceName}),t.tab.instance&&a.setValue(t.tab.instance)}else t.tab.instance=t.tab.allInstances[0];yield t.loadDatabases(),t.loading.form=!1,t.cd.detectChanges()})()}loadDatabases(){var t=this;return(0,d.Z)(function*(){if(t.loading.form=!0,t.resetDependentObjects("DATABASE"),!t.tab.instance)return t.tab.allDatabases=[],void(t.tab.allCollections=[]);try{t.tab.allDatabases=((yield t.instanceS.getDatabases([t.tab.instance]).toPromise()).data||[])[0]||[],t.dbIdMap=_.keyBy(t.tab.allDatabases,C.N7.db)}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allDatabases=[]}if(t.formDataTemp){const a=t.form.get("databaseName");t.tab.database=_.find(t.tab.allDatabases,{db:t.formDataTemp.databaseName}),t.tab.database&&a.patchValue(t.tab.database)}else t.tab.database=t.tab.allDatabases[0];yield t.loadCollections(),t.loading.form=!1})()}loadCollections(){var t=this;return(0,d.Z)(function*(){if(t.loading.form=!0,t.resetDependentObjects("COLLECTION"),t.tab.instance&&t.tab.database){try{t.tab.allCollections=((yield t.instanceS.getCollections([t.tab.database]).toPromise()).data||[])[0]||[],t.colIdMap=_.keyBy(t.tab.allCollections,C.GR.name)}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allCollections=[]}if(t.formDataTemp){const a=t.form.get("collectionName");t.tab.collection=_.find(t.tab.allCollections,{name:t.formDataTemp.collectionName}),t.tab.collection&&a.patchValue(t.tab.collection)}else t.tab.collection=t.tab.allCollections[0];t.loading.form=!1,t.cd.detectChanges()}else t.tab.allCollections=[]})()}resetDependentObjects(t){"INSTANCE"===t?(this.tab.allInstances=this.tab.allDatabases=this.tab.allCollections=[],this.tab.instance=this.tab.database=this.tab.collection=this.tab.api=void 0):"DATABASE"===t?(this.tab.allDatabases=this.tab.allCollections=[],this.tab.database=this.tab.collection=this.tab.api=void 0):"COLLECTION"===t&&(this.tab.allCollections=[],this.tab.collection=this.tab.api=void 0)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(a){return new(a||i)(e.Y36(m.qu),e.Y36(Z.W),e.Y36(w.b),e.Y36(I.L),e.Y36(ie.z),e.Y36(P.D),e.Y36(j.b),e.Y36(se.e),e.Y36(R.E),e.Y36(J.u),e.Y36(w.b),e.Y36(V.S),e.Y36(K.K),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(Se,5),e.Gf(be,5)),2&a){let s;e.iGM(s=e.CRH())&&(o.insertCodeModalC=s.first),e.iGM(s=e.CRH())&&(o.viewDockerfileModelC=s.first)}},inputs:{data:"data",totalCreatedMasters:"totalCreatedMasters"},decls:56,vars:23,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idDBMastersForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],["href","https://docs.apimaker.dev/v1/extensions/ui_maker/introduction.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],["header","Basic Info"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["optionLabel","name","filterBy","name","appendTo","body","formControlName","instanceName","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["formControlName","databaseName","optionLabel","db","filterBy","db","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["formControlName","collectionName","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["header","Config"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],["header","Utility Functions (Main)"],[1,"modal-footer"],["class","mr-3 small text-danger",4,"ngIf"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","editorGenerated"],[1,"mr-3","small","text-danger"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,Te,3,0,"span",4),e.YNc(5,ve,3,0,"span",4),e.YNc(6,ye,11,4,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA(),e.TgZ(13,"a",11),e._UZ(14,"img",12),e.qZA()()(),e.TgZ(15,"div",13)(16,"p-tabView")(17,"p-tabPanel",14)(18,"form",15)(19,"div",16)(20,"label",17),e._uU(21,"Name"),e.qZA(),e.TgZ(22,"div",18),e._UZ(23,"input",19),e.qZA()(),e.TgZ(24,"div",16)(25,"label",17),e._uU(26,"Instance"),e.qZA(),e.TgZ(27,"div",18)(28,"p-dropdown",20),e.NdJ("onChange",function(c){return o.tab.instance=c.value,o.loadDatabases()}),e.qZA()()(),e.TgZ(29,"div",16)(30,"label",17),e._uU(31,"Database"),e.qZA(),e.TgZ(32,"div",18)(33,"p-dropdown",21),e.NdJ("onChange",function(c){return o.tab.database=c.value,o.loadCollections()}),e.qZA()()(),e.TgZ(34,"div",16)(35,"label",17),e._uU(36,"Collection"),e.qZA(),e.TgZ(37,"div",18)(38,"p-dropdown",22),e.NdJ("onChange",function(c){return o.tab.collection=c.value}),e.qZA()()()()(),e.TgZ(39,"p-tabPanel",23),e.YNc(40,De,2,3,"div",24),e.qZA(),e.TgZ(41,"p-tabPanel",25),e.YNc(42,Ue,2,3,"div",24),e.qZA()()(),e.TgZ(43,"div",26),e.YNc(44,ke,2,2,"span",27),e.YNc(45,Ze,2,0,"a",28),e.TgZ(46,"button",29),e.NdJ("click",function(){return o.hideModal()}),e._UZ(47,"i",30),e._uU(48," Close"),e.qZA(),e.YNc(49,Ie,3,2,"button",31),e.YNc(50,Ae,4,3,"button",31),e.qZA(),e.YNc(51,Fe,1,0,"p-progressSpinner",32),e.qZA()()(),e._UZ(52,"app-insert-code-modal",33,34)(54,"app-monaco-editor-modal",35,36)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(12),e.Q6J("formGroup",o.form),e.xp6(10),e.Q6J("options",o.tab.allInstances)("filter",!0),e.xp6(5),e.Q6J("options",o.tab.allDatabases)("filter",!0),e.xp6(5),e.Q6J("options",o.tab.allCollections)("filter",!0),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.totalCreatedMasters>(null==o.authS.backendSettings?null:o.authS.backendSettings.dbMastersCountForUI)),e.xp6(1),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalDBMaster")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[m._Y,m.Fj,m.JJ,m.JL,m.sg,m.u,Y.O5,W.y,z.P,X.O,L.G,Q.xf,Q.x4,q.u,Ce.Lt,ee.A],encapsulation:2,changeDetection:0})}return i})();var te=l(4950);let Ne=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[x.u,te.A]})}return i})();var S=l(6212),re=l(6925),Oe=l(9394),ae=l(2466),oe=l(921),Pe=l(5561),G=l(5219),Re=l(7797),b=l(5431);const Je=["DBMastersFormC"],Ye=["cloneApiModalC"];function Le(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",24),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",25),e.qZA()}}function Qe(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",26),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",27),e.qZA()}}function qe(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",28),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",29),e.qZA()}}function Ge(i,r){1&i&&(e.TgZ(0,"th",31),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function Be(i,r){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,Ge,2,0,"th",30),e.TgZ(2,"th",31),e._uU(3,"*"),e.qZA(),e.TgZ(4,"th",32),e._uU(5,"Name"),e.qZA(),e.TgZ(6,"th"),e._uU(7,"Instance \u2192 Database \u2192 Collection"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Required Auth Headers"),e.qZA(),e._UZ(10,"th",33),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function He(i,r){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",39),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function Ve(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"tr",34),e.YNc(1,He,2,2,"td",35),e.TgZ(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td")(11,"div",36)(12,"button",37),e.NdJ("click",function(){const s=e.CHM(t).$implicit,c=e.oxw();return e.KtG(c.openMasterPageInNewTab(s))}),e._UZ(13,"i",38),e.qZA()()()()}if(2&i){const t=r.$implicit,a=r.rowIndex,o=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",o.showCheckbox),e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.lnq("",t.instanceName," \u2192 ",t.databaseName," \u2192 ",t.collectionName,""),e.xp6(2),e.Oqu(t.authHeadersGrid)}}function Ke(i,r){1&i&&e._UZ(0,"p-progressSpinner",40)}let le=(()=>{class i{dbMastersS;generalS;notificationS;navigationCS;navigationS;authCS;authS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};EUserType=oe.dN;gridKey=C.iH._id;EAPICategory=k.R;ENavigationMenu=ae.E;BE_HOST_PORT=D.N.BE_HOST_PORT;selectedRows=[];dbMastersFormC;cloneApiModalC;constructor(t,a,o,s,c,f,M,g,h,v,y,E,A,F,Kt,jt){this.dbMastersS=t,this.generalS=a,this.notificationS=o,this.navigationCS=s,this.navigationS=c,this.authCS=f,this.authS=M,this.constantsS=g,this.eventCenterS=h,this.router=v,this.userS=y,this.instanceS=E,this.ns=A,this.cs=F,this.confirmationService=Kt,this.cd=jt}ngOnInit(){var t=this;return(0,d.Z)(function*(){if(!t.authS.backendSettings.extensions)return t.navigationS.gotoDashboard();t.eventCenterS.dbMasters.selectedDBMaster.next(void 0),yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){(o.action===u.F.SAVED||o.action===u.F.UPDATED)&&(t.dbMastersFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("UI Maker")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const a=yield t.dbMastersS.getDBMastersGrid({}).toPromise();if(a){t.selectedRows=[],t.rows=a.data,t.rowsMap=_.keyBy(t.rows,C.iH._id);for(const s of t.rows){const c=[];for(const f of s.authHeaders||[])c.push(f.name);s.authHeadersGrid=c.join(", ")}}let o=t.navigationCS.getQueryParam(S.p.am_db_master);o&&!t.rowsMap[o]&&t.rows.length&&(o=t.rows[0]._id),t.rowsMap[o]?yield t.fillData():t.eventCenterS.dbMasters.selectedDBMaster.next(void 0),t.loading.grid=!1,t.cd.detectChanges()})()}add(){this.data.formData={order:(_.max(_.map(this.rows,"order"))||0)+1},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.dbMastersFormC.showModal()}edit(){this.data.formData=this.rowsMap[_.map(this.selectedRows,"_id")[0]],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),this.dbMastersFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){yield t.cloneApiModalC.showModal(t.getSelectedRowId(),function(){var a=(0,d.Z)(function*(o){o&&(yield t.loadGridData()),t.cd.detectChanges()});return function(o){return a.apply(this,arguments)}}())})()}getSelectedRowId(){return this.selectedRows[0]?._id}removePermanent(){var t=this;return(0,d.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.dbMaster.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){for(const o of t.selectedRows)yield t.hardDelete(o._id);t.ns.showSuccess(t.cs.dbMaster.removePermanent),yield t.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,d.Z)(function*(){yield a.dbMastersS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.dbMasters.selectedDBMaster.next(void 0)}resetThisUrl(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.dbMasters.selectedDBMaster.next(void 0),yield t.navigationCS.setQueryParam(S.p.am_db_master,null)})()}itemSelected(){var t=this;return(0,d.Z)(function*(){yield t.resetThisUrl(),setTimeout(t.fillData.bind(t))})()}fillData(){var t=this;return(0,d.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(S.p.am_db_master,""),void t.eventCenterS.dbMasters.selectedDBMaster.next(null);const a=t.selectedRows[0];a?(yield t.navigationCS.setQueryParam(S.p.am_db_master,a._id),t.eventCenterS.dbMasters.selectedDBMaster.next(a)):yield t.resetThisUrl()})()}dblClick(){this.selectedRows.length&&this.edit()}openMasterPageInNewTab(t){const a=this.authCS.getUserPath();let o=[D.N.BE_HOST_PORT,"/dist-db-masters/browser/",`?${re.ZF.ADMIN_PATH}=${a}&`].join("");const s=[`${re.ZF.DB_MASTER_NAME}=${t.name}`];for(const c of t.authHeaders)s.push(`${c.name}=____actual_header_value____`);o+=s.join("&"),window.open(o,"_blank")}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}EModelApiPaths=Oe.k4;static \u0275fac=function(a){return new(a||i)(e.Y36(ie.z),e.Y36(w.b),e.Y36(Z.W),e.Y36(V.S),e.Y36(Pe.X),e.Y36(P.D),e.Y36(se.e),e.Y36(I.L),e.Y36(J.u),e.Y36(N.F0),e.Y36(K.K),e.Y36(R.E),e.Y36(Z.W),e.Y36(I.L),e.Y36(G.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-list"]],viewQuery:function(a,o){if(1&a&&(e.Gf(Je,5),e.Gf(Ye,5)),2&a){let s;e.iGM(s=e.CRH())&&(o.dbMastersFormC=s.first),e.iGM(s=e.CRH())&&(o.cloneApiModalC=s.first)}},inputs:{showCheckbox:"showCheckbox"},decls:31,vars:20,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],["src","/assets/images/icons/ui-maker.svg","alt","Database master image",1,"fa-fw","mr-1"],[1,"small","ml-3"],["href","https://docs.apimaker.dev/v1/extensions/ui_maker/introduction.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Styles For UI Pages",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fab","fa-css3","text-info","fa-fw"],["tooltipPosition","left","pTooltip","Common Utilities For UI Pages",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fab","fa-uniregistry","text-info","fa-fw"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"totalCreatedMasters","data"],["DBMastersFormC",""],[3,"modalId","hostAndPort","modelApiPaths"],["cloneApiModalC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[2,"width","45px"],[2,"width","25%"],[2,"width","70px"],[3,"pSelectableRow"],[4,"ngIf"],[1,"text-center"],["tooltipPosition","left","pTooltip","Open master page",1,"btn","btn-xsm-custom",3,"click"],[1,"fas","fa-external-link-alt","text-info","fa-fw"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span")(3,"span"),e._UZ(4,"img",2),e._uU(5," UI Pages"),e.qZA(),e.TgZ(6,"span",3),e._uU(7,"Using "),e.TgZ(8,"span"),e._uU(9),e.qZA(),e._uU(10),e.qZA()(),e.TgZ(11,"a",4),e._UZ(12,"img",5),e.qZA(),e.TgZ(13,"span",6),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"styles"])}),e._UZ(14,"i",7),e.qZA(),e.TgZ(15,"span",8),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"utils"])}),e._UZ(16,"i",9),e.qZA(),e.TgZ(17,"span",10),e.NdJ("click",function(){return o.add()}),e._UZ(18,"i",11),e.qZA(),e.YNc(19,Le,2,0,"span",12),e.YNc(20,Qe,2,0,"span",13),e.YNc(21,qe,2,0,"span",14),e.qZA(),e.TgZ(22,"div",15)(23,"p-table",16),e.NdJ("selectionChange",function(c){return o.selectedRows=c})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClick()}),e.YNc(24,Be,11,1,"ng-template",17),e.YNc(25,Ve,14,8,"ng-template",18),e.qZA(),e.YNc(26,Ke,1,0,"p-progressSpinner",19),e.qZA()(),e._UZ(27,"app-db-masters-form",20,21)(29,"app-clone-api-modal",22,23)),2&a&&(e.xp6(8),e.Tol((null==o.rows?null:o.rows.length)>(null==o.authS.backendSettings?null:o.authS.backendSettings.dbMastersCountForUI)?"text-danger":""),e.xp6(1),e.hij(" ",o.rows.length,""),e.xp6(1),e.hij("/",o.authS.backendSettings.dbMastersCountForUI," "),e.xp6(9),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",1===o.selectedRows.length),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.xp6(3),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("totalCreatedMasters",null==o.rows?null:o.rows.length)("data",o.data),e.xp6(2),e.Q6J("modalId","idCloneDBMasters")("hostAndPort",o.BE_HOST_PORT)("modelApiPaths",o.EModelApiPaths.DB_MASTERS))},dependencies:[Y.O5,Re.s,b.iA,G.jx,b.Ei,b.UA,b.Mo,L.G,q.u,ne],encapsulation:2,changeDetection:0})}return i})(),de=(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-db-masters-list"),e.qZA())},dependencies:[le],encapsulation:2})}return i})();var ce=l(9836),je=l(8057);const We=["insertCodeModalC"],ze=["monacoEditorModalC"];function Xe(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Add Styles"),e.qZA())}function $e(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," View Styles"),e.qZA())}function et(i,r){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Edit Styles "),e.TgZ(3,"span",28),e._uU(4),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(t.form.get("name").value)}}function tt(i,r){1&i&&(e.TgZ(0,"div",30)(1,"label",31),e._uU(2,"Order No"),e.qZA(),e.TgZ(3,"div",32),e._UZ(4,"input",37),e.qZA()())}function at(i,r){if(1&i&&(e.TgZ(0,"div")(1,"form",29)(2,"div",30)(3,"label",31),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",32),e._UZ(6,"input",33),e.qZA()(),e.TgZ(7,"div",30),e._UZ(8,"label",31),e.TgZ(9,"div",32)(10,"label",34),e._UZ(11,"p-checkbox",35),e.qZA()()(),e.YNc(12,tt,5,0,"div",36),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("formGroup",t.form),e.xp6(10),e.Q6J("binary",!0),e.xp6(1),e.Q6J("ngIf",t.form.getRawValue().loadInAllPages)}}function ot(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",38)(1,"app-monaco-editor",39),e.NdJ("editorGenerated",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!1)("isUIMakerEditor",!0)("editorOptions",t.editorOptions)}}function it(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"a",40),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function st(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function nt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",41),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",42),e.YNc(2,st,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function rt(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function lt(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function dt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",41),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",42),e.YNc(2,rt,2,0,"span",4),e.YNc(3,lt,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function ct(i,r){1&i&&e._UZ(0,"p-progressSpinner",43)}let me=(()=>{class i{fb;ns;generalS;constantsS;uiMakerStylesS;authCS;monacoS;instanceS;eventCenterS;generalCS;cd;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=u.F;id;BE_HOST_PORT=D.N.BE_HOST_PORT;DOCS_HOST_PORT=D.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptions={readOnly:!1,language:"css",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"typescript",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(t,a,o,s,c,f,M,g,h,v,y){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=s,this.uiMakerStylesS=c,this.authCS=f,this.monacoS=M,this.instanceS=g,this.eventCenterS=h,this.generalCS=v,this.cd=y}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){if(o)if(t.form.enable(),o.action===u.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.form.patchValue(o.data||{});const s=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,k.R.UI_MAKER_STYLES).toPromise();t.editorOptions={readOnly:!1},t.generalCS.setValueInEditor(t,"editorPI",s.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var t=this;return(0,d.Z)(function*(){const a=yield t.uiMakerStylesS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.generalCS.setValueInEditor(t,"editorPI",a.data?.styleCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[m.kI.required]],loadInAllPages:[!1,[]],orderNumber:[!1,[m.kI.min(1)]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idUIMakerStylesForm").modal("show")},100)}hideModal(){$("#idUIMakerStylesForm").modal("hide")}save(t){var a=this;return(0,d.Z)(function*(){const o=a.form.getRawValue();let s;s=a.data.formData&&a.data.formData._id?(yield a.uiMakerStylesS.getById(a.data.formData._id).toPromise()).data:{};const c=Object.assign({},s,o);c.user=a.authCS.getUserId(),c.styleCode=a.editorPI.getValue();try{let f;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorPI,a.monacoDecorations),a.data.mode===p.D.ADD?f=yield a.uiMakerStylesS.post(c).toPromise():a.data.mode===p.D.EDIT&&(f=yield a.uiMakerStylesS.put(c._id,c,{select:C.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.uiMakerStyle.addSuccess:a.constantsS.uiMakerStyle.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?u.F.SAVED:u.F.UPDATED,data:f}),a.eventCenterS.uiMakerStylesSavedAndUpdate.next(!0),a.loading.form=!1}catch(f){a.loading.form=!1,a.ns.showErrorFromResponse(f.error||f,"Unable to save styles."),a.lastError=f.error,a.tab=a.tab||{},a.tab.axiosResponse={data:f.error},a.monacoS.highlightErrorInMonacoEditor(a.editorPI,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=U.H.All,this.insertCodeModalC.showModal(T.b.UiMakerStylesFormC).then()}editorGenerated(t){var a=this;return(0,d.Z)(function*(){a.editorPI=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=U.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.UiMakerStylesFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===H.g.TEXT_COPIED&&o.componentName===T.b.UiMakerStylesFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),n.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.uiMakerStylesSavedAndUpdate.next(!1)}ISchedulerProps=C.qH;static \u0275fac=function(a){return new(a||i)(e.Y36(m.qu),e.Y36(Z.W),e.Y36(w.b),e.Y36(I.L),e.Y36(ce.q),e.Y36(P.D),e.Y36(j.b),e.Y36(R.E),e.Y36(J.u),e.Y36(w.b),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(We,5),e.Gf(ze,5)),2&a){let s;e.iGM(s=e.CRH())&&(o.insertCodeModalC=s.first),e.iGM(s=e.CRH())&&(o.viewDockerfileModelC=s.first)}},inputs:{data:"data"},decls:31,vars:15,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idUIMakerStylesForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body","overflow-auto"],["header","Basic Info"],["header","Code"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"align-middle","mb-0","pt-1"],["formControlName","loadInAllPages","pTooltip","If true, these styles will be applied to all UI Pages.","label","Load Styles In All Pages",3,"binary"],["class","form-group row",4,"ngIf"],["formControlName","orderNumber","name","orderNumber","spellcheck","false","type","number","placeholder","Order number in which these styles will be loaded in page",1,"form-control","form-control-sm"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,Xe,3,0,"span",4),e.YNc(5,$e,3,0,"span",4),e.YNc(6,et,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"p-tabView")(15,"p-tabPanel",12),e.YNc(16,at,13,3,"div",4),e.qZA(),e.TgZ(17,"p-tabPanel",13),e.YNc(18,ot,2,3,"div",14),e.qZA()()(),e.TgZ(19,"div",15),e.YNc(20,it,2,0,"a",16),e.TgZ(21,"button",17),e.NdJ("click",function(){return o.hideModal()}),e._UZ(22,"i",18),e._uU(23," Close"),e.qZA(),e.YNc(24,nt,3,2,"button",19),e.YNc(25,dt,4,3,"button",19),e.qZA(),e.YNc(26,ct,1,0,"p-progressSpinner",20),e.qZA()()(),e._UZ(27,"app-insert-code-modal",21,22)(29,"app-monaco-editor-modal",23,24)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(10),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysUIMakerStyles")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[m._Y,m.Fj,m.wV,m.JJ,m.JL,m.sg,m.u,Y.O5,W.y,z.P,X.O,L.G,Q.xf,Q.x4,q.u,je.XZ,ee.A],encapsulation:2,changeDetection:0})}return i})(),mt=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[x.u,te.A]})}return i})();const ut=["uiMakerStylesFormC"];function ft(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",18),e.qZA()}}function pt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",20),e.qZA()}}function _t(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",22),e.qZA()}}function ht(i,r){1&i&&(e.TgZ(0,"th",26),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function gt(i,r){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,ht,2,0,"th",23),e.TgZ(2,"th",24),e._uU(3,"Order"),e.qZA(),e.TgZ(4,"th",25),e._uU(5,"Load in all pages"),e.qZA(),e.TgZ(6,"th"),e._uU(7,"Name"),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function Mt(i,r){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",30),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function Ct(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Yes"),e.qZA())}function St(i,r){if(1&i&&(e.TgZ(0,"tr",27),e.YNc(1,Mt,2,2,"td",28),e.TgZ(2,"td",29),e._uU(3),e.qZA(),e.TgZ(4,"td",29),e.YNc(5,Ct,2,0,"span",28),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA()()),2&i){const t=r.$implicit,a=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(2),e.Oqu(t.orderNumber||""),e.xp6(2),e.Q6J("ngIf",t.loadInAllPages),e.xp6(2),e.Oqu(t.name)}}function bt(i,r){1&i&&e._UZ(0,"p-progressSpinner",31)}let ue=(()=>{class i{uiMakerStylesS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;EUserType=oe.dN;gridKey=C.iH._id;EAPICategory=k.R;selectedRows=[];uiMakerStylesFormC;constructor(t,a,o,s,c,f,M,g,h,v,y,E,A,F){this.uiMakerStylesS=t,this.generalS=a,this.notificationS=o,this.navigationCS=s,this.authCS=c,this.constantsS=f,this.eventCenterS=M,this.router=g,this.userS=h,this.instanceS=v,this.ns=y,this.cs=E,this.confirmationService=A,this.cd=F}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){(o.action===u.F.SAVED||o.action===u.F.UPDATED)&&(t.uiMakerStylesFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("API Maker - UI Maker Styles")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,loadInAllPages:1,orderNumber:1,user:1},sort:{orderNumber:1,name:1}};t.showAll&&delete a.find.active;const o=yield t.uiMakerStylesS.query(a).toPromise();o&&(t.selectedRows=[],t.rows=o.data,t.rowsMap=_.keyBy(t.rows,C.iH._id));let s=t.navigationCS.getQueryParam(S.p.am_ui_maker_style);s&&!t.rowsMap[s]&&t.rows.length&&(s=t.rows[0]._id),t.rowsMap[s]?(t.selectedRows=[t.rowsMap[s]],yield t.fillData()):t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),t.loading.grid=!1,t.cd.detectChanges()})()}add(){this.data.formData={},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.uiMakerStylesFormC.showModal()}edit(){this.data.formData=this.rowsMap[_.map(this.selectedRows,"_id")[0]],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),this.uiMakerStylesFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){try{if(!t.selectedRows[0]||!t.rowsMap[_.map(t.selectedRows,"_id")[0]])return;const a=t.rowsMap[_.map(t.selectedRows,"_id")[0]]._id,o=(yield t.uiMakerStylesS.getById(a).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield t.uiMakerStylesS.post(o).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.uiMakerStyle.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.uiMakerStyle.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.uiMakerStyle.cloneError)}})()}removePermanent(){var t=this;return(0,d.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.uiMakerStyle.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){for(const o of t.selectedRows)yield t.hardDelete(o._id);t.ns.showSuccess(t.cs.uiMakerStyle.removePermanent),yield t.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,d.Z)(function*(){yield a.uiMakerStylesS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.uiMakerStyles.selectedStyle.next(void 0)}resetThisUrl(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),yield t.navigationCS.setQueryParam(S.p.am_ui_maker_style,null)})()}itemSelected(){var t=this;return(0,d.Z)(function*(){yield t.resetThisUrl(),setTimeout(t.fillData.bind(t))})()}fillData(){var t=this;return(0,d.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(S.p.am_ui_maker_style,""),void t.eventCenterS.uiMakerStyles.selectedStyle.next(null);const a=t.selectedRows[0];a?(yield t.navigationCS.setQueryParam(S.p.am_ui_maker_style,a._id),t.eventCenterS.uiMakerStyles.selectedStyle.next(a)):yield t.resetThisUrl()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickHandler(){this.selectedRows.length&&this.edit()}ENavigationMenu=ae.E;static \u0275fac=function(a){return new(a||i)(e.Y36(ce.q),e.Y36(w.b),e.Y36(Z.W),e.Y36(V.S),e.Y36(P.D),e.Y36(I.L),e.Y36(J.u),e.Y36(N.F0),e.Y36(K.K),e.Y36(R.E),e.Y36(Z.W),e.Y36(I.L),e.Y36(G.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-list"]],viewQuery:function(a,o){if(1&a&&e.Gf(ut,5),2&a){let s;e.iGM(s=e.CRH())&&(o.uiMakerStylesFormC=s.first)}},inputs:{showCheckbox:"showCheckbox"},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],[1,"fab","fa-css3","fa-fw","text-white"],["href","javascript:",3,"click"],["tooltipPosition","left","pTooltip","Go back to UI Pages","src","/assets/images/icons/ui-maker.svg",1,"float-right","ml-3","mr-1",2,"height","20px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["uiMakerStylesFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[1,"text-center",2,"width","40px"],[1,"text-center",2,"width","150px"],[2,"width","45px"],[3,"pSelectableRow"],[4,"ngIf"],[1,"text-center"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Styles For UI Pages"),e.qZA(),e.TgZ(5,"a",3),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"main"])}),e._UZ(6,"img",4),e.qZA(),e.TgZ(7,"span",5),e.NdJ("click",function(){return o.add()}),e._UZ(8,"i",6),e.qZA(),e.YNc(9,ft,2,0,"span",7),e.YNc(10,pt,2,0,"span",8),e.YNc(11,_t,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(c){return o.selectedRows=c})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClickHandler()}),e.YNc(14,gt,8,1,"ng-template",12),e.YNc(15,St,8,5,"ng-template",13),e.qZA(),e.YNc(16,bt,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-ui-maker-styles-form",15,16)),2&a&&(e.xp6(9),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.xp6(3),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("data",o.data))},dependencies:[Y.O5,b.iA,G.jx,b.Ei,b.UA,b.Mo,L.G,q.u,me],encapsulation:2,changeDetection:0})}return i})(),fe=(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-ui-maker-styles-list"),e.qZA())},dependencies:[ue],encapsulation:2})}return i})();var pe=l(6125);const Tt=["insertCodeModalC"],vt=["monacoEditorModalC"];function yt(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Add Utility"),e.qZA())}function Dt(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," View Utility"),e.qZA())}function Ut(i,r){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Edit Utility "),e.TgZ(3,"span",28),e._uU(4),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(t.form.get("name").value)}}function kt(i,r){if(1&i&&(e.TgZ(0,"div")(1,"form",29)(2,"div",30)(3,"label",31),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",32),e._UZ(6,"input",33),e.qZA()()()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("formGroup",t.form)}}function Zt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",34)(1,"app-monaco-editor",35),e.NdJ("editorGenerated",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!0)("editorOptions",t.editorOptions)}}function wt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"a",36),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function It(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function xt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",38),e.YNc(2,It,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Et(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function At(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function Ft(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",38),e.YNc(2,Et,2,0,"span",4),e.YNc(3,At,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Nt(i,r){1&i&&e._UZ(0,"p-progressSpinner",39)}let _e=(()=>{class i{fb;ns;generalS;constantsS;uiMakerUtilsS;authCS;monacoS;instanceS;eventCenterS;generalCS;cd;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=u.F;id;BE_HOST_PORT=D.N.BE_HOST_PORT;DOCS_HOST_PORT=D.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptions={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(t,a,o,s,c,f,M,g,h,v,y){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=s,this.uiMakerUtilsS=c,this.authCS=f,this.monacoS=M,this.instanceS=g,this.eventCenterS=h,this.generalCS=v,this.cd=y}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){if(o)if(t.form.enable(),o.action===u.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.form.patchValue(o.data||{});const s=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,k.R.UI_MAKER_UTILITY_CLASS).toPromise();t.editorOptions={readOnly:!1},t.generalCS.setValueInEditor(t,"editorPI",s.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var t=this;return(0,d.Z)(function*(){const a=yield t.uiMakerUtilsS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.generalCS.setValueInEditor(t,"editorPI",a.data?.utilsCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[m.kI.required]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idUIMakerUtilForm").modal("show")},100)}hideModal(){$("#idUIMakerUtilForm").modal("hide")}save(t){var a=this;return(0,d.Z)(function*(){const o=a.form.getRawValue();let s;s=a.data.formData&&a.data.formData._id?(yield a.uiMakerUtilsS.getById(a.data.formData._id).toPromise()).data:{};const c=Object.assign({},s,o);c.user=a.authCS.getUserId(),c.utilsCode=a.editorPI.getValue();try{let f;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorPI,a.monacoDecorations),a.data.mode===p.D.ADD?f=yield a.uiMakerUtilsS.post(c).toPromise():a.data.mode===p.D.EDIT&&(f=yield a.uiMakerUtilsS.put(c._id,c,{select:C.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.uiMakerUtil.addSuccess:a.constantsS.uiMakerUtil.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?u.F.SAVED:u.F.UPDATED,data:f}),a.eventCenterS.uiMakerUtilsSavedAndUpdate.next(!0),a.loading.form=!1}catch(f){a.loading.form=!1,a.ns.showErrorFromResponse(f.error||f,"Unable to save utility."),a.lastError=f.error,a.tab=a.tab||{},a.tab.axiosResponse={data:f.error},a.monacoS.highlightErrorInMonacoEditor(a.editorPI,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=U.H.All,this.insertCodeModalC.showModal(T.b.UiMakerUtilsFormC).then()}editorGenerated(t){var a=this;return(0,d.Z)(function*(){a.editorPI=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=U.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.UiMakerUtilsFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===H.g.TEXT_COPIED&&o.componentName===T.b.UiMakerUtilsFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),n.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.uiMakerUtilsSavedAndUpdate.next(!1)}static \u0275fac=function(a){return new(a||i)(e.Y36(m.qu),e.Y36(Z.W),e.Y36(w.b),e.Y36(I.L),e.Y36(pe.L),e.Y36(P.D),e.Y36(j.b),e.Y36(R.E),e.Y36(J.u),e.Y36(w.b),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-utils-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(Tt,5),e.Gf(vt,5)),2&a){let s;e.iGM(s=e.CRH())&&(o.insertCodeModalC=s.first),e.iGM(s=e.CRH())&&(o.viewDockerfileModelC=s.first)}},inputs:{data:"data"},decls:31,vars:15,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idUIMakerUtilForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body","overflow-auto"],["header","Basic Info"],["header","Code"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,yt,3,0,"span",4),e.YNc(5,Dt,3,0,"span",4),e.YNc(6,Ut,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"p-tabView")(15,"p-tabPanel",12),e.YNc(16,kt,7,1,"div",4),e.qZA(),e.TgZ(17,"p-tabPanel",13),e.YNc(18,Zt,2,3,"div",14),e.qZA()()(),e.TgZ(19,"div",15),e.YNc(20,wt,2,0,"a",16),e.TgZ(21,"button",17),e.NdJ("click",function(){return o.hideModal()}),e._UZ(22,"i",18),e._uU(23," Close"),e.qZA(),e.YNc(24,xt,3,2,"button",19),e.YNc(25,Ft,4,3,"button",19),e.qZA(),e.YNc(26,Nt,1,0,"p-progressSpinner",20),e.qZA()()(),e._UZ(27,"app-insert-code-modal",21,22)(29,"app-monaco-editor-modal",23,24)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(10),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysUIMakerUtility")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[m._Y,m.Fj,m.JJ,m.JL,m.sg,m.u,Y.O5,W.y,z.P,X.O,L.G,Q.xf,Q.x4,q.u,ee.A],encapsulation:2,changeDetection:0})}return i})(),Ot=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[x.u,te.A]})}return i})();const Pt=["uiMakerUtilsFormC"];function Rt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",18),e.qZA()}}function Jt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",20),e.qZA()}}function Yt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",22),e.qZA()}}function Lt(i,r){1&i&&(e.TgZ(0,"th",24),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function Qt(i,r){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,Lt,2,0,"th",23),e.TgZ(2,"th"),e._uU(3,"Name"),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function qt(i,r){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",27),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function Gt(i,r){if(1&i&&(e.TgZ(0,"tr",25),e.YNc(1,qt,2,2,"td",26),e.TgZ(2,"td"),e._uU(3),e.qZA()()),2&i){const t=r.$implicit,a=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(2),e.Oqu(t.name)}}function Bt(i,r){1&i&&e._UZ(0,"p-progressSpinner",28)}let he=(()=>{class i{uiMakerUtilsS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;EUserType=oe.dN;gridKey=C.iH._id;EAPICategory=k.R;selectedRows=[];uiMakerUtilsFormC;constructor(t,a,o,s,c,f,M,g,h,v,y,E,A,F){this.uiMakerUtilsS=t,this.generalS=a,this.notificationS=o,this.navigationCS=s,this.authCS=c,this.constantsS=f,this.eventCenterS=M,this.router=g,this.userS=h,this.instanceS=v,this.ns=y,this.cs=E,this.confirmationService=A,this.cd=F}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){(o.action===u.F.SAVED||o.action===u.F.UPDATED)&&(t.uiMakerUtilsFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("API Maker - UI Maker Utility")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{order:1}};t.showAll&&delete a.find.active;const o=yield t.uiMakerUtilsS.query(a).toPromise();o&&(t.selectedRows=[],t.rows=o.data,t.rowsMap=_.keyBy(t.rows,C.iH._id));let s=t.navigationCS.getQueryParam(S.p.am_ui_maker_util);s&&!t.rowsMap[s]&&t.rows.length&&(s=t.rows[0]._id),t.rowsMap[s]?(t.selectedRows=[t.rowsMap[s]],yield t.fillData()):t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),t.loading.grid=!1,t.cd.detectChanges()})()}add(){this.data.formData={},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.uiMakerUtilsFormC.showModal()}edit(){this.data.formData=this.rowsMap[_.map(this.selectedRows,"_id")[0]],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),this.uiMakerUtilsFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){try{if(!t.selectedRows[0]||!t.rowsMap[_.map(t.selectedRows,"_id")[0]])return;const a=t.rowsMap[_.map(t.selectedRows,"_id")[0]]._id,o=(yield t.uiMakerUtilsS.getById(a).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield t.uiMakerUtilsS.post(o).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.uiMakerUtil.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.uiMakerUtil.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.uiMakerUtil.cloneError)}})()}removePermanent(){var t=this;return(0,d.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.uiMakerUtil.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){for(const o of t.selectedRows)yield t.hardDelete(o._id);t.ns.showSuccess(t.cs.uiMakerUtil.removePermanent),yield t.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,d.Z)(function*(){yield a.uiMakerUtilsS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.uiMakerUtils.selectedUtil.next(void 0)}resetThisUrl(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),yield t.navigationCS.setQueryParam(S.p.am_ui_maker_util,null)})()}itemSelected(){var t=this;return(0,d.Z)(function*(){yield t.resetThisUrl(),setTimeout(t.fillData.bind(t))})()}fillData(){var t=this;return(0,d.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(S.p.am_ui_maker_util,""),void t.eventCenterS.uiMakerUtils.selectedUtil.next(null);const a=t.selectedRows[0];a?(yield t.navigationCS.setQueryParam(S.p.am_ui_maker_util,a._id),t.eventCenterS.uiMakerUtils.selectedUtil.next(a)):yield t.resetThisUrl()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickHandler(){this.selectedRows.length&&this.edit()}ENavigationMenu=ae.E;static \u0275fac=function(a){return new(a||i)(e.Y36(pe.L),e.Y36(w.b),e.Y36(Z.W),e.Y36(V.S),e.Y36(P.D),e.Y36(I.L),e.Y36(J.u),e.Y36(N.F0),e.Y36(K.K),e.Y36(R.E),e.Y36(Z.W),e.Y36(I.L),e.Y36(G.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-utils-list"]],viewQuery:function(a,o){if(1&a&&e.Gf(Pt,5),2&a){let s;e.iGM(s=e.CRH())&&(o.uiMakerUtilsFormC=s.first)}},inputs:{showCheckbox:"showCheckbox"},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],[1,"fab","fa-uniregistry","fa-fw","text-white"],["href","javascript:",3,"click"],["tooltipPosition","left","pTooltip","Go back to UI Pages","src","/assets/images/icons/ui-maker.svg",1,"float-right","ml-3","mr-1",2,"height","20px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["uiMakerUtilsFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[2,"width","45px"],[3,"pSelectableRow"],[4,"ngIf"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Common Utils For UI Pages"),e.qZA(),e.TgZ(5,"a",3),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"main"])}),e._UZ(6,"img",4),e.qZA(),e.TgZ(7,"span",5),e.NdJ("click",function(){return o.add()}),e._UZ(8,"i",6),e.qZA(),e.YNc(9,Rt,2,0,"span",7),e.YNc(10,Jt,2,0,"span",8),e.YNc(11,Yt,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(c){return o.selectedRows=c})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClickHandler()}),e.YNc(14,Qt,4,1,"ng-template",12),e.YNc(15,Gt,4,3,"ng-template",13),e.qZA(),e.YNc(16,Bt,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-ui-maker-utils-form",15,16)),2&a&&(e.xp6(9),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.xp6(3),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("data",o.data))},dependencies:[Y.O5,b.iA,G.jx,b.Ei,b.UA,b.Mo,L.G,q.u,_e],encapsulation:2,changeDetection:0})}return i})();const Ht=[{path:"main",component:de,canActivate:[O.P]},{path:"utils",component:(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-ui-maker-utils-list"),e.qZA())},dependencies:[he],encapsulation:2})}return i})(),canActivate:[O.P]},{path:"styles",component:fe,canActivate:[O.P]}];let Vt=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[N.Bz.forChild(Ht),x.u,Ne,Ot,mt]})}return i})()},6925:(Me,B,l)=>{l.d(B,{Eg:()=>_,Yp:()=>O,ZF:()=>u,vT:()=>x});var x=function(n){return n.FORM_DATA="FORM_DATA",n.JSON="JSON",n.TEXT="TEXT",n}(x||{}),O=function(n){return n.GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",n}(O||{}),_=function(n){return n.CONTENT_TYPE="content-type",n.ACCEPT_ENCODING="accept-encoding",n.NO_COMPRESSION_STD="x-no-compression",n.AUTHORIZATION_AM="x-am-authorization",n.AUTHORIZATION_AM_USER="x-am-user-authorization",n.AUTHORIZATION_AWS="x-aws-authorization",n.AUTHORIZATION_GOOGLE="x-google-authorization",n.AUTHORIZATION_AZURE="x-azure-authorization",n.RUN_IN_SANDBOX="x-am-run-in-sandbox",n.ORIGIN="origin",n.AUTHORIZATION="authorization",n.META="x-am-meta",n.SECRET="x-am-secret",n.CONTENT_TYPE_RESPONSE="x-am-content-type-response",n.CACHE_CONTROL="x-am-cache-control",n.CODE_HASH="x-am-code-hash",n.SANDBOX_TIMEOUT="x-am-sandbox-timeout",n.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",n.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",n.RESPONSE_CASE="x-am-response-case",n.RESPONSE_OBJECT_TYPE="x-am-response-object-type",n.AM_I18N="x-am-internationalization",n.DATA_SOURCE="x-am-data-source",n.TEST_HOOK="x-am-test-hook",n.TEST_EVENT="x-am-test-event",n.INTER_COMM="x-am-inter-comm",n.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",n.AM_REQUEST_ID="x-am-request-id",n.AM_STORE_TOKEN="x-am-store-token",n}(_||{}),u=function(n){return n.DB_MASTER_NAME="db-master-name",n.ADMIN_PATH="admin-path",n}(u||{})}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[1097,6925,8374,8682,1617],{1097:(Me,B,l)=>{l.r(B),l.d(B,{DbMastersM:()=>Vt});var N=l(7664),x=l(8761),O=l(3726),d=l(5861),m=l(95),_=l(6990),u=l(3157),p=l(328),U=l(9361),C=l(1162),D=l(553),k=l(5085),n=l(1601),T=l(3531),H=l(9989),e=l(4946),Z=l(9961),w=l(7240),I=l(7414),ie=l(9729),P=l(5852),j=l(2304),se=l(4795),R=l(3429),J=l(2915),V=l(2189),K=l(3835),Y=l(6814),W=l(2660),z=l(5860),X=l(756),L=l(7680),Q=l(4844),q=l(3259),Ce=l(3965),ee=l(5025);const Se=["insertCodeModalC"],be=["monacoEditorModalC"];function Te(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",37),e._uU(2," Add UI Page"),e.qZA())}function ve(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",38),e._uU(2," View UI Page"),e.qZA())}function ye(i,r){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",39),e._uU(2," Edit UI Page "),e.TgZ(3,"span",40),e._uU(4),e.qZA(),e.TgZ(5,"span",40),e._uU(6),e.qZA(),e.TgZ(7,"span",40),e._uU(8),e.qZA(),e.TgZ(9,"span",40),e._uU(10),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(null==t.form.get("instanceName").value?null:t.form.get("instanceName").value.name),e.xp6(2),e.hij("| \xa0",null==t.form.get("databaseName").value?null:t.form.get("databaseName").value.db,""),e.xp6(2),e.hij("| \xa0",null==t.form.get("collectionName").value?null:t.form.get("collectionName").value.name,""),e.xp6(2),e.hij("| \xa0",t.form.get("name").value,"")}}function De(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",41)(1,"app-monaco-editor",42),e.NdJ("editorGenerated",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!1)("editorOptions",t.editorOptionsDBMasters)}}function Ue(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",41)(1,"app-monaco-editor",42),e.NdJ("editorGenerated",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.editorGeneratedJSUtil(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!0)("editorOptions",t.editorOptionsDBMastersJS)}}function ke(i,r){if(1&i&&(e.TgZ(0,"span",43),e._uU(1),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.AsE(" You are allowed to use ",null==t.authS.backendSettings?null:t.authS.backendSettings.dbMastersCountForUI," UI pages, and you are using ",t.totalCreatedMasters," UI Pages. ")}}function Ze(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"a",44),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function we(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function Ie(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",45),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",46),e.YNc(2,we,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function xe(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function Ee(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function Ae(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",45),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",46),e.YNc(2,xe,2,0,"span",4),e.YNc(3,Ee,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid||t.totalCreatedMasters>(null==t.authS.backendSettings?null:t.authS.backendSettings.dbMastersCountForUI)),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Fe(i,r){1&i&&e._UZ(0,"p-progressSpinner",47)}let ne=(()=>{class i{fb;ns;generalS;constantsS;dbMastersS;authCS;monacoS;authS;instanceS;eventCenterS;generalCS;navigationCS;userS;cd;data;totalCreatedMasters;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=u.F;id;BE_HOST_PORT=D.N.BE_HOST_PORT;DOCS_HOST_PORT=D.N.DOCS_HOST_PORT;instances=[];editorDBMaster;editorDBMasterJS;editorOptionsDBMasters={readOnly:!1,language:"typescript",contextmenu:!0};editorOptionsDBMastersJS={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab={};dbIdMap={};colIdMap={};formDataTemp=null;constructor(t,a,o,s,c,f,M,g,h,v,y,E,A,F){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=s,this.dbMastersS=c,this.authCS=f,this.monacoS=M,this.authS=g,this.instanceS=h,this.eventCenterS=v,this.generalCS=y,this.navigationCS=E,this.userS=A,this.cd=F}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){if(o)if(t.form.enable(),o.action===u.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.form.disable(),t.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.resetDependentObjects("INSTANCE"),yield t.loadInstances();const s=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,k.R.DB_MASTERS_JSON).toPromise();t.editorOptionsDBMasters={readOnly:!1},t.generalCS.setValueInEditor(t,"editorDBMaster",s.data);const c=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,k.R.DB_MASTERS_JS_UTILS).toPromise();t.editorOptionsDBMastersJS={readOnly:!1},t.generalCS.setValueInEditor(t,"editorDBMasterJS",c.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var t=this;return(0,d.Z)(function*(){const a=yield t.dbMastersS.getById(t.data.formData._id).toPromise();t.form.reset(),t.resetDependentObjects("INSTANCE"),t.form.patchValue(a.data),t.formDataTemp=a.data,t.generalCS.setValueInEditor(t,"editorDBMaster",a.data?.dbMasterConfigCode||""),t.generalCS.setValueInEditor(t,"editorDBMasterJS",a.data?.pageUtilsCode||""),yield t.loadInstances(),t.formDataTemp=null})()}createForm(){this.form=this.fb.group({name:[null,[m.kI.required,m.kI.minLength(3),m.kI.maxLength(50),m.kI.pattern("[a-zA-Z0-9_-]*$")]],instanceName:[null,[m.kI.required]],databaseName:[null,[m.kI.required]],collectionName:[null,[m.kI.required]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idDBMastersForm").modal("show")},100)}hideModal(){$("#idDBMastersForm").modal("hide")}save(t){var a=this;return(0,d.Z)(function*(){const o=a.form.getRawValue();let M;o.instanceName=o.instanceName.name,o.databaseName=o.databaseName.db,o.collectionName=o.collectionName.name,M=a.data.formData&&a.data.formData._id?(yield a.dbMastersS.getById(a.data.formData._id).toPromise()).data:{};const g=Object.assign({},M,o);g.user=a.authCS.getUserId(),g.dbMasterConfigCode=a.editorDBMaster.getValue(),g.pageUtilsCode=a.editorDBMasterJS.getValue();try{let h;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorDBMaster,a.monacoDecorations),a.monacoS.clearEditorDecorations(a.editorDBMasterJS,a.monacoDecorations),a.data.mode===p.D.ADD?h=yield a.dbMastersS.post(g).toPromise():a.data.mode===p.D.EDIT&&(h=yield a.dbMastersS.put(g._id,g,{select:C.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.dbMaster.addSuccess:a.constantsS.dbMaster.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?u.F.SAVED:u.F.UPDATED,data:h}),a.loading.form=!1}catch(h){a.loading.form=!1,a.ns.showErrorFromResponse(h.error||h,"Unable to save database master."),a.lastError=h.error,a.tab=a.tab||{},a.tab.axiosResponse={data:h.error},a.monacoS.highlightErrorInMonacoEditor(a.editorDBMaster,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=U.H.All,this.insertCodeModalC.showModal(T.b.CodeFinderResultC)}editorGenerated(t){var a=this;return(0,d.Z)(function*(){a.editorDBMaster=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=U.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.DBMastersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===H.g.TEXT_COPIED&&o.componentName===T.b.DBMastersFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}editorGeneratedJSUtil(t){var a=this;return(0,d.Z)(function*(){a.editorDBMasterJS=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=U.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.DBMastersFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===H.g.TEXT_COPIED&&o.componentName===T.b.DBMastersFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),n.d.json)}loadInstances(){var t=this;return(0,d.Z)(function*(){t.resetDependentObjects("INSTANCE"),t.loading.form=!0;try{const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{name:1}};t.tab.allInstances=(yield t.instanceS.query(a).toPromise()).data||[]}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allInstances=[]}if(t.formDataTemp){const a=t.form.controls.instanceName;t.tab.instance=_.find(t.tab.allInstances,{name:t.formDataTemp.instanceName}),t.tab.instance&&a.setValue(t.tab.instance)}else t.tab.instance=t.tab.allInstances[0];yield t.loadDatabases(),t.loading.form=!1,t.cd.detectChanges()})()}loadDatabases(){var t=this;return(0,d.Z)(function*(){if(t.loading.form=!0,t.resetDependentObjects("DATABASE"),!t.tab.instance)return t.tab.allDatabases=[],void(t.tab.allCollections=[]);try{t.tab.allDatabases=((yield t.instanceS.getDatabases([t.tab.instance]).toPromise()).data||[])[0]||[],t.dbIdMap=_.keyBy(t.tab.allDatabases,C.N7.db)}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allDatabases=[]}if(t.formDataTemp){const a=t.form.get("databaseName");t.tab.database=_.find(t.tab.allDatabases,{db:t.formDataTemp.databaseName}),t.tab.database&&a.patchValue(t.tab.database)}else t.tab.database=t.tab.allDatabases[0];yield t.loadCollections(),t.loading.form=!1})()}loadCollections(){var t=this;return(0,d.Z)(function*(){if(t.loading.form=!0,t.resetDependentObjects("COLLECTION"),t.tab.instance&&t.tab.database){try{t.tab.allCollections=((yield t.instanceS.getCollections([t.tab.database]).toPromise()).data||[])[0]||[],t.colIdMap=_.keyBy(t.tab.allCollections,C.GR.name)}catch(a){t.ns.showErrorMessageFromErrorObject(a),t.tab.allCollections=[]}if(t.formDataTemp){const a=t.form.get("collectionName");t.tab.collection=_.find(t.tab.allCollections,{name:t.formDataTemp.collectionName}),t.tab.collection&&a.patchValue(t.tab.collection)}else t.tab.collection=t.tab.allCollections[0];t.loading.form=!1,t.cd.detectChanges()}else t.tab.allCollections=[]})()}resetDependentObjects(t){"INSTANCE"===t?(this.tab.allInstances=this.tab.allDatabases=this.tab.allCollections=[],this.tab.instance=this.tab.database=this.tab.collection=this.tab.api=void 0):"DATABASE"===t?(this.tab.allDatabases=this.tab.allCollections=[],this.tab.database=this.tab.collection=this.tab.api=void 0):"COLLECTION"===t&&(this.tab.allCollections=[],this.tab.collection=this.tab.api=void 0)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(a){return new(a||i)(e.Y36(m.qu),e.Y36(Z.W),e.Y36(w.b),e.Y36(I.L),e.Y36(ie.z),e.Y36(P.D),e.Y36(j.b),e.Y36(se.e),e.Y36(R.E),e.Y36(J.u),e.Y36(w.b),e.Y36(V.S),e.Y36(K.K),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(Se,5),e.Gf(be,5)),2&a){let s;e.iGM(s=e.CRH())&&(o.insertCodeModalC=s.first),e.iGM(s=e.CRH())&&(o.viewDockerfileModelC=s.first)}},inputs:{data:"data",totalCreatedMasters:"totalCreatedMasters"},decls:56,vars:23,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idDBMastersForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],["href","https://docs.apimaker.dev/v1/extensions/ui_maker/introduction.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n2",2,"font-size","25px"],[1,"modal-body","overflow-auto"],["header","Basic Info"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],["optionLabel","name","filterBy","name","appendTo","body","formControlName","instanceName","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["formControlName","databaseName","optionLabel","db","filterBy","db","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["formControlName","collectionName","optionLabel","name","filterBy","name","appendTo","body","styleClass","w-100 p-input-filled",3,"options","filter","onChange"],["header","Config"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],["header","Utility Functions (Main)"],[1,"modal-footer"],["class","mr-3 small text-danger",4,"ngIf"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","editorGenerated"],[1,"mr-3","small","text-danger"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,Te,3,0,"span",4),e.YNc(5,ve,3,0,"span",4),e.YNc(6,ye,11,4,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA(),e.TgZ(13,"a",11),e._UZ(14,"img",12),e.qZA()()(),e.TgZ(15,"div",13)(16,"p-tabView")(17,"p-tabPanel",14)(18,"form",15)(19,"div",16)(20,"label",17),e._uU(21,"Name"),e.qZA(),e.TgZ(22,"div",18),e._UZ(23,"input",19),e.qZA()(),e.TgZ(24,"div",16)(25,"label",17),e._uU(26,"Instance"),e.qZA(),e.TgZ(27,"div",18)(28,"p-dropdown",20),e.NdJ("onChange",function(c){return o.tab.instance=c.value,o.loadDatabases()}),e.qZA()()(),e.TgZ(29,"div",16)(30,"label",17),e._uU(31,"Database"),e.qZA(),e.TgZ(32,"div",18)(33,"p-dropdown",21),e.NdJ("onChange",function(c){return o.tab.database=c.value,o.loadCollections()}),e.qZA()()(),e.TgZ(34,"div",16)(35,"label",17),e._uU(36,"Collection"),e.qZA(),e.TgZ(37,"div",18)(38,"p-dropdown",22),e.NdJ("onChange",function(c){return o.tab.collection=c.value}),e.qZA()()()()(),e.TgZ(39,"p-tabPanel",23),e.YNc(40,De,2,3,"div",24),e.qZA(),e.TgZ(41,"p-tabPanel",25),e.YNc(42,Ue,2,3,"div",24),e.qZA()()(),e.TgZ(43,"div",26),e.YNc(44,ke,2,2,"span",27),e.YNc(45,Ze,2,0,"a",28),e.TgZ(46,"button",29),e.NdJ("click",function(){return o.hideModal()}),e._UZ(47,"i",30),e._uU(48," Close"),e.qZA(),e.YNc(49,Ie,3,2,"button",31),e.YNc(50,Ae,4,3,"button",31),e.qZA(),e.YNc(51,Fe,1,0,"p-progressSpinner",32),e.qZA()()(),e._UZ(52,"app-insert-code-modal",33,34)(54,"app-monaco-editor-modal",35,36)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(12),e.Q6J("formGroup",o.form),e.xp6(10),e.Q6J("options",o.tab.allInstances)("filter",!0),e.xp6(5),e.Q6J("options",o.tab.allDatabases)("filter",!0),e.xp6(5),e.Q6J("options",o.tab.allCollections)("filter",!0),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.totalCreatedMasters>(null==o.authS.backendSettings?null:o.authS.backendSettings.dbMastersCountForUI)),e.xp6(1),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalDBMaster")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[m._Y,m.Fj,m.JJ,m.JL,m.sg,m.u,Y.O5,W.y,z.P,X.O,L.G,Q.xf,Q.x4,q.u,Ce.Lt,ee.A],encapsulation:2,changeDetection:0})}return i})();var te=l(4950);let Ne=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[x.u,te.A]})}return i})();var S=l(6212),re=l(6925),Oe=l(9394),ae=l(2466),oe=l(921),Pe=l(5561),G=l(5219),Re=l(7797),b=l(5431);const Je=["DBMastersFormC"],Ye=["cloneApiModalC"];function Le(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",24),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",25),e.qZA()}}function Qe(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",26),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",27),e.qZA()}}function qe(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",28),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",29),e.qZA()}}function Ge(i,r){1&i&&(e.TgZ(0,"th",31),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function Be(i,r){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,Ge,2,0,"th",30),e.TgZ(2,"th",31),e._uU(3,"*"),e.qZA(),e.TgZ(4,"th",32),e._uU(5,"Name"),e.qZA(),e.TgZ(6,"th"),e._uU(7,"Instance \u2192 Database \u2192 Collection"),e.qZA(),e.TgZ(8,"th"),e._uU(9,"Required Auth Headers"),e.qZA(),e._UZ(10,"th",33),e.qZA()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function He(i,r){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",39),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function Ve(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"tr",34),e.YNc(1,He,2,2,"td",35),e.TgZ(2,"td"),e._uU(3),e.qZA(),e.TgZ(4,"td"),e._uU(5),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA(),e.TgZ(8,"td"),e._uU(9),e.qZA(),e.TgZ(10,"td")(11,"div",36)(12,"button",37),e.NdJ("click",function(){const s=e.CHM(t).$implicit,c=e.oxw();return e.KtG(c.openMasterPageInNewTab(s))}),e._UZ(13,"i",38),e.qZA()()()()}if(2&i){const t=r.$implicit,a=r.rowIndex,o=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",o.showCheckbox),e.xp6(2),e.Oqu(a+1),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.lnq("",t.instanceName," \u2192 ",t.databaseName," \u2192 ",t.collectionName,""),e.xp6(2),e.Oqu(t.authHeadersGrid)}}function Ke(i,r){1&i&&e._UZ(0,"p-progressSpinner",40)}let le=(()=>{class i{dbMastersS;generalS;notificationS;navigationCS;navigationS;authCS;authS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};EUserType=oe.dN;gridKey=C.iH._id;EAPICategory=k.R;ENavigationMenu=ae.E;BE_HOST_PORT=D.N.BE_HOST_PORT;selectedRows=[];dbMastersFormC;cloneApiModalC;constructor(t,a,o,s,c,f,M,g,h,v,y,E,A,F,Kt,jt){this.dbMastersS=t,this.generalS=a,this.notificationS=o,this.navigationCS=s,this.navigationS=c,this.authCS=f,this.authS=M,this.constantsS=g,this.eventCenterS=h,this.router=v,this.userS=y,this.instanceS=E,this.ns=A,this.cs=F,this.confirmationService=Kt,this.cd=jt}ngOnInit(){var t=this;return(0,d.Z)(function*(){if(!t.authS.backendSettings.extensions)return t.navigationS.gotoDashboard();t.eventCenterS.dbMasters.selectedDBMaster.next(void 0),yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){(o.action===u.F.SAVED||o.action===u.F.UPDATED)&&(t.dbMastersFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("UI Maker")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const a=yield t.dbMastersS.getDBMastersGrid({}).toPromise();if(a){t.selectedRows=[],t.rows=a.data,t.rowsMap=_.keyBy(t.rows,C.iH._id);for(const s of t.rows){const c=[];for(const f of s.authHeaders||[])c.push(f.name);s.authHeadersGrid=c.join(", ")}}let o=t.navigationCS.getQueryParam(S.p.am_db_master);o&&!t.rowsMap[o]&&t.rows.length&&(o=t.rows[0]._id),t.rowsMap[o]?yield t.fillData():t.eventCenterS.dbMasters.selectedDBMaster.next(void 0),t.loading.grid=!1,t.cd.detectChanges()})()}add(){this.data.formData={order:(_.max(_.map(this.rows,"order"))||0)+1},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.dbMastersFormC.showModal()}edit(){this.data.formData=this.rowsMap[_.map(this.selectedRows,"_id")[0]],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),this.dbMastersFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){yield t.cloneApiModalC.showModal(t.getSelectedRowId(),function(){var a=(0,d.Z)(function*(o){o&&(yield t.loadGridData()),t.cd.detectChanges()});return function(o){return a.apply(this,arguments)}}())})()}getSelectedRowId(){return this.selectedRows[0]?._id}removePermanent(){var t=this;return(0,d.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.dbMaster.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){for(const o of t.selectedRows)yield t.hardDelete(o._id);t.ns.showSuccess(t.cs.dbMaster.removePermanent),yield t.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,d.Z)(function*(){yield a.dbMastersS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.dbMasters.selectedDBMaster.next(void 0)}resetThisUrl(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.dbMasters.selectedDBMaster.next(void 0),yield t.navigationCS.setQueryParam(S.p.am_db_master,null)})()}itemSelected(){var t=this;return(0,d.Z)(function*(){yield t.resetThisUrl(),setTimeout(t.fillData.bind(t))})()}fillData(){var t=this;return(0,d.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(S.p.am_db_master,""),void t.eventCenterS.dbMasters.selectedDBMaster.next(null);const a=t.selectedRows[0];a?(yield t.navigationCS.setQueryParam(S.p.am_db_master,a._id),t.eventCenterS.dbMasters.selectedDBMaster.next(a)):yield t.resetThisUrl()})()}dblClick(){this.selectedRows.length&&this.edit()}openMasterPageInNewTab(t){const a=this.authCS.getUserPath();let o=[D.N.BE_HOST_PORT,"/dist-db-masters/browser/",`?${re.ZF.ADMIN_PATH}=${a}&`].join("");const s=[`${re.ZF.DB_MASTER_NAME}=${t.name}`];for(const c of t.authHeaders)s.push(`${c.name}=____actual_header_value____`);o+=s.join("&"),window.open(o,"_blank")}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}EModelApiPaths=Oe.k4;static \u0275fac=function(a){return new(a||i)(e.Y36(ie.z),e.Y36(w.b),e.Y36(Z.W),e.Y36(V.S),e.Y36(Pe.X),e.Y36(P.D),e.Y36(se.e),e.Y36(I.L),e.Y36(J.u),e.Y36(N.F0),e.Y36(K.K),e.Y36(R.E),e.Y36(Z.W),e.Y36(I.L),e.Y36(G.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-list"]],viewQuery:function(a,o){if(1&a&&(e.Gf(Je,5),e.Gf(Ye,5)),2&a){let s;e.iGM(s=e.CRH())&&(o.dbMastersFormC=s.first),e.iGM(s=e.CRH())&&(o.cloneApiModalC=s.first)}},inputs:{showCheckbox:"showCheckbox"},decls:31,vars:20,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],["src","/assets/images/icons/ui-maker.svg","alt","Database master image",1,"fa-fw","mr-1"],[1,"small","ml-3"],["href","https://docs.apimaker.dev/v1/extensions/ui_maker/introduction.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"float-right","fa-fw","ml-3","mr-1",2,"font-size","25px"],["tooltipPosition","left","pTooltip","Styles For UI Pages",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fab","fa-css3","text-info","fa-fw"],["tooltipPosition","left","pTooltip","Common Utilities For UI Pages",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fab","fa-uniregistry","text-info","fa-fw"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"totalCreatedMasters","data"],["DBMastersFormC",""],[3,"modalId","hostAndPort","modelApiPaths"],["cloneApiModalC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[2,"width","45px"],[2,"width","25%"],[2,"width","70px"],[3,"pSelectableRow"],[4,"ngIf"],[1,"text-center"],["tooltipPosition","left","pTooltip","Open master page",1,"btn","btn-xsm-custom",3,"click"],[1,"fas","fa-external-link-alt","text-info","fa-fw"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span")(3,"span"),e._UZ(4,"img",2),e._uU(5," UI Pages"),e.qZA(),e.TgZ(6,"span",3),e._uU(7,"Using "),e.TgZ(8,"span"),e._uU(9),e.qZA(),e._uU(10),e.qZA()(),e.TgZ(11,"a",4),e._UZ(12,"img",5),e.qZA(),e.TgZ(13,"span",6),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"styles"])}),e._UZ(14,"i",7),e.qZA(),e.TgZ(15,"span",8),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"utils"])}),e._UZ(16,"i",9),e.qZA(),e.TgZ(17,"span",10),e.NdJ("click",function(){return o.add()}),e._UZ(18,"i",11),e.qZA(),e.YNc(19,Le,2,0,"span",12),e.YNc(20,Qe,2,0,"span",13),e.YNc(21,qe,2,0,"span",14),e.qZA(),e.TgZ(22,"div",15)(23,"p-table",16),e.NdJ("selectionChange",function(c){return o.selectedRows=c})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClick()}),e.YNc(24,Be,11,1,"ng-template",17),e.YNc(25,Ve,14,8,"ng-template",18),e.qZA(),e.YNc(26,Ke,1,0,"p-progressSpinner",19),e.qZA()(),e._UZ(27,"app-db-masters-form",20,21)(29,"app-clone-api-modal",22,23)),2&a&&(e.xp6(8),e.Tol((null==o.rows?null:o.rows.length)>(null==o.authS.backendSettings?null:o.authS.backendSettings.dbMastersCountForUI)?"text-danger":""),e.xp6(1),e.hij(" ",o.rows.length,""),e.xp6(1),e.hij("/",o.authS.backendSettings.dbMastersCountForUI," "),e.xp6(9),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",1===o.selectedRows.length),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.xp6(3),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("totalCreatedMasters",null==o.rows?null:o.rows.length)("data",o.data),e.xp6(2),e.Q6J("modalId","idCloneDBMasters")("hostAndPort",o.BE_HOST_PORT)("modelApiPaths",o.EModelApiPaths.DB_MASTERS))},dependencies:[Y.O5,Re.s,b.iA,G.jx,b.Ei,b.UA,b.Mo,L.G,q.u,ne],encapsulation:2,changeDetection:0})}return i})(),de=(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-db-masters-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-db-masters-list"),e.qZA())},dependencies:[le],encapsulation:2})}return i})();var ce=l(9836),je=l(8057);const We=["insertCodeModalC"],ze=["monacoEditorModalC"];function Xe(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Add Styles"),e.qZA())}function $e(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," View Styles"),e.qZA())}function et(i,r){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Edit Styles "),e.TgZ(3,"span",28),e._uU(4),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(t.form.get("name").value)}}function tt(i,r){1&i&&(e.TgZ(0,"div",30)(1,"label",31),e._uU(2,"Order No"),e.qZA(),e.TgZ(3,"div",32),e._UZ(4,"input",37),e.qZA()())}function at(i,r){if(1&i&&(e.TgZ(0,"div")(1,"form",29)(2,"div",30)(3,"label",31),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",32),e._UZ(6,"input",33),e.qZA()(),e.TgZ(7,"div",30),e._UZ(8,"label",31),e.TgZ(9,"div",32)(10,"label",34),e._UZ(11,"p-checkbox",35),e.qZA()()(),e.YNc(12,tt,5,0,"div",36),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("formGroup",t.form),e.xp6(10),e.Q6J("binary",!0),e.xp6(1),e.Q6J("ngIf",t.form.getRawValue().loadInAllPages)}}function ot(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",38)(1,"app-monaco-editor",39),e.NdJ("editorGenerated",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!1)("isUIMakerEditor",!0)("editorOptions",t.editorOptions)}}function it(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"a",40),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function st(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function nt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",41),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",42),e.YNc(2,st,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function rt(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function lt(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function dt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",41),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",42),e.YNc(2,rt,2,0,"span",4),e.YNc(3,lt,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function ct(i,r){1&i&&e._UZ(0,"p-progressSpinner",43)}let me=(()=>{class i{fb;ns;generalS;constantsS;uiMakerStylesS;authCS;monacoS;instanceS;eventCenterS;generalCS;cd;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=u.F;id;BE_HOST_PORT=D.N.BE_HOST_PORT;DOCS_HOST_PORT=D.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptions={readOnly:!1,language:"css",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"typescript",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(t,a,o,s,c,f,M,g,h,v,y){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=s,this.uiMakerStylesS=c,this.authCS=f,this.monacoS=M,this.instanceS=g,this.eventCenterS=h,this.generalCS=v,this.cd=y}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){if(o)if(t.form.enable(),o.action===u.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.form.patchValue(o.data||{});const s=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,k.R.UI_MAKER_STYLES).toPromise();t.editorOptions={readOnly:!1},t.generalCS.setValueInEditor(t,"editorPI",s.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var t=this;return(0,d.Z)(function*(){const a=yield t.uiMakerStylesS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.generalCS.setValueInEditor(t,"editorPI",a.data?.styleCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[m.kI.required]],loadInAllPages:[!1,[]],orderNumber:[!1,[m.kI.min(1)]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idUIMakerStylesForm").modal("show")},100)}hideModal(){$("#idUIMakerStylesForm").modal("hide")}save(t){var a=this;return(0,d.Z)(function*(){const o=a.form.getRawValue();let s;s=a.data.formData&&a.data.formData._id?(yield a.uiMakerStylesS.getById(a.data.formData._id).toPromise()).data:{};const c=Object.assign({},s,o);c.user=a.authCS.getUserId(),c.styleCode=a.editorPI.getValue();try{let f;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorPI,a.monacoDecorations),a.data.mode===p.D.ADD?f=yield a.uiMakerStylesS.post(c).toPromise():a.data.mode===p.D.EDIT&&(f=yield a.uiMakerStylesS.put(c._id,c,{select:C.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.uiMakerStyle.addSuccess:a.constantsS.uiMakerStyle.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?u.F.SAVED:u.F.UPDATED,data:f}),a.eventCenterS.uiMakerStylesSavedAndUpdate.next(!0),a.loading.form=!1}catch(f){a.loading.form=!1,a.ns.showErrorFromResponse(f.error||f,"Unable to save styles."),a.lastError=f.error,a.tab=a.tab||{},a.tab.axiosResponse={data:f.error},a.monacoS.highlightErrorInMonacoEditor(a.editorPI,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=U.H.All,this.insertCodeModalC.showModal(T.b.UiMakerStylesFormC).then()}editorGenerated(t){var a=this;return(0,d.Z)(function*(){a.editorPI=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=U.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.UiMakerStylesFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===H.g.TEXT_COPIED&&o.componentName===T.b.UiMakerStylesFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),n.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.uiMakerStylesSavedAndUpdate.next(!1)}ISchedulerProps=C.qH;static \u0275fac=function(a){return new(a||i)(e.Y36(m.qu),e.Y36(Z.W),e.Y36(w.b),e.Y36(I.L),e.Y36(ce.q),e.Y36(P.D),e.Y36(j.b),e.Y36(R.E),e.Y36(J.u),e.Y36(w.b),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(We,5),e.Gf(ze,5)),2&a){let s;e.iGM(s=e.CRH())&&(o.insertCodeModalC=s.first),e.iGM(s=e.CRH())&&(o.viewDockerfileModelC=s.first)}},inputs:{data:"data"},decls:31,vars:15,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idUIMakerStylesForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body","overflow-auto"],["header","Basic Info"],["header","Code"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"align-middle","mb-0","pt-1"],["formControlName","loadInAllPages","pTooltip","If true, these styles will be applied to all UI Pages.","label","Load Styles In All Pages",3,"binary"],["class","form-group row",4,"ngIf"],["formControlName","orderNumber","name","orderNumber","spellcheck","false","type","number","placeholder","Order number in which these styles will be loaded in page",1,"form-control","form-control-sm"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,Xe,3,0,"span",4),e.YNc(5,$e,3,0,"span",4),e.YNc(6,et,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"p-tabView")(15,"p-tabPanel",12),e.YNc(16,at,13,3,"div",4),e.qZA(),e.TgZ(17,"p-tabPanel",13),e.YNc(18,ot,2,3,"div",14),e.qZA()()(),e.TgZ(19,"div",15),e.YNc(20,it,2,0,"a",16),e.TgZ(21,"button",17),e.NdJ("click",function(){return o.hideModal()}),e._UZ(22,"i",18),e._uU(23," Close"),e.qZA(),e.YNc(24,nt,3,2,"button",19),e.YNc(25,dt,4,3,"button",19),e.qZA(),e.YNc(26,ct,1,0,"p-progressSpinner",20),e.qZA()()(),e._UZ(27,"app-insert-code-modal",21,22)(29,"app-monaco-editor-modal",23,24)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(10),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysUIMakerStyles")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[m._Y,m.Fj,m.wV,m.JJ,m.JL,m.sg,m.u,Y.O5,W.y,z.P,X.O,L.G,Q.xf,Q.x4,q.u,je.XZ,ee.A],encapsulation:2,changeDetection:0})}return i})(),mt=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[x.u,te.A]})}return i})();const ut=["uiMakerStylesFormC"];function ft(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",18),e.qZA()}}function pt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",20),e.qZA()}}function _t(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",22),e.qZA()}}function ht(i,r){1&i&&(e.TgZ(0,"th",26),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function gt(i,r){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,ht,2,0,"th",23),e.TgZ(2,"th",24),e._uU(3,"Order"),e.qZA(),e.TgZ(4,"th",25),e._uU(5,"Load in all pages"),e.qZA(),e.TgZ(6,"th"),e._uU(7,"Name"),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function Mt(i,r){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",30),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function Ct(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Yes"),e.qZA())}function St(i,r){if(1&i&&(e.TgZ(0,"tr",27),e.YNc(1,Mt,2,2,"td",28),e.TgZ(2,"td",29),e._uU(3),e.qZA(),e.TgZ(4,"td",29),e.YNc(5,Ct,2,0,"span",28),e.qZA(),e.TgZ(6,"td"),e._uU(7),e.qZA()()),2&i){const t=r.$implicit,a=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(2),e.Oqu(t.orderNumber||""),e.xp6(2),e.Q6J("ngIf",t.loadInAllPages),e.xp6(2),e.Oqu(t.name)}}function bt(i,r){1&i&&e._UZ(0,"p-progressSpinner",31)}let ue=(()=>{class i{uiMakerStylesS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;EUserType=oe.dN;gridKey=C.iH._id;EAPICategory=k.R;selectedRows=[];uiMakerStylesFormC;constructor(t,a,o,s,c,f,M,g,h,v,y,E,A,F){this.uiMakerStylesS=t,this.generalS=a,this.notificationS=o,this.navigationCS=s,this.authCS=c,this.constantsS=f,this.eventCenterS=M,this.router=g,this.userS=h,this.instanceS=v,this.ns=y,this.cs=E,this.confirmationService=A,this.cd=F}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){(o.action===u.F.SAVED||o.action===u.F.UPDATED)&&(t.uiMakerStylesFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("API Maker - UI Maker Styles")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,loadInAllPages:1,orderNumber:1,user:1},sort:{orderNumber:1,name:1}};t.showAll&&delete a.find.active;const o=yield t.uiMakerStylesS.query(a).toPromise();o&&(t.selectedRows=[],t.rows=o.data,t.rowsMap=_.keyBy(t.rows,C.iH._id));let s=t.navigationCS.getQueryParam(S.p.am_ui_maker_style);s&&!t.rowsMap[s]&&t.rows.length&&(s=t.rows[0]._id),t.rowsMap[s]?(t.selectedRows=[t.rowsMap[s]],yield t.fillData()):t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),t.loading.grid=!1,t.cd.detectChanges()})()}add(){this.data.formData={},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.uiMakerStylesFormC.showModal()}edit(){this.data.formData=this.rowsMap[_.map(this.selectedRows,"_id")[0]],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),this.uiMakerStylesFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){try{if(!t.selectedRows[0]||!t.rowsMap[_.map(t.selectedRows,"_id")[0]])return;const a=t.rowsMap[_.map(t.selectedRows,"_id")[0]]._id,o=(yield t.uiMakerStylesS.getById(a).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield t.uiMakerStylesS.post(o).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.uiMakerStyle.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.uiMakerStyle.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.uiMakerStyle.cloneError)}})()}removePermanent(){var t=this;return(0,d.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.uiMakerStyle.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){for(const o of t.selectedRows)yield t.hardDelete(o._id);t.ns.showSuccess(t.cs.uiMakerStyle.removePermanent),yield t.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,d.Z)(function*(){yield a.uiMakerStylesS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.uiMakerStyles.selectedStyle.next(void 0)}resetThisUrl(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerStyles.selectedStyle.next(void 0),yield t.navigationCS.setQueryParam(S.p.am_ui_maker_style,null)})()}itemSelected(){var t=this;return(0,d.Z)(function*(){yield t.resetThisUrl(),setTimeout(t.fillData.bind(t))})()}fillData(){var t=this;return(0,d.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(S.p.am_ui_maker_style,""),void t.eventCenterS.uiMakerStyles.selectedStyle.next(null);const a=t.selectedRows[0];a?(yield t.navigationCS.setQueryParam(S.p.am_ui_maker_style,a._id),t.eventCenterS.uiMakerStyles.selectedStyle.next(a)):yield t.resetThisUrl()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickHandler(){this.selectedRows.length&&this.edit()}ENavigationMenu=ae.E;static \u0275fac=function(a){return new(a||i)(e.Y36(ce.q),e.Y36(w.b),e.Y36(Z.W),e.Y36(V.S),e.Y36(P.D),e.Y36(I.L),e.Y36(J.u),e.Y36(N.F0),e.Y36(K.K),e.Y36(R.E),e.Y36(Z.W),e.Y36(I.L),e.Y36(G.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-list"]],viewQuery:function(a,o){if(1&a&&e.Gf(ut,5),2&a){let s;e.iGM(s=e.CRH())&&(o.uiMakerStylesFormC=s.first)}},inputs:{showCheckbox:"showCheckbox"},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],[1,"fab","fa-css3","fa-fw","text-white"],["href","javascript:",3,"click"],["tooltipPosition","left","pTooltip","Go back to UI Pages","src","/assets/images/icons/ui-maker.svg",1,"float-right","ml-3","mr-1",2,"height","20px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["uiMakerStylesFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[1,"text-center",2,"width","40px"],[1,"text-center",2,"width","150px"],[2,"width","45px"],[3,"pSelectableRow"],[4,"ngIf"],[1,"text-center"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Styles For UI Pages"),e.qZA(),e.TgZ(5,"a",3),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"main"])}),e._UZ(6,"img",4),e.qZA(),e.TgZ(7,"span",5),e.NdJ("click",function(){return o.add()}),e._UZ(8,"i",6),e.qZA(),e.YNc(9,ft,2,0,"span",7),e.YNc(10,pt,2,0,"span",8),e.YNc(11,_t,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(c){return o.selectedRows=c})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClickHandler()}),e.YNc(14,gt,8,1,"ng-template",12),e.YNc(15,St,8,5,"ng-template",13),e.qZA(),e.YNc(16,bt,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-ui-maker-styles-form",15,16)),2&a&&(e.xp6(9),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.xp6(3),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("data",o.data))},dependencies:[Y.O5,b.iA,G.jx,b.Ei,b.UA,b.Mo,L.G,q.u,me],encapsulation:2,changeDetection:0})}return i})(),fe=(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-ui-maker-styles-list"),e.qZA())},dependencies:[ue],encapsulation:2})}return i})();var pe=l(6125);const Tt=["insertCodeModalC"],vt=["monacoEditorModalC"];function yt(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Add Utility"),e.qZA())}function Dt(i,r){1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",26),e._uU(2," View Utility"),e.qZA())}function Ut(i,r){if(1&i&&(e.TgZ(0,"span"),e._UZ(1,"i",27),e._uU(2," Edit Utility "),e.TgZ(3,"span",28),e._uU(4),e.qZA()()),2&i){const t=e.oxw();e.xp6(4),e.Oqu(t.form.get("name").value)}}function kt(i,r){if(1&i&&(e.TgZ(0,"div")(1,"form",29)(2,"div",30)(3,"label",31),e._uU(4,"Name"),e.qZA(),e.TgZ(5,"div",32),e._UZ(6,"input",33),e.qZA()()()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("formGroup",t.form)}}function Zt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"div",34)(1,"app-monaco-editor",35),e.NdJ("editorGenerated",function(o){e.CHM(t);const s=e.oxw();return e.KtG(s.editorGenerated(o))}),e.qZA()()}if(2&i){const t=e.oxw();e.xp6(1),e.Q6J("isSchemaEditor",!0)("isUIMakerEditor",!0)("editorOptions",t.editorOptions)}}function wt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"a",36),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.viewError())}),e._uU(1,"View error"),e.qZA()}}function It(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update"),e.qZA())}function xt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!1))}),e._UZ(1,"i",38),e.YNc(2,It,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Et(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Save"),e.qZA())}function At(i,r){1&i&&(e.TgZ(0,"span"),e._uU(1,"Update & Close"),e.qZA())}function Ft(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"button",37),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.save(!0))}),e._UZ(1,"i",38),e.YNc(2,Et,2,0,"span",4),e.YNc(3,At,2,0,"span",4),e.qZA()}if(2&i){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function Nt(i,r){1&i&&e._UZ(0,"p-progressSpinner",39)}let _e=(()=>{class i{fb;ns;generalS;constantsS;uiMakerUtilsS;authCS;monacoS;instanceS;eventCenterS;generalCS;cd;data;loading={form:!1};EFormMode=p.D;form;subscriptions=[];formData;IEventData=u.F;id;BE_HOST_PORT=D.N.BE_HOST_PORT;DOCS_HOST_PORT=D.N.DOCS_HOST_PORT;instances=[];editorPI;editorOptions={readOnly:!1,language:"typescript",contextmenu:!0};lastError;editorOptionsMonacoEditorModal={readOnly:!0,language:"json",contextmenu:!0};insertCodeModalC;viewDockerfileModelC;shouldLoadMonacoEditor=!1;monacoDecorations=[];tab;constructor(t,a,o,s,c,f,M,g,h,v,y){this.fb=t,this.ns=a,this.generalS=o,this.constantsS=s,this.uiMakerUtilsS=c,this.authCS=f,this.monacoS=M,this.instanceS=g,this.eventCenterS=h,this.generalCS=v,this.cd=y}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.createForm(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){if(o)if(t.form.enable(),o.action===u.F.OPEN_FORM_IN_EDIT_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_VIEW_MODE)yield t.editViewLoadData(),t.cd.detectChanges();else if(o.action===u.F.OPEN_FORM_IN_ADD_MODE){t.form.reset(),t.form.patchValue(o.data||{});const s=yield t.instanceS.getDefaultContent(t.BE_HOST_PORT,k.R.UI_MAKER_UTILITY_CLASS).toPromise();t.editorOptions={readOnly:!1},t.generalCS.setValueInEditor(t,"editorPI",s.data),t.cd.detectChanges()}});return function(o){return a.apply(this,arguments)}}()))})()}editViewLoadData(){var t=this;return(0,d.Z)(function*(){const a=yield t.uiMakerUtilsS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(a.data),t.generalCS.setValueInEditor(t,"editorPI",a.data?.utilsCode||"")})()}createForm(){this.form=this.fb.group({name:[null,[m.kI.required]]})}showModal(){this.lastError=void 0,this.shouldLoadMonacoEditor=!0,setTimeout(()=>{$("#idUIMakerUtilForm").modal("show")},100)}hideModal(){$("#idUIMakerUtilForm").modal("hide")}save(t){var a=this;return(0,d.Z)(function*(){const o=a.form.getRawValue();let s;s=a.data.formData&&a.data.formData._id?(yield a.uiMakerUtilsS.getById(a.data.formData._id).toPromise()).data:{};const c=Object.assign({},s,o);c.user=a.authCS.getUserId(),c.utilsCode=a.editorPI.getValue();try{let f;a.loading.form=!0,a.lastError=void 0,a.monacoS.clearEditorDecorations(a.editorPI,a.monacoDecorations),a.data.mode===p.D.ADD?f=yield a.uiMakerUtilsS.post(c).toPromise():a.data.mode===p.D.EDIT&&(f=yield a.uiMakerUtilsS.put(c._id,c,{select:C.iH._id}).toPromise()),a.ns.showSuccess(a.data.mode===p.D.ADD?a.constantsS.uiMakerUtil.addSuccess:a.constantsS.uiMakerUtil.editSuccess),t&&a.data.eventChannel.emit({action:a.data.mode===p.D.ADD?u.F.SAVED:u.F.UPDATED,data:f}),a.eventCenterS.uiMakerUtilsSavedAndUpdate.next(!0),a.loading.form=!1}catch(f){a.loading.form=!1,a.ns.showErrorFromResponse(f.error||f,"Unable to save utility."),a.lastError=f.error,a.tab=a.tab||{},a.tab.axiosResponse={data:f.error},a.monacoS.highlightErrorInMonacoEditor(a.editorPI,a.tab,"MainSandbox.ts",a.monacoDecorations)}a.cd.detectChanges()})()}showInsertCodeModel(){this.generalCS.messageReceivedFor=U.H.All,this.insertCodeModalC.showModal(T.b.UiMakerUtilsFormC).then()}editorGenerated(t){var a=this;return(0,d.Z)(function*(){a.editorPI=t,yield a.monacoS.loadSchemaEditorSettings(a.BE_HOST_PORT,a.authCS.getUserId(),null),a.monacoS.addSaveCodeKeyBinding(t,o=>{a.form.valid&&a.save(!1)}),a.monacoS.addInsertCodeKeyBinding(t,o=>{a.generalCS.messageReceivedFor=U.H.All,a.data.mode!==p.D.VIEW&&a.insertCodeModalC.showModal(T.b.UiMakerUtilsFormC)}),a.subscriptions.push(a.generalS.messageReceived.subscribe(o=>{o.type&&o.type===H.g.TEXT_COPIED&&o.componentName===T.b.UiMakerUtilsFormC&&(a.monacoS.insertAtCursor(t,o.selectedText),a.insertCodeModalC.hideModal())}))})()}viewError(){this.viewDockerfileModelC.showModal(this.generalS.stringify(this.lastError),n.d.json)}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions),this.eventCenterS.uiMakerUtilsSavedAndUpdate.next(!1)}static \u0275fac=function(a){return new(a||i)(e.Y36(m.qu),e.Y36(Z.W),e.Y36(w.b),e.Y36(I.L),e.Y36(pe.L),e.Y36(P.D),e.Y36(j.b),e.Y36(R.E),e.Y36(J.u),e.Y36(w.b),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-utils-form"]],viewQuery:function(a,o){if(1&a&&(e.Gf(Tt,5),e.Gf(vt,5)),2&a){let s;e.iGM(s=e.CRH())&&(o.insertCodeModalC=s.first),e.iGM(s=e.CRH())&&(o.viewDockerfileModelC=s.first)}},inputs:{data:"data"},decls:31,vars:15,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idUIMakerUtilForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-full"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],[1,"float-right"],["aria-label","Close","data-dismiss","modal","type","button",1,"close",3,"click"],["aria-hidden","true"],[1,"fas","fa-window-close"],["pTooltip","Insert Code","sava-no-dbl-click","",1,"cursor-pointer","mr-1",2,"font-size","1.4em",3,"click"],[1,"fas","fa-info-circle","text-info","fa-fw"],[1,"modal-body","overflow-auto"],["header","Basic Info"],["header","Code"],["class","overflow-hidden","style","height: calc(100vh - 206px);",4,"ngIf"],[1,"modal-footer"],["href","javascript:;","class","text-danger",3,"click",4,"ngIf"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary",3,"click"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"frameId","modalId","docsHostPort"],["insertCodeModalC",""],[3,"modalId","editorOptionsMonacoEditorModal","modalTitle"],["monacoEditorModalC",""],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],[1,"ml-2","font-weight-normal","small","text-muted"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-3","col-form-label","col-form-label-sm","text-right"],[1,"col-7"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"overflow-hidden",2,"height","calc(100vh - 206px)"],[3,"isSchemaEditor","isUIMakerEditor","editorOptions","editorGenerated"],["href","javascript:;",1,"text-danger",3,"click"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,yt,3,0,"span",4),e.YNc(5,Dt,3,0,"span",4),e.YNc(6,Ut,5,1,"span",4),e.TgZ(7,"div",5)(8,"button",6),e.NdJ("click",function(){return o.hideModal()}),e.TgZ(9,"span",7),e._UZ(10,"i",8),e.qZA()(),e.TgZ(11,"span",9),e.NdJ("click",function(){return o.showInsertCodeModel()}),e._UZ(12,"i",10),e.qZA()()(),e.TgZ(13,"div",11)(14,"p-tabView")(15,"p-tabPanel",12),e.YNc(16,kt,7,1,"div",4),e.qZA(),e.TgZ(17,"p-tabPanel",13),e.YNc(18,Zt,2,3,"div",14),e.qZA()()(),e.TgZ(19,"div",15),e.YNc(20,wt,2,0,"a",16),e.TgZ(21,"button",17),e.NdJ("click",function(){return o.hideModal()}),e._UZ(22,"i",18),e._uU(23," Close"),e.qZA(),e.YNc(24,xt,3,2,"button",19),e.YNc(25,Ft,4,3,"button",19),e.qZA(),e.YNc(26,Nt,1,0,"p-progressSpinner",20),e.qZA()()(),e._UZ(27,"app-insert-code-modal",21,22)(29,"app-monaco-editor-modal",23,24)),2&a&&(e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(10),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.shouldLoadMonacoEditor),e.xp6(2),e.Q6J("ngIf",o.lastError),e.xp6(4),e.Q6J("ngIf",o.data.mode===o.EFormMode.EDIT),e.xp6(1),e.Q6J("ngIf",o.data.mode!==o.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",o.loading.form),e.xp6(1),e.Q6J("frameId","idInsertCodeDbMig")("modalId","idInsertCodeDbMigForm")("docsHostPort",o.DOCS_HOST_PORT),e.xp6(2),e.Q6J("modalId","idMonacoEditorModalInSysUIMakerUtility")("editorOptionsMonacoEditorModal",o.editorOptionsMonacoEditorModal)("modalTitle","Error info"))},dependencies:[m._Y,m.Fj,m.JJ,m.JL,m.sg,m.u,Y.O5,W.y,z.P,X.O,L.G,Q.xf,Q.x4,q.u,ee.A],encapsulation:2,changeDetection:0})}return i})(),Ot=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[x.u,te.A]})}return i})();const Pt=["uiMakerUtilsFormC"];function Rt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",17),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.edit())}),e._UZ(1,"i",18),e.qZA()}}function Jt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",19),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.clone())}),e._UZ(1,"i",20),e.qZA()}}function Yt(i,r){if(1&i){const t=e.EpF();e.TgZ(0,"span",21),e.NdJ("click",function(){e.CHM(t);const o=e.oxw();return e.KtG(o.removePermanent())}),e._UZ(1,"i",22),e.qZA()}}function Lt(i,r){1&i&&(e.TgZ(0,"th",24),e._UZ(1,"p-tableHeaderCheckbox"),e.qZA())}function Qt(i,r){if(1&i&&(e.TgZ(0,"tr"),e.YNc(1,Lt,2,0,"th",23),e.TgZ(2,"th"),e._uU(3,"Name"),e.qZA()()),2&i){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",t.showCheckbox)}}function qt(i,r){if(1&i&&(e.TgZ(0,"td"),e._UZ(1,"p-tableCheckbox",27),e.qZA()),2&i){const t=e.oxw().$implicit;e.xp6(1),e.Q6J("value",t)("pSelectableRow",t)}}function Gt(i,r){if(1&i&&(e.TgZ(0,"tr",25),e.YNc(1,qt,2,2,"td",26),e.TgZ(2,"td"),e._uU(3),e.qZA()()),2&i){const t=r.$implicit,a=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(1),e.Q6J("ngIf",a.showCheckbox),e.xp6(2),e.Oqu(t.name)}}function Bt(i,r){1&i&&e._UZ(0,"p-progressSpinner",28)}let he=(()=>{class i{uiMakerUtilsS;generalS;notificationS;navigationCS;authCS;constantsS;eventCenterS;router;userS;instanceS;ns;cs;confirmationService;cd;showCheckbox=!0;loading={grid:!1};subscriptions=[];data={mode:p.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;EUserType=oe.dN;gridKey=C.iH._id;EAPICategory=k.R;selectedRows=[];uiMakerUtilsFormC;constructor(t,a,o,s,c,f,M,g,h,v,y,E,A,F){this.uiMakerUtilsS=t,this.generalS=a,this.notificationS=o,this.navigationCS=s,this.authCS=c,this.constantsS=f,this.eventCenterS=M,this.router=g,this.userS=h,this.instanceS=v,this.ns=y,this.cs=E,this.confirmationService=A,this.cd=F}ngOnInit(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),yield t.loadGridData(),t.subscriptions.push(t.data.eventChannel.subscribe(function(){var a=(0,d.Z)(function*(o){(o.action===u.F.SAVED||o.action===u.F.UPDATED)&&(t.uiMakerUtilsFormC.hideModal(),yield t.loadGridData())});return function(o){return a.apply(this,arguments)}}())),t.generalS.setNewTitle("API Maker - UI Maker Utility")})()}loadGridData(){var t=this;return(0,d.Z)(function*(){t.loading.grid=!0;const a={find:{user:t.authCS.getUserId(),active:!0},select:{name:1,active:1,user:1},sort:{order:1}};t.showAll&&delete a.find.active;const o=yield t.uiMakerUtilsS.query(a).toPromise();o&&(t.selectedRows=[],t.rows=o.data,t.rowsMap=_.keyBy(t.rows,C.iH._id));let s=t.navigationCS.getQueryParam(S.p.am_ui_maker_util);s&&!t.rowsMap[s]&&t.rows.length&&(s=t.rows[0]._id),t.rowsMap[s]?(t.selectedRows=[t.rowsMap[s]],yield t.fillData()):t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),t.loading.grid=!1,t.cd.detectChanges()})()}add(){this.data.formData={},this.data.mode=p.D.ADD,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_ADD_MODE,data:this.data.formData}),this.uiMakerUtilsFormC.showModal()}edit(){this.data.formData=this.rowsMap[_.map(this.selectedRows,"_id")[0]],this.data.mode=p.D.EDIT,this.data.eventChannel.emit({action:u.F.OPEN_FORM_IN_EDIT_MODE}),this.uiMakerUtilsFormC.showModal()}clone(){var t=this;return(0,d.Z)(function*(){try{if(!t.selectedRows[0]||!t.rowsMap[_.map(t.selectedRows,"_id")[0]])return;const a=t.rowsMap[_.map(t.selectedRows,"_id")[0]]._id,o=(yield t.uiMakerUtilsS.getById(a).toPromise()).data;delete o._id,o.name=`${o.name}-clone`,(yield t.uiMakerUtilsS.post(o).toPromise()).success?(t.notificationS.showSuccess(t.constantsS.uiMakerUtil.cloneSuccess),t.loadGridData()):t.notificationS.showSuccess(t.constantsS.uiMakerUtil.cloneSuccess)}catch{t.notificationS.showError(t.constantsS.uiMakerUtil.cloneError)}})()}removePermanent(){var t=this;return(0,d.Z)(function*(){var a;t.confirmationService.confirm({message:t.cs.uiMakerUtil.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(a=(0,d.Z)(function*(){for(const o of t.selectedRows)yield t.hardDelete(o._id);t.ns.showSuccess(t.cs.uiMakerUtil.removePermanent),yield t.loadGridData()}),function(){return a.apply(this,arguments)})})})()}hardDelete(t){var a=this;return(0,d.Z)(function*(){yield a.uiMakerUtilsS.permanentDelete(t).toPromise()})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.uiMakerUtils.selectedUtil.next(void 0)}resetThisUrl(){var t=this;return(0,d.Z)(function*(){t.eventCenterS.uiMakerUtils.selectedUtil.next(void 0),yield t.navigationCS.setQueryParam(S.p.am_ui_maker_util,null)})()}itemSelected(){var t=this;return(0,d.Z)(function*(){yield t.resetThisUrl(),setTimeout(t.fillData.bind(t))})()}fillData(){var t=this;return(0,d.Z)(function*(){if(!t.selectedRows.length)return yield t.navigationCS.setQueryParam(S.p.am_ui_maker_util,""),void t.eventCenterS.uiMakerUtils.selectedUtil.next(null);const a=t.selectedRows[0];a?(yield t.navigationCS.setQueryParam(S.p.am_ui_maker_util,a._id),t.eventCenterS.uiMakerUtils.selectedUtil.next(a)):yield t.resetThisUrl()})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickHandler(){this.selectedRows.length&&this.edit()}ENavigationMenu=ae.E;static \u0275fac=function(a){return new(a||i)(e.Y36(pe.L),e.Y36(w.b),e.Y36(Z.W),e.Y36(V.S),e.Y36(P.D),e.Y36(I.L),e.Y36(J.u),e.Y36(N.F0),e.Y36(K.K),e.Y36(R.E),e.Y36(Z.W),e.Y36(I.L),e.Y36(G.YP),e.Y36(e.sBO))};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-utils-list"]],viewQuery:function(a,o){if(1&a&&e.Gf(Pt,5),2&a){let s;e.iGM(s=e.CRH())&&(o.uiMakerUtilsFormC=s.first)}},inputs:{showCheckbox:"showCheckbox"},decls:19,vars:11,consts:[[1,"card","shadow-sm","h-100"],["pTooltip","",1,"card-header"],[1,"fab","fa-uniregistry","fa-fw","text-white"],["href","javascript:",3,"click"],["tooltipPosition","left","pTooltip","Go back to UI Pages","src","/assets/images/icons/ui-maker.svg",1,"float-right","ml-3","mr-1",2,"height","20px"],["tooltipPosition","left","pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","tooltipPosition","left","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped","scrollHeight","calc(100vh - 82px)",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["uiMakerUtilsFormC",""],["tooltipPosition","left","pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["tooltipPosition","left","pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["tooltipPosition","left","pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],["style","width: 45px;",4,"ngIf"],[2,"width","45px"],[3,"pSelectableRow"],[4,"ngIf"],[3,"value","pSelectableRow"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"i",2),e._uU(4," Common Utils For UI Pages"),e.qZA(),e.TgZ(5,"a",3),e.NdJ("click",function(){return o.router.navigate([o.ENavigationMenu.DBMasters,"main"])}),e._UZ(6,"img",4),e.qZA(),e.TgZ(7,"span",5),e.NdJ("click",function(){return o.add()}),e._UZ(8,"i",6),e.qZA(),e.YNc(9,Rt,2,0,"span",7),e.YNc(10,Jt,2,0,"span",8),e.YNc(11,Yt,2,0,"span",9),e.qZA(),e.TgZ(12,"div",10)(13,"p-table",11),e.NdJ("selectionChange",function(c){return o.selectedRows=c})("selectionChange",function(){return o.itemSelected()})("dblclick",function(){return o.dblClickHandler()}),e.YNc(14,Qt,4,1,"ng-template",12),e.YNc(15,Gt,4,3,"ng-template",13),e.qZA(),e.YNc(16,Bt,1,0,"p-progressSpinner",14),e.qZA()(),e._UZ(17,"app-ui-maker-utils-form",15,16)),2&a&&(e.xp6(9),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length&&o.selectedRows.length<2),e.xp6(1),e.Q6J("ngIf",o.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",o.selectedRows)("dataKey",o.gridKey)("scrollable",!0)("value",o.rows),e.xp6(3),e.Q6J("ngIf",o.loading.grid),e.xp6(1),e.Q6J("data",o.data))},dependencies:[Y.O5,b.iA,G.jx,b.Ei,b.UA,b.Mo,L.G,q.u,_e],encapsulation:2,changeDetection:0})}return i})();const Ht=[{path:"main",component:de,canActivate:[O.P]},{path:"utils",component:(()=>{class i{constructor(){}ngOnInit(){}static \u0275fac=function(a){return new(a||i)};static \u0275cmp=e.Xpm({type:i,selectors:[["app-ui-maker-styles-layout"]],decls:2,vars:0,consts:[[1,"pt-1","pl-1","pr-1","overflow-auto"]],template:function(a,o){1&a&&(e.TgZ(0,"div",0),e._UZ(1,"app-ui-maker-utils-list"),e.qZA())},dependencies:[he],encapsulation:2})}return i})(),canActivate:[O.P]},{path:"styles",component:fe,canActivate:[O.P]}];let Vt=(()=>{class i{static \u0275fac=function(a){return new(a||i)};static \u0275mod=e.oAB({type:i});static \u0275inj=e.cJS({imports:[N.Bz.forChild(Ht),x.u,Ne,Ot,mt]})}return i})()},6925:(Me,B,l)=>{l.d(B,{Eg:()=>_,Yp:()=>O,ZF:()=>u,vT:()=>x});var x=function(n){return n.FORM_DATA="FORM_DATA",n.JSON="JSON",n.TEXT="TEXT",n}(x||{}),O=function(n){return n.GET="GET",n.POST="POST",n.PUT="PUT",n.DELETE="DELETE",n}(O||{}),_=function(n){return n.CONTENT_TYPE="content-type",n.ACCEPT_ENCODING="accept-encoding",n.NO_COMPRESSION_STD="x-no-compression",n.AUTHORIZATION_AM="x-am-authorization",n.AUTHORIZATION_AM_USER="x-am-user-authorization",n.AUTHORIZATION_AWS="x-aws-authorization",n.AUTHORIZATION_GOOGLE="x-google-authorization",n.AUTHORIZATION_AZURE="x-azure-authorization",n.RUN_IN_SANDBOX="x-am-run-in-sandbox",n.ORIGIN="origin",n.AUTHORIZATION="authorization",n.META="x-am-meta",n.SECRET="x-am-secret",n.CONTENT_TYPE_RESPONSE="x-am-content-type-response",n.CACHE_CONTROL="x-am-cache-control",n.CODE_HASH="x-am-code-hash",n.SANDBOX_TIMEOUT="x-am-sandbox-timeout",n.GET_ENCRYPTED_DATA="x-am-get-encrypted-data",n.ENCRYPTED_PAYLOAD="x-am-encrypted-payload",n.RESPONSE_CASE="x-am-response-case",n.RESPONSE_OBJECT_TYPE="x-am-response-object-type",n.AM_I18N="x-am-internationalization",n.DATA_SOURCE="x-am-data-source",n.TEST_HOOK="x-am-test-hook",n.TEST_EVENT="x-am-test-event",n.INTER_COMM="x-am-inter-comm",n.SEND_ONLY_OBJECTS="x-am-send-only-objects-in-stream",n.AM_REQUEST_ID="x-am-request-id",n.AM_STORE_TOKEN="x-am-store-token",n}(_||{}),u=function(n){return n.DB_MASTER_NAME="db-master-name",n.ADMIN_PATH="admin-path",n}(u||{})}}]);
|
package/dist/148.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[148],{148:(Xe,I,a)=>{a.r(I),a.d(I,{LogProfileM:()=>Je});var M=a(7664),b=a(8176),O=a(3726),F=a(1025),p=a(5861),v=a(5085),R=a(2452),e=a(4946),x=a(2915),Z=a(3429),C=a(7414),S=a(6814),h=a(5219),y=a(7680),U=a(5043),G=a(3885),Y=a(559),J=a(6937),Q=a(356),k=a(9329),q=a(7595),K=a(3824),W=a(8651),V=a(6607),B=a(5305),H=a(2726),c=a(3157),g=a(328),f=a(6212),m=a(6990),d=a(1162),j=a(6925),D=a(7031),w=a(7240),T=a(9961),X=a(2189),L=a(5852),z=a(3065),ee=a(7629),te=a(1042),ne=a(7145),oe=a(2559),se=a(262),_=a(5431),ae=a(3259),u=a(95),re=a(2660),ie=a(8057);function le(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," Add Log Profile"),e.qZA())}function pe(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," View Log Profile"),e.qZA())}function de(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Edit Log Profile"),e.qZA())}function ce(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Save Log Profile"),e.qZA())}function ge(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Update Log Profile"),e.qZA())}function ue(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"button",26),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",27),e.YNc(2,ce,2,0,"span",4),e.YNc(3,ge,2,0,"span",4),e.qZA()}if(2&s){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function me(s,i){1&s&&e._UZ(0,"p-progressSpinner",28)}let E=(()=>{class s{fb;ns;logProfileS;generalS;authCS;constantsS;data;loading={form:!1};EFormMode=g.D;form;subscriptions=[];constructor(t,o,n,r,l,A){this.fb=t,this.ns=o,this.logProfileS=n,this.generalS=r,this.authCS=l,this.constantsS=A}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var o=(0,p.Z)(function*(n){if(n)if(t.form.enable(),n.action===c.F.OPEN_FORM_IN_EDIT_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data)}else if(n.action===c.F.OPEN_FORM_IN_VIEW_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.disable()}else n.action===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.setDefaultValuesInForm())});return function(n){return o.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[u.kI.required]],isDefault:[!0,[]]})}setDefaultValuesInForm(){this.form.patchValue({isDefault:!0})}showModal(){$("#idLogProfileForm").modal("show")}hideModal(){$("#idLogProfileForm").modal("hide")}save(){var t=this;return(0,p.Z)(function*(){const o=t.form.getRawValue();o.user=t.authCS.getUserId();try{let n;t.loading.form=!0,t.data.mode===g.D.ADD?n=yield t.logProfileS.post(o).toPromise():t.data.mode===g.D.EDIT&&(n=yield t.logProfileS.put(t.data.formData._id,o,{select:d.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===g.D.ADD?t.constantsS.logProfile.addSuccess:t.constantsS.logProfile.editSuccess),t.data.eventChannel.emit({action:t.data.mode===g.D.ADD?c.F.SAVED:c.F.UPDATED}),t.loading.form=!1}catch(n){t.loading.form=!1,t.ns.showErrorFromResponse(n.error||n,"Unable to save log profile.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(o){return new(o||s)(e.Y36(u.qu),e.Y36(T.W),e.Y36(D.T),e.Y36(w.b),e.Y36(L.D),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles-form"]],inputs:{data:"data"},decls:31,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idLogProfileForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-8"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"col-4"],[1,"align-middle","mb-0","pt-1"],["formControlName","isDefault","inputId","idIsActive",3,"binary"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,le,3,0,"span",4),e.YNc(5,pe,3,0,"span",4),e.YNc(6,de,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),e._uU(16,"Name"),e.qZA(),e.TgZ(17,"div",11),e._UZ(18,"input",14),e.qZA()()(),e.TgZ(19,"div",15)(20,"div",12)(21,"label",13),e._uU(22,"Active"),e.qZA(),e.TgZ(23,"label",16),e._UZ(24,"p-checkbox",17),e.qZA()()()()()(),e.TgZ(25,"div",18)(26,"button",19),e._UZ(27,"i",20),e._uU(28," Close"),e.qZA(),e.YNc(29,ue,4,3,"button",21),e.qZA(),e.YNc(30,me,1,0,"p-progressSpinner",22),e.qZA()()()),2&o&&(e.xp6(4),e.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",n.form),e.xp6(13),e.Q6J("binary",!0),e.xp6(5),e.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.loading.form))},dependencies:[u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,S.O5,re.y,y.G,ie.XZ],encapsulation:2})}return s})();const fe=["logProfilesFormC"];function ve(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",18),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.edit())}),e._UZ(1,"i",19),e.qZA()}}function Ce(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",20),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.clone())}),e._UZ(1,"i",21),e.qZA()}}function Se(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.removePermanentDialog())}),e._UZ(1,"i",23),e.qZA()}}function he(s,i){1&s&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e._UZ(3,"th",24)(4,"th",24),e.qZA())}function ye(s,i){1&s&&e._UZ(0,"i",28)}function Pe(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"i",29),e.NdJ("click",function(n){e.CHM(t);const r=e.oxw().$implicit,l=e.oxw();return e.KtG(l.saveLogProfilePermissions(n,r))}),e.qZA()}}function Ae(s,i){if(1&s&&(e.TgZ(0,"tr",25)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,ye,1,0,"i",26),e.qZA(),e.TgZ(5,"td"),e.YNc(6,Pe,1,0,"i",27),e.qZA()()),2&s){const t=i.$implicit,o=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",t.isDefault),e.xp6(2),e.Q6J("ngIf",(null==o.selectedRows||null==o.selectedRows[0]?null:o.selectedRows[0]._id)===t._id)}}function Ie(s,i){1&s&&e._UZ(0,"p-progressSpinner",30)}let N=(()=>{class s{logProfileS;generalS;ns;navigationCS;authCS;constantsS;apiS;instanceS;functionS;schedulerS;amEventS;tpInstalledApisS;webSocketEventsS;confirmationService;eventCenterS;logProfilesFormC;loading={grid:!1};subscriptions=[];data={mode:g.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=d.iH._id;constructor(t,o,n,r,l,A,Qe,ke,qe,Ke,We,Ve,Be,He,je){this.logProfileS=t,this.generalS=o,this.ns=n,this.navigationCS=r,this.authCS=l,this.constantsS=A,this.apiS=Qe,this.instanceS=ke,this.functionS=qe,this.schedulerS=Ke,this.amEventS=We,this.tpInstalledApisS=Ve,this.webSocketEventsS=Be,this.confirmationService=He,this.eventCenterS=je}ngOnInit(){this.eventCenterS.group.selectedGroups.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===c.F.SAVED||t.action===c.F.UPDATED)&&(this.logProfilesFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Log Profile")}loadGridData(){var t=this;this.loading.grid=!0;const o={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1,isDefault:1},sort:{name:1}};this.showAll&&delete o.find.active,this.subscriptions.push(this.logProfileS.query(o).subscribe(function(){var n=(0,p.Z)(function*(r){r.success&&(t.selectedRows=[],t.rows=r.data,t.rowsMap=m.keyBy(t.rows,d.iH._id));let l=t.navigationCS.getQueryParam(f.p.log_profile);l?!t.rowsMap[l]&&t.rows.length&&(l=t.rows[0]._id):t.rows.length&&(l=t.rows[0]._id),t.rowsMap[l]&&(t.selectedRows=[t.rowsMap[l]],yield t.fillData()),t.generalS.setNewTitle("API Maker - Log Profile"),t.loading.grid=!1});return function(r){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=g.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.logProfilesFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.logProfilesFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.logProfilesFormC.showModal()}clone(){var t=this;return(0,p.Z)(function*(){try{if(!t.selectedRows[0])return;const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;delete o._id,delete o.queryParamsMap,o.isDefault=!1,o.name=`${o.name}-clone`,(yield t.logProfileS.post(o).toPromise()).success?(t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess),t.loadGridData()):t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess)}catch{t.ns.showError(t.constantsS.logProfile.cloneError)}})()}removePermanentDialog(){var t=this;return(0,p.Z)(function*(){var o;t.confirmationService.confirm({message:t.constantsS.logProfile.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,p.Z)(function*(){yield t.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const o=yield t.logProfileS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,o.success?(t.ns.showSuccess(t.constantsS.logProfile.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.ns.showErrorFromResponse(o,t.constantsS.logProfile.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.group.selectedGroups.next([])}resetDependents(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.group.selectedGroups.next([]),yield t.generalS.resetUrlParams([f.p.log_profile,f.p.api_category]),t.eventCenterS.apiCategory.selectedApiCategory.next([]),t.eventCenterS.group.instanceIds.next([]),t.eventCenterS.group.databaseNames.next([]),t.eventCenterS.group.collectionNames.next([]),t.eventCenterS.group.supportedApiIds.next([]),t.eventCenterS.group.customApiIds.next([]),t.eventCenterS.group.thirdPartyApiIds.next([]),t.eventCenterS.group.selectedSystemApis.next([]),t.eventCenterS.group.selectedFunctions.next([]),t.eventCenterS.group.selectedThirdPartyAPIs.next([]),t.eventCenterS.group.selectedSupportedAPIs.next([]),t.eventCenterS.group.selectedEvents.next([]),t.eventCenterS.group.selectedSchedulers.next([]),t.eventCenterS.group.selectedWebSocket.next([]),t.eventCenterS.group.apisRegex={}})()}logProfileSelected(){var t=this;return(0,p.Z)(function*(){t.resetDependents(),t.fillData()})()}fillData(){var t=this;return(0,p.Z)(function*(){if(!t.selectedRows.length)return void t.resetDependents();const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;o&&o.queryParams&&(t.eventCenterS.group.instanceIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.instanceNames,t.instanceS))||[]),t.eventCenterS.group.databaseNames.next(o.queryParams.databaseNames||[]),t.eventCenterS.group.collectionNames.next(o.queryParams.collectionNames||[]),t.eventCenterS.group.supportedApiIds.next(o.queryParams.supportedApiNames||[]),t.eventCenterS.group.customApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.customApiNames,t.functionS))||[]),t.eventCenterS.group.systemApiIds.next(o.queryParams.systemApiNames||[]),t.eventCenterS.group.thirdPartyApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.thirdPartyApiNames,t.tpInstalledApisS,v.R.THIRD_PARTY_APIS))||[]),t.eventCenterS.group.eventIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.eventNames,t.amEventS))||[]),t.eventCenterS.group.schedulersIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.schedulerNames,t.schedulerS))||[]),t.eventCenterS.group.webSocketIds.next(yield t.apiS.getIdArrFromNamesWebSocketEvents(o.queryParams.webSocketEventNames))),o&&(t.eventCenterS.group.selectedGroups.next([o]),t.eventCenterS.group.apisRegex=o.apisRegex,yield t.navigationCS.setQueryParam(f.p.log_profile,t.selectedRows[0]._id)),o?.queryParams||(yield t.resetDependents())})()}saveLogProfilePermissions(t,o){var n=this;return(0,p.Z)(function*(){t.stopImmediatePropagation();const r=JSON.parse(JSON.stringify(o));r.supportedApiLog=n.getApiLogObj(n.eventCenterS.group.selectedSupportedAPIs.value,d.qD._id),r.functionsLog=n.getApiLogObj(n.eventCenterS.group.selectedFunctions.value,d.qD.name),r.systemApisLog=n.getApiLogObj(n.eventCenterS.group.selectedSystemApis.value,d.qD._id),r.thirdPartyApisLog=n.getApiLogObj(n.eventCenterS.group.selectedThirdPartyAPIs.value,d.qD.nameId),r.eventLog=n.getApiLogObj(n.eventCenterS.group.selectedEvents.value,d.qD.name),r.schedulersLog=n.getApiLogObj(n.eventCenterS.group.selectedSchedulers.value,d.qD.name),r.webSocketEventsLog=n.getApiLogObj(n.eventCenterS.group.selectedWebSocket.value,d.qD.id),r.apisRegex=n.eventCenterS.group.apisRegex,r.queryParams={},r.user=n.authCS.getUserId(),r.queryParams.instanceNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.instanceIds.value,n.instanceS),r.queryParams.databaseNames=m.uniq(n.eventCenterS.group.databaseNames.value),r.queryParams.collectionNames=m.uniq(n.eventCenterS.group.collectionNames.value),r.queryParams.supportedApiNames=m.uniq(n.eventCenterS.group.supportedApiIds.value),r.queryParams.customApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.customApiIds.value,n.functionS),r.queryParams.systemApiNames=m.uniq(n.eventCenterS.group.systemApiIds.value),r.queryParams.thirdPartyApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.thirdPartyApiIds.value,n.tpInstalledApisS,v.R.THIRD_PARTY_APIS),r.queryParams.eventNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.eventIds.value,n.amEventS),r.queryParams.schedulerNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.schedulersIds.value,n.schedulerS),r.queryParams.webSocketEventNames=yield n.apiS.getNameArrFromIdsWebSocketEvents(n.eventCenterS.group.webSocketIds.value);try{const l=yield n.logProfileS.put(r._id,r,{select:d.iH._id}).toPromise();l&&l.success&&n.ns.showSuccess(n.constantsS.logProfile.editSuccess)}catch(l){n.ns.showErrorFromResponse(l.error||l,"Unable to save log profile.")}})()}getApiLogObj(t,o){const n={};for(const r of t)n[r[o]]={},r.saveResponseInLog&&(n[r[o]].saveResponseInLog=!0),m.isEmpty(n[r[o]])&&delete n[r[o]];return n}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickLogProfile(){this.selectedRows.length&&this.edit()}ERequestMethod=j.Yp;static \u0275fac=function(o){return new(o||s)(e.Y36(D.T),e.Y36(w.b),e.Y36(T.W),e.Y36(X.S),e.Y36(L.D),e.Y36(C.L),e.Y36(z.k),e.Y36(Z.E),e.Y36(ee.d),e.Y36(te.Z),e.Y36(ne.l),e.Y36(oe.d),e.Y36(se.a),e.Y36(h.YP),e.Y36(x.u))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles"]],viewQuery:function(o,n){if(1&o&&e.Gf(fe,5),2&o){let r;e.iGM(r=e.CRH())&&(n.logProfilesFormC=r.first)}},decls:20,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/log-profile.svg","alt","Log Profile",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/logs/log-profile.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped log-profile-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["logProfilesFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[2,"width","40px"],[3,"pSelectableRow"],["class","fas fa-check fa-fw text-success","pTooltip","This log profile is active now",4,"ngIf"],["pTooltip","Save log profile settings","class","fas fa-save text-success fa-fw cursor-pointer",3,"click",4,"ngIf"],["pTooltip","This log profile is active now",1,"fas","fa-check","fa-fw","text-success"],["pTooltip","Save log profile settings",1,"fas","fa-save","text-success","fa-fw","cursor-pointer",3,"click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Log Profiles"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return n.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,ve,2,0,"span",8),e.YNc(11,Ce,2,0,"span",9),e.YNc(12,Se,2,0,"span",10),e.qZA(),e.TgZ(13,"div",11)(14,"p-table",12),e.NdJ("selectionChange",function(l){return n.selectedRows=l})("selectionChange",function(){return n.logProfileSelected()})("dblclick",function(){return n.dblClickLogProfile()}),e.YNc(15,he,5,0,"ng-template",13),e.YNc(16,Ae,7,4,"ng-template",14),e.qZA(),e.YNc(17,Ie,1,0,"p-progressSpinner",15),e.qZA()(),e._UZ(18,"app-w-logProfiles-form",16,17)),2&o&&(e.xp6(10),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.xp6(3),e.Q6J("ngIf",n.loading.grid),e.xp6(1),e.Q6J("data",n.data))},dependencies:[S.O5,_.iA,h.jx,_.Ei,y.G,ae.u,E]})}return s})();function xe(s,i){if(1&s&&(e.TgZ(0,"div",4)(1,"span",5)(2,"h4",6),e._uU(3),e.qZA()()()),2&s){const t=e.oxw(2);e.xp6(3),e.Oqu(t.constantsS.logTable.setupExternalLogs)}}function Ze(s,i){1&s&&(e.TgZ(0,"div",30),e._UZ(1,"app-w-instances",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}function De(s,i){1&s&&(e.TgZ(0,"div",31),e._UZ(1,"app-w-databases",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}const we=function(){return[50,50]};function Te(s,i){if(1&s&&(e.TgZ(0,"div",7)(1,"div",8)(2,"div",9)(3,"div",10),e._UZ(4,"app-w-logProfiles"),e.qZA()(),e.TgZ(5,"div",11)(6,"div",10),e._UZ(7,"app-w-api-categories",12),e.qZA()(),e.TgZ(8,"div",13)(9,"p-splitter",14),e.YNc(10,Ze,2,3,"ng-template",15),e.YNc(11,De,2,3,"ng-template",15),e.qZA()(),e.TgZ(12,"div",16)(13,"div",10),e._UZ(14,"app-w-collections",17),e.qZA()(),e.TgZ(15,"div",18)(16,"div",10),e._UZ(17,"app-w-supported-api",19),e.qZA()(),e.TgZ(18,"div",20)(19,"div",10),e._UZ(20,"app-w-supported-tp-api",21),e.qZA()(),e.TgZ(21,"div",22)(22,"div",10),e._UZ(23,"app-custom-api-grid",23),e.qZA()(),e.TgZ(24,"div",24)(25,"div",10),e._UZ(26,"app-system-api-w",23),e.qZA()(),e.TgZ(27,"div",25)(28,"div",10),e._UZ(29,"app-events-grid",23),e.qZA()(),e.TgZ(30,"div",26)(31,"div",10),e._UZ(32,"app-scheduler-man-w",27),e.qZA()(),e.TgZ(33,"div",28)(34,"div",10),e._UZ(35,"app-web-socket-events-grid",29),e.qZA()()()()),2&s){const t=e.oxw(2);e.xp6(5),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length?"block":"none"),e.xp6(2),e.Q6J("typeIsGroup","LOG_PROFILE"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(1),e.Q6J("panelSizes",e.DdM(52,we)),e.xp6(3),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("isLPM",!0)("isDependentOnGroup",!0)("treeViewId","treeViewFromLogProfileLayout"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.THIRD_PARTY_APIS?"block":"none"),e.xp6(2),e.Q6J("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.CUSTOM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SYSTEM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.EVENTS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SCHEDULERS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsMultiSelect",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.WEB_SOCKET_EVENT?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("showCheckbox",!0)("isLPM",!0)}}function Le(s,i){1&s&&e._UZ(0,"p-progressSpinner",32)}function _e(s,i){if(1&s&&(e.TgZ(0,"div"),e.YNc(1,xe,4,1,"div",1),e.YNc(2,Te,36,53,"div",2),e.YNc(3,Le,1,0,"p-progressSpinner",3),e.qZA()),2&s){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",!t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.loading)}}let P=(()=>{class s{eventCenterS;instanceS;constantsS;isExternalLogsSetupDoneByRoot;loading;EAPICategory=v.R;constructor(t,o,n){this.eventCenterS=t,this.instanceS=o,this.constantsS=n}ngOnInit(){this.getExternalRedisSetupFromPackageJson()}getExternalRedisSetupFromPackageJson(){var t=this;return(0,p.Z)(function*(){t.loading=!0;try{const o=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading=!1,t.isExternalLogsSetupDoneByRoot=!0===o.isLogsSetupDone}catch{t.isExternalLogsSetupDoneByRoot=!1}})()}ngOnDestroy(){this.eventCenterS.group.apisRegex={}}EInstanceApiWidgetMode=R.a;static \u0275fac=function(o){return new(o||s)(e.Y36(x.u),e.Y36(Z.E),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-logProfile-layout"]],decls:1,vars:1,consts:[[4,"ngIf"],["class","overflow-hidden","style","height: calc(100vh - 46px);",4,"ngIf"],["class","pt-1 pl-1 pr-1 overflow-auto",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(100vh - 46px)"],[1,"text-center"],[1,"mt-5","pt-5"],[1,"pt-1","pl-1","pr-1","overflow-auto"],[2,"width","max-content"],[1,"v-div","w-profiles"],[1,"vertical-height-max"],[1,"v-div","w-categories"],[3,"typeIsGroup"],[1,"v-div","w-ins-db"],["layout","vertical",3,"panelSizes"],["pTemplate",""],[1,"v-div","w-collection"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup"],[1,"v-div","w-ins-apis"],[3,"isLPM","isDependentOnGroup","treeViewId"],[1,"v-div","w-third-party"],[3,"IsDependentOnGroup","isLPM"],[1,"v-div","w-custom-apis"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","isLPM"],[1,"v-div","w-system-apis"],[1,"v-div","w-events"],[1,"v-div","w-schedulers"],[3,"metaKeySelection","IsReadOnly","IsMultiSelect","IsDependentOnGroup","isLPM"],[1,"v-div","w-web-sockets"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","showCheckbox","isLPM"],[1,"vertical-height-instances","w-100"],[1,"vertical-height-db","w-100"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&e.YNc(0,_e,4,3,"div",0),2&o&&e.Q6J("ngIf",void 0!==n.isExternalLogsSetupDoneByRoot)},dependencies:[S.O5,h.jx,y.G,U.q,G.f,Y.O,J.n,Q.T,k.X,q.G,K.d,W.A,V.V,B.N,H.x,N],styles:[".vertical-height-instances[_ngcontent-%COMP%]{height:248px}.vertical-height-db[_ngcontent-%COMP%]{height:calc(100vh - 320px)}.vertical-height-max[_ngcontent-%COMP%]{height:calc(100vh - 66px)}.v-div[_ngcontent-%COMP%]{display:inline-block;height:calc(100vh - 62px);float:left}.w-profiles[_ngcontent-%COMP%]{width:20rem}.w-categories[_ngcontent-%COMP%]{width:17rem}.w-ins-db[_ngcontent-%COMP%]{width:25rem}.w-collection[_ngcontent-%COMP%]{width:28rem}.w-ins-apis[_ngcontent-%COMP%]{width:35rem}.w-custom-apis[_ngcontent-%COMP%], .w-system-apis[_ngcontent-%COMP%], .w-third-party[_ngcontent-%COMP%], .w-web-sockets[_ngcontent-%COMP%], .w-events[_ngcontent-%COMP%], .w-schedulers[_ngcontent-%COMP%]{width:calc(100vw - 37.5rem)}"]})}return s})();var Ee=a(2777),Ne=a(4186),Me=a(5765),be=a(7705),Oe=a(1678),Fe=a(4211),Re=a(1434),Ue=a(1558),Ge=a(8125);const Ye=[{path:"main",component:P,canActivate:[O.P]}];let Je=(()=>{class s{static \u0275fac=function(o){return new(o||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[M.Bz.forChild(Ye),b.u,Oe.DashboardM,Fe.DbCellM,Re.B,Ne.SystemApiM,Me.FunctionManM,Ee.u,be.L,Ue.SchedulerManM,Ge.AmEventsM,F.WebSocketEventsM]})}return s})()}}]);
|
|
1
|
+
"use strict";(self.webpackChunkapi_maker_fe=self.webpackChunkapi_maker_fe||[]).push([[148],{148:(Xe,I,a)=>{a.r(I),a.d(I,{LogProfileM:()=>Je});var M=a(7664),b=a(8761),O=a(3726),F=a(1025),p=a(5861),v=a(5085),R=a(2452),e=a(4946),x=a(2915),Z=a(3429),C=a(7414),S=a(6814),h=a(5219),y=a(7680),U=a(5043),G=a(3885),Y=a(559),J=a(6937),Q=a(356),k=a(9329),q=a(7595),K=a(3824),W=a(8651),V=a(6607),B=a(5305),H=a(2726),c=a(3157),g=a(328),f=a(6212),m=a(6990),d=a(1162),j=a(6925),D=a(7031),w=a(7240),T=a(9961),X=a(2189),L=a(5852),z=a(3065),ee=a(7629),te=a(1042),ne=a(7145),oe=a(2559),se=a(262),_=a(5431),ae=a(3259),u=a(95),re=a(2660),ie=a(8057);function le(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",23),e._uU(2," Add Log Profile"),e.qZA())}function pe(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",24),e._uU(2," View Log Profile"),e.qZA())}function de(s,i){1&s&&(e.TgZ(0,"span"),e._UZ(1,"i",25),e._uU(2," Edit Log Profile"),e.qZA())}function ce(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Save Log Profile"),e.qZA())}function ge(s,i){1&s&&(e.TgZ(0,"span"),e._uU(1,"Update Log Profile"),e.qZA())}function ue(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"button",26),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.save())}),e._UZ(1,"i",27),e.YNc(2,ce,2,0,"span",4),e.YNc(3,ge,2,0,"span",4),e.qZA()}if(2&s){const t=e.oxw();e.Q6J("disabled",t.form.invalid),e.xp6(2),e.Q6J("ngIf",t.data.mode===t.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",t.data.mode===t.EFormMode.EDIT)}}function me(s,i){1&s&&e._UZ(0,"p-progressSpinner",28)}let E=(()=>{class s{fb;ns;logProfileS;generalS;authCS;constantsS;data;loading={form:!1};EFormMode=g.D;form;subscriptions=[];constructor(t,o,n,r,l,A){this.fb=t,this.ns=o,this.logProfileS=n,this.generalS=r,this.authCS=l,this.constantsS=A}ngOnInit(){var t=this;this.createForm(),this.subscriptions.push(this.data.eventChannel.subscribe(function(){var o=(0,p.Z)(function*(n){if(n)if(t.form.enable(),n.action===c.F.OPEN_FORM_IN_EDIT_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data)}else if(n.action===c.F.OPEN_FORM_IN_VIEW_MODE){const r=yield t.logProfileS.getById(t.data.formData._id).toPromise();t.form.reset(),t.form.patchValue(r.data),t.form.disable()}else n.action===c.F.OPEN_FORM_IN_ADD_MODE&&(t.form.reset(),t.setDefaultValuesInForm())});return function(n){return o.apply(this,arguments)}}()))}createForm(){this.form=this.fb.group({name:[null,[u.kI.required]],isDefault:[!0,[]]})}setDefaultValuesInForm(){this.form.patchValue({isDefault:!0})}showModal(){$("#idLogProfileForm").modal("show")}hideModal(){$("#idLogProfileForm").modal("hide")}save(){var t=this;return(0,p.Z)(function*(){const o=t.form.getRawValue();o.user=t.authCS.getUserId();try{let n;t.loading.form=!0,t.data.mode===g.D.ADD?n=yield t.logProfileS.post(o).toPromise():t.data.mode===g.D.EDIT&&(n=yield t.logProfileS.put(t.data.formData._id,o,{select:d.iH._id}).toPromise()),t.ns.showSuccess(t.data.mode===g.D.ADD?t.constantsS.logProfile.addSuccess:t.constantsS.logProfile.editSuccess),t.data.eventChannel.emit({action:t.data.mode===g.D.ADD?c.F.SAVED:c.F.UPDATED}),t.loading.form=!1}catch(n){t.loading.form=!1,t.ns.showErrorFromResponse(n.error||n,"Unable to save log profile.")}})()}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}static \u0275fac=function(o){return new(o||s)(e.Y36(u.qu),e.Y36(T.W),e.Y36(D.T),e.Y36(w.b),e.Y36(L.D),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles-form"]],inputs:{data:"data"},decls:31,vars:7,consts:[["aria-hidden","true","aria-labelledby","exampleModalLabel","id","idLogProfileForm","role","dialog","data-backdrop","static","data-keyboard","false",1,"modal"],["role","document",1,"modal-dialog","modal-lg"],[1,"modal-content"],[1,"modal-header"],[4,"ngIf"],["aria-label","Close","data-dismiss","modal","type","button",1,"close"],["aria-hidden","true"],[1,"fas","fa-window-close"],[1,"modal-body","overflow-auto"],[1,"container","pt-3",3,"formGroup"],[1,"form-group","row"],[1,"col-8"],[1,"row"],[1,"col-4","col-form-label","col-form-label-sm","text-right"],["formControlName","name","name","name","spellcheck","false","type","text","placeholder","Please provide name",1,"form-control","form-control-sm"],[1,"col-4"],[1,"align-middle","mb-0","pt-1"],["formControlName","isDefault","inputId","idIsActive",3,"binary"],[1,"modal-footer"],["data-dismiss","modal","type","button",1,"btn","btn-sm","btn-secondary"],[1,"fas","fa-times","text-danger","fa-fw"],["class","btn btn-primary btn-sm","sava-no-dbl-click","","type","button",3,"disabled","click",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"fas","fa-plus","text-success","fa-fw","mr-1"],[1,"far","fa-eye","text-info","fa-fw","mr-1"],[1,"fas","fa-pencil-alt","text-light","fa-fw","mr-1"],["sava-no-dbl-click","","type","button",1,"btn","btn-primary","btn-sm",3,"disabled","click"],[1,"fas","fa-save","text-success","fa-fw","mr-1"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"div",2)(3,"div",3),e.YNc(4,le,3,0,"span",4),e.YNc(5,pe,3,0,"span",4),e.YNc(6,de,3,0,"span",4),e.TgZ(7,"button",5)(8,"span",6),e._UZ(9,"i",7),e.qZA()()(),e.TgZ(10,"div",8)(11,"form",9)(12,"div",10)(13,"div",11)(14,"div",12)(15,"label",13),e._uU(16,"Name"),e.qZA(),e.TgZ(17,"div",11),e._UZ(18,"input",14),e.qZA()()(),e.TgZ(19,"div",15)(20,"div",12)(21,"label",13),e._uU(22,"Active"),e.qZA(),e.TgZ(23,"label",16),e._UZ(24,"p-checkbox",17),e.qZA()()()()()(),e.TgZ(25,"div",18)(26,"button",19),e._UZ(27,"i",20),e._uU(28," Close"),e.qZA(),e.YNc(29,ue,4,3,"button",21),e.qZA(),e.YNc(30,me,1,0,"p-progressSpinner",22),e.qZA()()()),2&o&&(e.xp6(4),e.Q6J("ngIf",n.data.mode===n.EFormMode.ADD),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.data.mode===n.EFormMode.EDIT),e.xp6(5),e.Q6J("formGroup",n.form),e.xp6(13),e.Q6J("binary",!0),e.xp6(5),e.Q6J("ngIf",n.data.mode!==n.EFormMode.VIEW),e.xp6(1),e.Q6J("ngIf",n.loading.form))},dependencies:[u._Y,u.Fj,u.JJ,u.JL,u.sg,u.u,S.O5,re.y,y.G,ie.XZ],encapsulation:2})}return s})();const fe=["logProfilesFormC"];function ve(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",18),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.edit())}),e._UZ(1,"i",19),e.qZA()}}function Ce(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",20),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.clone())}),e._UZ(1,"i",21),e.qZA()}}function Se(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"span",22),e.NdJ("click",function(){e.CHM(t);const n=e.oxw();return e.KtG(n.removePermanentDialog())}),e._UZ(1,"i",23),e.qZA()}}function he(s,i){1&s&&(e.TgZ(0,"tr")(1,"th"),e._uU(2,"Name"),e.qZA(),e._UZ(3,"th",24)(4,"th",24),e.qZA())}function ye(s,i){1&s&&e._UZ(0,"i",28)}function Pe(s,i){if(1&s){const t=e.EpF();e.TgZ(0,"i",29),e.NdJ("click",function(n){e.CHM(t);const r=e.oxw().$implicit,l=e.oxw();return e.KtG(l.saveLogProfilePermissions(n,r))}),e.qZA()}}function Ae(s,i){if(1&s&&(e.TgZ(0,"tr",25)(1,"td"),e._uU(2),e.qZA(),e.TgZ(3,"td"),e.YNc(4,ye,1,0,"i",26),e.qZA(),e.TgZ(5,"td"),e.YNc(6,Pe,1,0,"i",27),e.qZA()()),2&s){const t=i.$implicit,o=e.oxw();e.Q6J("pSelectableRow",t),e.xp6(2),e.Oqu(t.name),e.xp6(2),e.Q6J("ngIf",t.isDefault),e.xp6(2),e.Q6J("ngIf",(null==o.selectedRows||null==o.selectedRows[0]?null:o.selectedRows[0]._id)===t._id)}}function Ie(s,i){1&s&&e._UZ(0,"p-progressSpinner",30)}let N=(()=>{class s{logProfileS;generalS;ns;navigationCS;authCS;constantsS;apiS;instanceS;functionS;schedulerS;amEventS;tpInstalledApisS;webSocketEventsS;confirmationService;eventCenterS;logProfilesFormC;loading={grid:!1};subscriptions=[];data={mode:g.D.ADD,eventChannel:new e.vpe,formData:void 0};rows=[];rowsMap={};showAll=!1;selectedRows=[];gridKey=d.iH._id;constructor(t,o,n,r,l,A,Qe,ke,qe,Ke,We,Ve,Be,He,je){this.logProfileS=t,this.generalS=o,this.ns=n,this.navigationCS=r,this.authCS=l,this.constantsS=A,this.apiS=Qe,this.instanceS=ke,this.functionS=qe,this.schedulerS=Ke,this.amEventS=We,this.tpInstalledApisS=Ve,this.webSocketEventsS=Be,this.confirmationService=He,this.eventCenterS=je}ngOnInit(){this.eventCenterS.group.selectedGroups.next([]),this.loadGridData(),this.subscriptions.push(this.data.eventChannel.subscribe(t=>{(t.action===c.F.SAVED||t.action===c.F.UPDATED)&&(this.logProfilesFormC.hideModal(),this.loadGridData())})),this.generalS.setNewTitle("API Maker - Log Profile")}loadGridData(){var t=this;this.loading.grid=!0;const o={find:{user:this.authCS.getUserId(),active:!0},select:{name:1,active:1,isDefault:1},sort:{name:1}};this.showAll&&delete o.find.active,this.subscriptions.push(this.logProfileS.query(o).subscribe(function(){var n=(0,p.Z)(function*(r){r.success&&(t.selectedRows=[],t.rows=r.data,t.rowsMap=m.keyBy(t.rows,d.iH._id));let l=t.navigationCS.getQueryParam(f.p.log_profile);l?!t.rowsMap[l]&&t.rows.length&&(l=t.rows[0]._id):t.rows.length&&(l=t.rows[0]._id),t.rowsMap[l]&&(t.selectedRows=[t.rowsMap[l]],yield t.fillData()),t.generalS.setNewTitle("API Maker - Log Profile"),t.loading.grid=!1});return function(r){return n.apply(this,arguments)}}()))}add(){this.data.formData=void 0,this.data.mode=g.D.ADD,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_ADD_MODE}),this.logProfilesFormC.showModal()}view(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.VIEW,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_VIEW_MODE}),this.logProfilesFormC.showModal()}edit(){this.data.formData=this.selectedRows[0],this.data.mode=g.D.EDIT,this.data.eventChannel.emit({action:c.F.OPEN_FORM_IN_EDIT_MODE}),this.logProfilesFormC.showModal()}clone(){var t=this;return(0,p.Z)(function*(){try{if(!t.selectedRows[0])return;const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;delete o._id,delete o.queryParamsMap,o.isDefault=!1,o.name=`${o.name}-clone`,(yield t.logProfileS.post(o).toPromise()).success?(t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess),t.loadGridData()):t.ns.showSuccess(t.constantsS.logProfile.cloneSuccess)}catch{t.ns.showError(t.constantsS.logProfile.cloneError)}})()}removePermanentDialog(){var t=this;return(0,p.Z)(function*(){var o;t.confirmationService.confirm({message:t.constantsS.logProfile.removePermanentConfirm,header:"Confirmation",icon:"pi pi-exclamation-triangle",accept:(o=(0,p.Z)(function*(){yield t.removePermanent()}),function(){return o.apply(this,arguments)})})})()}removePermanent(){var t=this;return(0,p.Z)(function*(){t.loading.grid=!0;const o=yield t.logProfileS.permanentDelete(t.selectedRows[0]._id).toPromise();t.loading.grid=!1,o.success?(t.ns.showSuccess(t.constantsS.logProfile.removePermanent),t.resetSelectedRows(),t.loadGridData()):t.ns.showErrorFromResponse(o,t.constantsS.logProfile.removePermanentError)})()}resetSelectedRows(){this.selectedRows.length=0,this.eventCenterS.group.selectedGroups.next([])}resetDependents(){var t=this;return(0,p.Z)(function*(){t.eventCenterS.group.selectedGroups.next([]),yield t.generalS.resetUrlParams([f.p.log_profile,f.p.api_category]),t.eventCenterS.apiCategory.selectedApiCategory.next([]),t.eventCenterS.group.instanceIds.next([]),t.eventCenterS.group.databaseNames.next([]),t.eventCenterS.group.collectionNames.next([]),t.eventCenterS.group.supportedApiIds.next([]),t.eventCenterS.group.customApiIds.next([]),t.eventCenterS.group.thirdPartyApiIds.next([]),t.eventCenterS.group.selectedSystemApis.next([]),t.eventCenterS.group.selectedFunctions.next([]),t.eventCenterS.group.selectedThirdPartyAPIs.next([]),t.eventCenterS.group.selectedSupportedAPIs.next([]),t.eventCenterS.group.selectedEvents.next([]),t.eventCenterS.group.selectedSchedulers.next([]),t.eventCenterS.group.selectedWebSocket.next([]),t.eventCenterS.group.apisRegex={}})()}logProfileSelected(){var t=this;return(0,p.Z)(function*(){t.resetDependents(),t.fillData()})()}fillData(){var t=this;return(0,p.Z)(function*(){if(!t.selectedRows.length)return void t.resetDependents();const o=(yield t.logProfileS.getById(t.selectedRows[0]._id).toPromise()).data;o&&o.queryParams&&(t.eventCenterS.group.instanceIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.instanceNames,t.instanceS))||[]),t.eventCenterS.group.databaseNames.next(o.queryParams.databaseNames||[]),t.eventCenterS.group.collectionNames.next(o.queryParams.collectionNames||[]),t.eventCenterS.group.supportedApiIds.next(o.queryParams.supportedApiNames||[]),t.eventCenterS.group.customApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.customApiNames,t.functionS))||[]),t.eventCenterS.group.systemApiIds.next(o.queryParams.systemApiNames||[]),t.eventCenterS.group.thirdPartyApiIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.thirdPartyApiNames,t.tpInstalledApisS,v.R.THIRD_PARTY_APIS))||[]),t.eventCenterS.group.eventIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.eventNames,t.amEventS))||[]),t.eventCenterS.group.schedulersIds.next((yield t.apiS.getIdArrFromNames(o.queryParams.schedulerNames,t.schedulerS))||[]),t.eventCenterS.group.webSocketIds.next(yield t.apiS.getIdArrFromNamesWebSocketEvents(o.queryParams.webSocketEventNames))),o&&(t.eventCenterS.group.selectedGroups.next([o]),t.eventCenterS.group.apisRegex=o.apisRegex,yield t.navigationCS.setQueryParam(f.p.log_profile,t.selectedRows[0]._id)),o?.queryParams||(yield t.resetDependents())})()}saveLogProfilePermissions(t,o){var n=this;return(0,p.Z)(function*(){t.stopImmediatePropagation();const r=JSON.parse(JSON.stringify(o));r.supportedApiLog=n.getApiLogObj(n.eventCenterS.group.selectedSupportedAPIs.value,d.qD._id),r.functionsLog=n.getApiLogObj(n.eventCenterS.group.selectedFunctions.value,d.qD.name),r.systemApisLog=n.getApiLogObj(n.eventCenterS.group.selectedSystemApis.value,d.qD._id),r.thirdPartyApisLog=n.getApiLogObj(n.eventCenterS.group.selectedThirdPartyAPIs.value,d.qD.nameId),r.eventLog=n.getApiLogObj(n.eventCenterS.group.selectedEvents.value,d.qD.name),r.schedulersLog=n.getApiLogObj(n.eventCenterS.group.selectedSchedulers.value,d.qD.name),r.webSocketEventsLog=n.getApiLogObj(n.eventCenterS.group.selectedWebSocket.value,d.qD.id),r.apisRegex=n.eventCenterS.group.apisRegex,r.queryParams={},r.user=n.authCS.getUserId(),r.queryParams.instanceNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.instanceIds.value,n.instanceS),r.queryParams.databaseNames=m.uniq(n.eventCenterS.group.databaseNames.value),r.queryParams.collectionNames=m.uniq(n.eventCenterS.group.collectionNames.value),r.queryParams.supportedApiNames=m.uniq(n.eventCenterS.group.supportedApiIds.value),r.queryParams.customApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.customApiIds.value,n.functionS),r.queryParams.systemApiNames=m.uniq(n.eventCenterS.group.systemApiIds.value),r.queryParams.thirdPartyApiNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.thirdPartyApiIds.value,n.tpInstalledApisS,v.R.THIRD_PARTY_APIS),r.queryParams.eventNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.eventIds.value,n.amEventS),r.queryParams.schedulerNames=yield n.apiS.getNameArrFromIds(n.eventCenterS.group.schedulersIds.value,n.schedulerS),r.queryParams.webSocketEventNames=yield n.apiS.getNameArrFromIdsWebSocketEvents(n.eventCenterS.group.webSocketIds.value);try{const l=yield n.logProfileS.put(r._id,r,{select:d.iH._id}).toPromise();l&&l.success&&n.ns.showSuccess(n.constantsS.logProfile.editSuccess)}catch(l){n.ns.showErrorFromResponse(l.error||l,"Unable to save log profile.")}})()}getApiLogObj(t,o){const n={};for(const r of t)n[r[o]]={},r.saveResponseInLog&&(n[r[o]].saveResponseInLog=!0),m.isEmpty(n[r[o]])&&delete n[r[o]];return n}ngOnDestroy(){this.generalS.unsubscribe(this.subscriptions)}dblClickLogProfile(){this.selectedRows.length&&this.edit()}ERequestMethod=j.Yp;static \u0275fac=function(o){return new(o||s)(e.Y36(D.T),e.Y36(w.b),e.Y36(T.W),e.Y36(X.S),e.Y36(L.D),e.Y36(C.L),e.Y36(z.k),e.Y36(Z.E),e.Y36(ee.d),e.Y36(te.Z),e.Y36(ne.l),e.Y36(oe.d),e.Y36(se.a),e.Y36(h.YP),e.Y36(x.u))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-w-logProfiles"]],viewQuery:function(o,n){if(1&o&&e.Gf(fe,5),2&o){let r;e.iGM(r=e.CRH())&&(n.logProfilesFormC=r.first)}},decls:20,vars:11,consts:[[1,"card","shadow-sm","h-100"],[1,"card-header"],["src","/assets/images/icons/log-profile.svg","alt","Log Profile",1,"fa-fw","mr-1"],[1,"float-right"],["href","https://docs.apimaker.dev/v1/docs/logs/log-profile.html","target","_blank"],["src","/assets/images/logo/logo_docs.svg",1,"fa-fw","ml-3","mr-1","mt-n1",2,"font-size","25px"],["pTooltip","Add New",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-plus","text-success","fa-fw"],["class","float-right cursor-pointer ml-3","pTooltip","Edit",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Clone",3,"click",4,"ngIf"],["class","float-right cursor-pointer ml-3","pTooltip","Permanent Delete",3,"click",4,"ngIf"],[1,"card-body","p-0","h-100","overflow-hidden"],["styleClass","p-datatable-striped log-profile-grid-height","scrollHeight","flex",3,"selectionMode","metaKeySelection","selection","dataKey","scrollable","value","selectionChange","dblclick"],["pTemplate","header"],["pTemplate","body"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[3,"data"],["logProfilesFormC",""],["pTooltip","Edit",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-pencil-alt","text-light","fa-fw"],["pTooltip","Clone",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"fas","fa-copy","text-warning","fa-fw"],["pTooltip","Permanent Delete",1,"float-right","cursor-pointer","ml-3",3,"click"],[1,"far","fa-trash-alt","fa-fw","text-danger"],[2,"width","40px"],[3,"pSelectableRow"],["class","fas fa-check fa-fw text-success","pTooltip","This log profile is active now",4,"ngIf"],["pTooltip","Save log profile settings","class","fas fa-save text-success fa-fw cursor-pointer",3,"click",4,"ngIf"],["pTooltip","This log profile is active now",1,"fas","fa-check","fa-fw","text-success"],["pTooltip","Save log profile settings",1,"fas","fa-save","text-success","fa-fw","cursor-pointer",3,"click"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&(e.TgZ(0,"div",0)(1,"div",1)(2,"span"),e._UZ(3,"img",2),e._uU(4," Log Profiles"),e.qZA(),e.TgZ(5,"div",3)(6,"a",4),e._UZ(7,"img",5),e.qZA()(),e.TgZ(8,"span",6),e.NdJ("click",function(){return n.add()}),e._UZ(9,"i",7),e.qZA(),e.YNc(10,ve,2,0,"span",8),e.YNc(11,Ce,2,0,"span",9),e.YNc(12,Se,2,0,"span",10),e.qZA(),e.TgZ(13,"div",11)(14,"p-table",12),e.NdJ("selectionChange",function(l){return n.selectedRows=l})("selectionChange",function(){return n.logProfileSelected()})("dblclick",function(){return n.dblClickLogProfile()}),e.YNc(15,he,5,0,"ng-template",13),e.YNc(16,Ae,7,4,"ng-template",14),e.qZA(),e.YNc(17,Ie,1,0,"p-progressSpinner",15),e.qZA()(),e._UZ(18,"app-w-logProfiles-form",16,17)),2&o&&(e.xp6(10),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(1),e.Q6J("ngIf",n.selectedRows.length),e.xp6(2),e.Q6J("selectionMode","multiple")("metaKeySelection",!0)("selection",n.selectedRows)("dataKey",n.gridKey)("scrollable",!0)("value",n.rows),e.xp6(3),e.Q6J("ngIf",n.loading.grid),e.xp6(1),e.Q6J("data",n.data))},dependencies:[S.O5,_.iA,h.jx,_.Ei,y.G,ae.u,E]})}return s})();function xe(s,i){if(1&s&&(e.TgZ(0,"div",4)(1,"span",5)(2,"h4",6),e._uU(3),e.qZA()()()),2&s){const t=e.oxw(2);e.xp6(3),e.Oqu(t.constantsS.logTable.setupExternalLogs)}}function Ze(s,i){1&s&&(e.TgZ(0,"div",30),e._UZ(1,"app-w-instances",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}function De(s,i){1&s&&(e.TgZ(0,"div",31),e._UZ(1,"app-w-databases",17),e.qZA()),2&s&&(e.xp6(1),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0))}const we=function(){return[50,50]};function Te(s,i){if(1&s&&(e.TgZ(0,"div",7)(1,"div",8)(2,"div",9)(3,"div",10),e._UZ(4,"app-w-logProfiles"),e.qZA()(),e.TgZ(5,"div",11)(6,"div",10),e._UZ(7,"app-w-api-categories",12),e.qZA()(),e.TgZ(8,"div",13)(9,"p-splitter",14),e.YNc(10,Ze,2,3,"ng-template",15),e.YNc(11,De,2,3,"ng-template",15),e.qZA()(),e.TgZ(12,"div",16)(13,"div",10),e._UZ(14,"app-w-collections",17),e.qZA()(),e.TgZ(15,"div",18)(16,"div",10),e._UZ(17,"app-w-supported-api",19),e.qZA()(),e.TgZ(18,"div",20)(19,"div",10),e._UZ(20,"app-w-supported-tp-api",21),e.qZA()(),e.TgZ(21,"div",22)(22,"div",10),e._UZ(23,"app-custom-api-grid",23),e.qZA()(),e.TgZ(24,"div",24)(25,"div",10),e._UZ(26,"app-system-api-w",23),e.qZA()(),e.TgZ(27,"div",25)(28,"div",10),e._UZ(29,"app-events-grid",23),e.qZA()(),e.TgZ(30,"div",26)(31,"div",10),e._UZ(32,"app-scheduler-man-w",27),e.qZA()(),e.TgZ(33,"div",28)(34,"div",10),e._UZ(35,"app-web-socket-events-grid",29),e.qZA()()()()),2&s){const t=e.oxw(2);e.xp6(5),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length?"block":"none"),e.xp6(2),e.Q6J("typeIsGroup","LOG_PROFILE"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(1),e.Q6J("panelSizes",e.DdM(52,we)),e.xp6(3),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.INSTANCES?"block":"none"),e.xp6(2),e.Q6J("isLPM",!0)("isDependentOnGroup",!0)("treeViewId","treeViewFromLogProfileLayout"),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.THIRD_PARTY_APIS?"block":"none"),e.xp6(2),e.Q6J("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.CUSTOM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SYSTEM_APIS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.EVENTS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.SCHEDULERS?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsMultiSelect",!0)("IsDependentOnGroup",!0)("isLPM",!0),e.xp6(1),e.Udp("display",t.eventCenterS.group.selectedGroups.value.length&&(null==t.eventCenterS.apiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory||null==t.eventCenterS.apiCategory.selectedApiCategory.value||null==t.eventCenterS.apiCategory.selectedApiCategory.value[0]?null:t.eventCenterS.apiCategory.selectedApiCategory.value[0].id)===t.EAPICategory.WEB_SOCKET_EVENT?"block":"none"),e.xp6(2),e.Q6J("metaKeySelection",!1)("IsReadOnly",!0)("IsDependentOnGroup",!0)("showCheckbox",!0)("isLPM",!0)}}function Le(s,i){1&s&&e._UZ(0,"p-progressSpinner",32)}function _e(s,i){if(1&s&&(e.TgZ(0,"div"),e.YNc(1,xe,4,1,"div",1),e.YNc(2,Te,36,53,"div",2),e.YNc(3,Le,1,0,"p-progressSpinner",3),e.qZA()),2&s){const t=e.oxw();e.xp6(1),e.Q6J("ngIf",!t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.isExternalLogsSetupDoneByRoot),e.xp6(1),e.Q6J("ngIf",t.loading)}}let P=(()=>{class s{eventCenterS;instanceS;constantsS;isExternalLogsSetupDoneByRoot;loading;EAPICategory=v.R;constructor(t,o,n){this.eventCenterS=t,this.instanceS=o,this.constantsS=n}ngOnInit(){this.getExternalRedisSetupFromPackageJson()}getExternalRedisSetupFromPackageJson(){var t=this;return(0,p.Z)(function*(){t.loading=!0;try{const o=(yield t.instanceS.getExternalSetupStatus().toPromise()).data;t.loading=!1,t.isExternalLogsSetupDoneByRoot=!0===o.isLogsSetupDone}catch{t.isExternalLogsSetupDoneByRoot=!1}})()}ngOnDestroy(){this.eventCenterS.group.apisRegex={}}EInstanceApiWidgetMode=R.a;static \u0275fac=function(o){return new(o||s)(e.Y36(x.u),e.Y36(Z.E),e.Y36(C.L))};static \u0275cmp=e.Xpm({type:s,selectors:[["app-logProfile-layout"]],decls:1,vars:1,consts:[[4,"ngIf"],["class","overflow-hidden","style","height: calc(100vh - 46px);",4,"ngIf"],["class","pt-1 pl-1 pr-1 overflow-auto",4,"ngIf"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s",4,"ngIf"],[1,"overflow-hidden",2,"height","calc(100vh - 46px)"],[1,"text-center"],[1,"mt-5","pt-5"],[1,"pt-1","pl-1","pr-1","overflow-auto"],[2,"width","max-content"],[1,"v-div","w-profiles"],[1,"vertical-height-max"],[1,"v-div","w-categories"],[3,"typeIsGroup"],[1,"v-div","w-ins-db"],["layout","vertical",3,"panelSizes"],["pTemplate",""],[1,"v-div","w-collection"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup"],[1,"v-div","w-ins-apis"],[3,"isLPM","isDependentOnGroup","treeViewId"],[1,"v-div","w-third-party"],[3,"IsDependentOnGroup","isLPM"],[1,"v-div","w-custom-apis"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","isLPM"],[1,"v-div","w-system-apis"],[1,"v-div","w-events"],[1,"v-div","w-schedulers"],[3,"metaKeySelection","IsReadOnly","IsMultiSelect","IsDependentOnGroup","isLPM"],[1,"v-div","w-web-sockets"],[3,"metaKeySelection","IsReadOnly","IsDependentOnGroup","showCheckbox","isLPM"],[1,"vertical-height-instances","w-100"],[1,"vertical-height-db","w-100"],["styleClass","w-4rem h-4rem","strokeWidth","4","animationDuration",".5s"]],template:function(o,n){1&o&&e.YNc(0,_e,4,3,"div",0),2&o&&e.Q6J("ngIf",void 0!==n.isExternalLogsSetupDoneByRoot)},dependencies:[S.O5,h.jx,y.G,U.q,G.f,Y.O,J.n,Q.T,k.X,q.G,K.d,W.A,V.V,B.N,H.x,N],styles:[".vertical-height-instances[_ngcontent-%COMP%]{height:248px}.vertical-height-db[_ngcontent-%COMP%]{height:calc(100vh - 320px)}.vertical-height-max[_ngcontent-%COMP%]{height:calc(100vh - 66px)}.v-div[_ngcontent-%COMP%]{display:inline-block;height:calc(100vh - 62px);float:left}.w-profiles[_ngcontent-%COMP%]{width:20rem}.w-categories[_ngcontent-%COMP%]{width:17rem}.w-ins-db[_ngcontent-%COMP%]{width:25rem}.w-collection[_ngcontent-%COMP%]{width:28rem}.w-ins-apis[_ngcontent-%COMP%]{width:35rem}.w-custom-apis[_ngcontent-%COMP%], .w-system-apis[_ngcontent-%COMP%], .w-third-party[_ngcontent-%COMP%], .w-web-sockets[_ngcontent-%COMP%], .w-events[_ngcontent-%COMP%], .w-schedulers[_ngcontent-%COMP%]{width:calc(100vw - 37.5rem)}"]})}return s})();var Ee=a(2777),Ne=a(4186),Me=a(5765),be=a(7705),Oe=a(1678),Fe=a(4211),Re=a(1434),Ue=a(1558),Ge=a(8125);const Ye=[{path:"main",component:P,canActivate:[O.P]}];let Je=(()=>{class s{static \u0275fac=function(o){return new(o||s)};static \u0275mod=e.oAB({type:s});static \u0275inj=e.cJS({imports:[M.Bz.forChild(Ye),b.u,Oe.DashboardM,Fe.DbCellM,Re.B,Ne.SystemApiM,Me.FunctionManM,Ee.u,be.L,Ue.SchedulerManM,Ge.AmEventsM,F.WebSocketEventsM]})}return s})()}}]);
|